[antlr-interest] unary Operators

Alexey Demakov demakov at ispras.ru
Wed Nov 16 07:34:48 PST 2005


Sorry for previous incomplete message :(

Unary operator can be repeated zero or more times?

unary_exp : (LNOT | MINUS |PLUS)* primary_exp ;

Regards,
Alexey

-----
Alexey Demakov
TreeDL: Tree Description Language: http://treedl.sourceforge.net
RedVerst Group: http://www.unitesk.com


----- Original Message ----- 
From: "Henry Butowsky" <henryb at ntlworld.com>
To: <antlr-interest at antlr.org>
Sent: Wednesday, November 16, 2005 6:44 PM
Subject: [antlr-interest] unary Operators


> Hi Guys,
>     Im using a C like grammer and am having trouble getting unary 
> operators to work
> 
> I have in the parser
> 
> unary_exp
> :primary_exp
> | (LNOT^ | MINUS^ |PLUS^) primary_exp
>           ;
> 
> It works  OK with a single unary operator eg   !10 or -2.4
> But put them together and nogo e.g !!20 or -!0
> 
> Regards Henry
> 
> 



More information about the antlr-interest mailing list