Skip to content

Semantic actions for calculation

Pre-release
Pre-release
Compare
Choose a tag to compare
@romildo romildo released this 10 Oct 09:24
· 112 commits to master since this release
  • Add semantic actions to the grammar
    • The terminal symbol for literal number and the non terminal symbols receives a semantic value of type Double, corresponding to their value when evaluated.
    • The semantic actions evaluate the operations indicated in each production rule, calculating the semantic value of the symbol in its left hand side.
    • At the end the start symbol semantic value is the value of the whole expression.