Is there a syntax that permits methods to be used in semantic
lookahead? Instead of writing
void BC() :
{}
{
"b"
[ LOOKAHEAD( { getToken(1).kind == C && getToken(2).kind != C } )
<C:"c">
]
}
I wanr write
void BC() :
{}
{
"b"
[ LOOKAHEAD( { myBoolMethod(1, C) } )
<C:"c">
]
}
with
boolean myBoolMethod(int k, Token t)
{
return getToken(k).kind == t && getToken(k+1).kind != t
}
defined somewhere, so that myBoolMethod can be reused elsewhere in the
grammar.
Thx.