| <PHPECHOSTART : "<?="> {PHPParser.createNewHTMLCode();} : PHPPARSING
}
-<PHPPARSING> TOKEN :
+<PHPPARSING, IN_SINGLE_LINE_COMMENT> TOKEN :
{
<PHPEND :"?>"> {PHPParser.htmlStart = SimpleCharStream.getPosition();} : DEFAULT
}
<IN_SINGLE_LINE_COMMENT> SPECIAL_TOKEN :
{
<SINGLE_LINE_COMMENT: "\n" | "\r" | "\r\n" > : PHPPARSING
-| "?>" : DEFAULT
+| < ~[] >
}
<IN_SINGLE_LINE_COMMENT,IN_FORMAL_COMMENT,IN_MULTI_LINE_COMMENT> SPECIAL_TOKEN :
Variable Var(final Token dollar) :
{
- Variable variable;
+ Variable variable = null;
final Token token;
ConstantIdentifier constant;
}
{
- token = <DOLLAR_ID> variable = Var(token)
- {final StringBuffer buff = new StringBuffer();
+ token = <DOLLAR_ID> [variable = Var(token)]
+ {if (variable == null) {
+ return new Variable(token.image.substring(1),token.sourceStart,token.sourceEnd);
+ }
+ final StringBuffer buff = new StringBuffer();
buff.append(token.image.substring(1));
buff.append(variable.toStringExpression());
return new Variable(buff.toString(),dollar.sourceStart,variable.sourceEnd);
}
|
+ LOOKAHEAD(<DOLLAR> <DOLLAR>)
token = <DOLLAR> variable = Var(token)
{return new Variable(variable,dollar.sourceStart,variable.sourceEnd);}
|