SELECT
NARROW[parseTree, CParser.CParseTree].production
FROM
Two operand productions:
Expressionmore, AssignmentExpressioneq, AssignmentExpressionmuleq,
AssignmentExpressiondiveq,
AssignmentExpressionmodeq, AssignmentExpressionaddeq, AssignmentExpressionsubeq,
AssignmentExpressionshiftleq, AssignmentExpressionshiftreq,
AssignmentExpressionandeq, AssignmentExpressionxoreq, AssignmentExpressionoreq,
LogicalOrExpressionmore, LogicalAndExpressionmore, InclusiveOrExpressionmore,
ExclusiveOrExpressionmore, AndExpressionmore, EqualityExpressioneq,
EqualityExpressionneq, RelationalExpressionlt, RelationalExpressiongt,
RelationalExpressionle, RelationalExpressionge, ShiftExpressionleft,
ShiftExpressionright, AdditiveExpressionadd, AdditiveExpressionsub,
MultiplicativeExpressionmul, MultiplicativeExpressiondiv,
MultiplicativeExpressionmod, CastExpressioncast,
PostfixExpressionarray, PostfixExpressioncall, PostfixExpressionrecord,
PostfixExpressionrecptr, ArgumentExpressionListmore => {
IO.PutRope[outStream,"\n"];
PrintParseTree[outStream, NARROW[parseTree, CParser.CParseTree].children[0], depth+2];
PrintParseTree[outStream, NARROW[parseTree, CParser.CParseTree].children[1], depth+2];
};
One operand productions:
UnaryExpressioninc, UnaryExpressiondec, UnaryExpressionand, UnaryExpressionptr,
UnaryExpressionsub, UnaryExpressionbnot, UnaryExpressionlnot,
UnaryExpressionsizeexpr, UnaryExpressionsizetype, PostfixExpressioninc,
PostfixExpressiondec, PrimaryExpressionparen => {
IO.PutRope[outStream,"\n"];
PrintParseTree[outStream, NARROW[parseTree, CParser.CParseTree].children[0], depth+2]
};
No operand productions:
Start, TypeNamevoid, TypeNamechar, TypeNameshort, TypeNameint, TypeNamelong,
TypeNamefloat, TypeNamedouble, TypeNamesigned, TypeNameunsigned => {
IO.PutRope[outStream,"\n"]
};
Three operand productions:
ConditionalExpressionmore => {
IO.PutRope[outStream,"\n"];
PrintParseTree[outStream, NARROW[parseTree, CParser.CParseTree].children[0], depth+2];
PrintParseTree[outStream, NARROW[parseTree, CParser.CParseTree].children[1], depth+2];
PrintParseTree[outStream, NARROW[parseTree, CParser.CParseTree].children[2], depth+2]
};
No operation productions:
PrintResult, Expressionone, AssignmentExpressioncond,
ConditionalExpressionmore,
LogicalOrExpressionone, LogicalAndExpressionone,
InclusiveOrExpressionone, ExclusiveOrExpressionone,
AndExpressionone, EqualityExpressionrel, RelationalExpressionone,
ShiftExpressionadd, AdditiveExpressionmul, MultiplicativeExpressioncast,
CastExpressionunary, UnaryExpressionpost, PostfixExpressionprimary,
PrimaryExpressionid, PrimaryExpressionconst,
PrimaryExpressionstring, PrimaryExpressionparen, ArgumentExpressionListone,
Constantint, Constantchar, Constantfloat, Constantenum => ERROR;
Terminals
IntegerConstant =>
IO.PutF1[outStream," = %g\n", IO.int[NARROW[NARROW[parseTree, CParser.CParseTree].children[0], REF INT]]];
CharacterConstant =>
IO.PutF1[outStream," = %g\n", IO.char[NARROW[NARROW[parseTree, CParser.CParseTree].children[0], REF CHAR]]];
FloatingConstant =>
IO.PutF1[outStream," = %g\n", IO.real[NARROW[NARROW[parseTree, CParser.CParseTree].children[0], REF REAL]]];
String =>
IO.PutF1[outStream," = %g\n", IO.rope[NARROW[NARROW[parseTree, CParser.CParseTree].children[0], Rope.ROPE]]];
Identifier =>
IO.PutF1[outStream," = %g\n", IO.rope[NARROW[NARROW[parseTree, CParser.CParseTree].children[0], Rope.ROPE]]]
ENDCASE => ERROR
}