Class actions to represent an arithmetic expression as a tree using recursive descent.
- Source:
- See:
Methods
-
add()
-
add: '+' product;returns[ 'add' null product ] -
divide()
-
divide: '/' signed;returns[ 'divide' null signed ] -
list()
-
list: sum [{ ',' sum }];returns[ 'list' sum ... ] -
multiply()
-
multiply: '*' signed;returns[ 'multiply' null signed ] -
number()
-
number: Number;returns[ 'number' number ] -
product()
-
product: signed [{ multiply | divide }];returns tree -
signed()
-
signed: [ '-' ] term;returnstermor[ 'minus' term ] -
subtract()
-
subtract: '-' product;returns[ 'subtract' null product ] -
sum()
-
sum: product [{ add | subtract }];returns tree -
term()
-
term: number | name | '(' sum ')';returns tree