KEY FEATURES.
A TRANSLATION SCHEME is a context-free grammar in which semantic rules are embedded within the right sides of the productions.
= {,}. | (6) |
Production | Semantic Rule |
A a | A.str := a |
A (B) | A.str := B.str |
A B f C | A.str := concat(B.str, C.str, " f") |
It is possible to speed up translations from L to L' by considering the following translation scheme.
A | a { output(a) } | |
A | (B) { } | |
A | B f C { output(f) } |
We illustrate the notions of syntax tree and translation scheme with the expression a + (a + d )*(b - c).