program

stmtstmt

stmt

statementstatement

statement

empty_statementempty_statement assignment_stmtassignment_stmt while_stmtwhile_stmt if_stmtif_stmt print_stmtprint_stmt putc_stmtputc_stmt stmt_liststmt_list

empty_statement

SEMISEMI

assignment_stmt

identifieridentifier EQEQ arith_operand_expressionarith_operand_expression SEMISEMI

identifier

'while' 'if' 'print' 'putc' 'else' [NOT] ident_nameident_name [combine]

ident_name

W:(A-Z_a-zªµºÀ-Ö..., 0-9A-Z_a-zªµ·...)

EQ

'='

arith_operand_expression

|| operations|| operations

|| operations

&& operations&& operations |||| && operations&& operations && operations&& operations

&& operations

== | != operations== | != operations &&&& == | != operations== | != operations == | != operations== | != operations

== | != operations

<= | < | >= | > operations<= | < | >= | > operations == | !=== | != <= | < | >= | > operations<= | < | >= | > operations <= | < | >= | > operations<= | < | >= | > operations

<= | < | >= | > operations

+ | - operations+ | - operations <= | < | >= | ><= | < | >= | > + | - operations+ | - operations + | - operations+ | - operations

+ | - operations

* | / | % operations* | / | % operations + | -+ | - * | / | % operations* | / | % operations * | / | % operations* | / | % operations

* | / | % operations

+ | - | ! operations+ | - | ! operations * | / | %* | / | % + | - | ! operations+ | - | ! operations + | - | ! operations+ | - | ! operations

+ | - | ! operations

+ | - | !+ | - | ! + | - | ! operations+ | - | ! operations identifieridentifier integerinteger charchar nested_arith_operandnested_arith_operand

+ | - | !

[+\-!]

integer

W:(0-9)

char

'\\?.'

nested_arith_operand

'(' [suppress] arith_operand_expressionarith_operand_expression ')' [suppress]

* | / | %

[*/%]

+ | -

[+\-]

<= | < | >= | >

<=|<|>=|>

== | !=

==|!=

&&

\&\&

||

\|\|

while_stmt

WHILEWHILE paren_exprparen_expr stmtstmt

WHILE

'while'

paren_expr

LPARLPAR arith_operand_expressionarith_operand_expression RPARRPAR

if_stmt

IFIF paren_exprparen_expr stmtstmt ELSEELSE stmtstmt

IF

'if'

ELSE

'else'

print_stmt

PRINTPRINT LPARLPAR prt_listprt_list RPARRPAR SEMISEMI

PRINT

'print'

LPAR

'(' [suppress]

prt_list

quoted stringquoted string arith_operand_expressionarith_operand_expression ',' [suppress] quoted stringquoted string arith_operand_expressionarith_operand_expression

quoted string

string enclosed in '"'

RPAR

')' [suppress]

putc_stmt

PUTCPUTC paren_exprparen_expr SEMISEMI

PUTC

'putc'

SEMI

';' [suppress]

stmt_list

LBRACELBRACE stmtstmt RBRACERBRACE

LBRACE

'{' [suppress]

RBRACE

'}' [suppress]