
resourceExpression.Production = getResourceQuantityExpression.Optional() + resourceRelationalExpression;
getStatement.Production = @get + resourceExpression.OnErrorContinue();
There are cases where getResourceQuantityExpression and resourceRelationalExpression can match the same text and with getResourceQuantityExpression being optional the goal is to only have it match if there is a resourceRelationalExpression present after it. I have tried adding a CanMatchCallback to getResourceQuantityExpression to look ahead and try and determine if there is a resourceRelationalExpression ahead of it and can get it to work in some cases and others not and may be able to figure out a way to get that to work but it's getting messy so I'm wondering if there is a simpler way to do this?
Here are some examples of valid text:
get (1 identifier)
get 1 identifier
get identifier
get identifier identifier
get (identifier identifier)
get (identifier) (identifier)
get (1 + identifier) (identifier)
get 1 identifier or 1 identifier
I can also post more detailed code if needed. Thanks!