Question: Show how you would modify the Mini - Triangle production rules as [ 2 0 ] follows: Allow identifiers to contain single embedded @ characters
Show how you would modify the MiniTriangle production rules as
follows:
Allow identifiers to contain single embedded @ characters eg 'set @ up but not 'set @ @up nor 'set @ nor @up
Allow realliterals eg but not nor
MiniTriangle Production Rules
Program :: singleCommand
Command :: singleCommand Command ; singleCommand
singleCommand :: Vname : Expression I Identifier Expression
if Expression then singleCommand else singleCommand while Expression do singleCommand let Declaration in singleCommand begin Command end
Expression : : primaryExpression Expression Operator primaryExpression
primaryExpression :: IntegerLiteral Vname Operator primaryExpression Expression
Vname : : ldentifier
Declaration :: singleDeclaration Declaration ; singleDeclaration singleDeclaration : : const Identifier Expression var Identifier : Typedenoter
Typedenoter :: Identifier
Operator : :
Identifier : : Letter Identifier Letter 'Identifier Digit IntegerLiteral :: Digit IntegerLiteral Digit Comment : : Graphic eol
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
