Question: ArithLang is a language with simple arithmetic expressions with the following concrete syntax . Expression ::= Number ::= Expression + Expression ::= Expression - Expression

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.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!