Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started