[antlr-interest] forcing parenthesis (no precedence)

hakan eryargi hakan.eryargi at gmail.com
Thu Jul 16 05:21:36 PDT 2009


i will really appreciate a simple sample if possible :)

On Thu, Jul 16, 2009 at 2:48 PM, Gavin Lambert<antlr at mirality.co.nz> wrote:
> At 18:57 16/07/2009, hakan eryargi wrote:
>>thank you but i can't get it. simply making AND's and OR's have
>>same precedence doesnt force user to use parenthesizes.
>>expression is simply evaluated from left to right ?
>
> Just parse it as normal, but put some code into the tree parser to detect
> cases you want to consider invalid and raise an error.
>
> From the sounds of it, it should be easy to detect; eg. if you're on an OR
> root and either the left or right expression is an AND root, then it's
> invalid.
>
>


More information about the antlr-interest mailing list