Hello,
I have the current grammar:
void UnaryExpression() #void : {}
{
( <OP_PLUS> | <OP_MINUS> ) UnaryExpression() | <NOT> UnaryExpression() | PosFix()
}
void PosFix() #void : {}
{
( PosFix() "[" Expression() "]" ) #indexNode
|
( PosFix() "." Literal() ) #fieldNode
}
void PrimaryExpression() #void : {}
{
<LPARENT> Expression() <RPARENT> | Literal()
}
how to do the left factorization in order to generate the indexNode and fieldNode in correct order?
exemple a tree:
index
/ \
/ field
/| | index
/ | | /\
a[1].b[2]
thanx