ntValue=INTEGER |
floatValue=FLOAT))?
-> ^(ABILITY[$p, $s, $name, $intValue, $floatValue] ID ID
INTEGER? FLOAT?)
;
On Mon, Jul 20, 2009 at 4:04 AM, hakan eryargi wrote:
> hello,
>
> is it possible to access sub tokens of lexer from a rule ? (sorry for
> stupid naming) at the
hello,
is it possible to access sub tokens of lexer from a rule ? (sorry for
stupid naming) at the bottom is part of my grammar. i want to re-write
primary rule something like:
primary :
a=ABILITY -> ABILITY[$a.scope, $a.id, ($a.INTEGER |
$a.FLOAT)? ]
| LPAREN! expression
thanks. that's clearly simpler and better for this case :)
On Mon, Jul 20, 2009 at 12:06 AM, David-Sarah
Hopwood wrote:
> hakan eryargi wrote:
>> hello,
>>
>> below is the main part of my grammar. it's ok but it creates an AST
>> from expression
>>
&
thank you both. it seems ok now :)
so that p+ means keep a list of primary (or whatever) and add primary
to that list at '= primary' points
On Sun, Jul 19, 2009 at 9:22 PM, John B. Brodie wrote:
> Greetings!
>
> On Sun, 2009-07-19 at 21:02 +0300, hakan eryargi wrote:
>>
9, 2009 at 8:47 PM, Jim Idle wrote:
> Not sure WHY you would want that buy it is just:
>
> p+=primary (AND p+=primary)* -> ^(AND $p+)
>
> Jim
>
> On Jul 19, 2009, at 7:04 AM, hakan eryargi wrote:
>
>> hello,
>>
>> below is the main part of my grammar. i
hello,
below is the main part of my grammar. it's ok but it creates an AST
from expression
a & b & c -> (& (& a b) c) : an AND node with children c and another
AND node with children a and b
but i want: (& a b c) : an AND node with tree children
how can i make that with a rewrite rule ?
i've
thank you all. this effectively solved my problem :)
On Thu, Jul 16, 2009 at 5:55 PM, David-Sarah
Hopwood wrote:
> Stuart Dootson wrote:
>> On Thu, Jul 16, 2009 at 1:21 PM, hakan eryargi
>> wrote:
>>> i will really appreciate a simple sample if possible :)
>>
>
i will really appreciate a simple sample if possible :)
On Thu, Jul 16, 2009 at 2:48 PM, Gavin Lambert 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
eed and make AND and OR tokens the same precedence in
the same way that '+' and '=-' are.
In general stealing rules from the example grammars (see the download
section) will get you a long way!
On Wed, Jul 15, 2009 at 12:20 PM, hakan eryargi wrote:
> hello,
>
> i wa
hello,
i want to create a grammar for simple expressions and AND, OR
statements. AND's and OR's have no precedence, so i want the user to
explicitly use parenthesis if AND's and OR's mixed. how can i define
such a grammar ?
for example these are valid:
EXP
EXP & EXP
EXP | EXP | EXP
EXP & (EXP |
10 matches
Mail list logo