-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathREADME
32 lines (26 loc) · 781 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
See "Análisis Sintáctico Predictivo Recursivo"
http://nereida.deioc.ull.es/~pl/perlexamples/node85.html
for a detailed description
Example for "Procesadores de Lenguajes"
Grado de Informática
Universidad de La Laguna
This project contains an example of an infix to postfix translator
for the 'simple assignment' language generated by the grammar below.
The translator conforms to the recursive predictive descendant technique.
assignment : expression '=' assignment
| expression
;
expression : expression ADDOP term
| term
;
term : term MULOP factor
| factor
factor : NUMBER
| ID
| '(' assignment ')'
;
where:
ADDOP = /^[-+]$/
MULOP = %r{^[*/]$}
NUMBER = /^\d+$/
ID = /[a-zA-Z_]\w*/