Question: The second project involves modifying the syntactic analyzer for the sattached compiler by adding to the existing grammar. The full grammar of the language is

The second project involves modifying the syntactic analyzer for the
sattached compiler by
adding to the existing grammar. The full grammar of the language is shown below. The
highlighted portions of the grammar show what you must either modify or add to the existing
grammar.
function:
function_header {variable} body
function_header:
FUNCTIN IDENTIFIER RETURNS type;
variable:
IDENTIFIER : type IS statement ;
IDENTIFIER : LIST OF type IS list ;
list:
( expression {, expression })
parameters:
parameter {, parameter }
parameter:
IDENTIFIER : type
type:
INTEGER | REAL | CHARACTER
body:
BEGIN statement END;
statement:
expression ; |
WHEN condition, expression : expression ;
SWITCH expression IS {case} OTHERS ARROW statement ENDSWITCH ;
IF condition THEN statement {ELSIF condition THEN statement}
ELSE statement ENDIF ;
FOLD direction operator list_choice ENDFOLD ;
case:
CASE INT_LITERAL ARROW statement
direction:
LEFT | RIGHT
operator:
ADDOP | MULOP
list choice:
list |
IDENTIFIER
condition:
 The second project involves modifying the syntactic analyzer for the sattached

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 Databases Questions!