"/*" : IN_MULTI_LINE_COMMENT
}
-<IN_SINGLE_LINE_COMMENT>
-SPECIAL_TOKEN :
+<IN_SINGLE_LINE_COMMENT> SPECIAL_TOKEN :
{
- <SINGLE_LINE_COMMENT: "\n" | "\r" | "\r\n" | "?>" > : PHPPARSING
+ <SINGLE_LINE_COMMENT: "\n" | "\r" | "\r\n" > : PHPPARSING
+}
+
+<IN_SINGLE_LINE_COMMENT> TOKEN :
+{
+ <SINGLE_LINE_COMMENT_PHPEND : "?>" > : DEFAULT
}
<IN_FORMAL_COMMENT>
| < TRUE: "true" >
| < WHILE: "while" >
| < ENDWHILE : "endwhile" >
+| <FOREACH : "foreach" >
+| <AS : "as" >
}
/* TYPES */
|
<INTEGER>
{return "integer";}
+|
+ <OBJECT>
+ {return "object";}
}
String Expression() :
|
ForStatement()
|
+ ForeachStatement()
+|
BreakStatement()
|
ContinueStatement()
}
}
+void ForeachStatement() :
+{}
+{
+ <FOREACH> <LPAREN> Variable() <AS> Variable() [ <ARRAYASSIGN> Expression() ] <RPAREN> Statement()
+}
+
void ForStatement() :
{}
{