printing ReturnStatementNode nodes

git-svn-id: svn://anubis/jtlc/trunk@25 f5bc74b8-7b62-4e90-9214-7121d538519f
This commit is contained in:
josh committed 2010-01-19 06:23:40 +00:00
1 parent 922c1bc4b4
commit b23442a2f4
8 files changed
+79 -2

No files matched your search

+17 -1
View File
@@ -273,7 +273,12 @@ return_statement: RETURN expression SEMICOLON {
;
expression: assign_expr {
$$ = $1;
$$ = new ExpressionNode();
$$->addChild($1);
}
| literal {
$$ = new ExpressionNode();
$$->addChild($1);
}
;
@@ -284,6 +289,17 @@ assign_expr: lvalue ASSIGN expression {
}
;
literal: INT_LITERAL {
$$ = $1;
}
| REAL_LITERAL {
$$ = $1;
}
| STRING_LITERAL {
$$ = $1;
}
;
lvalue: IDENTIFIER {
$$ = new LValueNode();
$$->addChild($1);