I'm trying to parse things like this:
where length matches "5000" (status matches "200" OR status matches "302")
where
: WHERE whereExpression
;
whereExpression
: Identifier MATCHES StringLiteral
| LPAREN whereExpression RPAREN
| whereExpression AND whereExpression
| whereExpression OR whereExpression
;
WHERE: 'where' ;
Now if I need to get the value of Identifier
and StringLiteral
I could just use the $
stuff.
But how can I get the value from the whereExpression AND whereExpression
pattern?
I've been thinking about replacing it with Identifier MATCHES StringLiteral AND Identifier MATCHES StringLiteral
But in that case I would have two variables with the same name.
What's the right solution?