ArithLang is a language with simple arithmetic expressions with the following concrete syntax . Expression ::= Number
Fantastic news! We've Found the answer you've been seeking!
Question:
ArithLangis a language with simple arithmetic expressions with the followingconcrete syntax.
Expression ::= Number
::= Expression + Expression
::= Expression - Expression
::= Expression * Expression
::= Expression / Expression
InArithLang's syntax,Numberdenotes a number and+,-, *and/denote arithmetic plus, minus, multiplication and division operations.
Design and define a datatype calledExpressionto represent theabstract syntaxofArithLang.
Hint:You can usedefine-datatypeconstruct to define the abstract syntax.
Posted Date: