- Expresii infix:
expresie ::= termen rest_term
rest_term ::= vid | '+' termen rest_term | '-' termen rest_term
termen ::= factor rest_fact
rest_fact ::= vid | '*' factor rest_fact | '/' factor rest_fact
factor ::= numar | '(' expresie ')'
- Expresii postfix (expresie expresie operator).
Exemplu: 4 5 2 - * rezulta in 4 * (5 - 2) = 12
expresie ::= numar rest
rest ::= vid | expresie operator rest
- Expresii prefix (operator expresie expresie).
Exemplu: - * 4 5 2 rezulta in 4 * 5 - 2 = 18
expresie ::= numar | operator expresie expresie