[il-antlr-interest: 24006] [antlr-interest] Whats wrong with this?

2009-06-03 Thread Mats Ekberg
> Hi! > > I cant figure out why this grammar dont work (I have left out some > not relevant stuff). > This expression works:[ LOOKUP( A1234567890, 9TN ) ] 93 > This dont:[ LOOKUP( A1234567890, ATN ) ] 93 > Why? > > > > prog returns [NationalDutyExprHelper value] : > item (i

[il-antlr-interest: 21384] Re: [antlr-interest] @rulecatch for lexer, doable?

2009-01-18 Thread Mats Ekberg
ptions I think. Look at > the nextToken() method. It should be the thing that handles errors > emitted from calling mTokens() rule method. > > Ter > On Jan 17, 2009, at 4:17 PM, Mats Ekberg wrote: > >> Hi! >> >> To generate a custom catch clause in

[il-antlr-interest: 21372] [antlr-interest] @rulecatch for lexer, doable?

2009-01-17 Thread Mats Ekberg
Hi! To generate a custom catch clause in the parser one can write: @rulecatch { ..code.. } How do I accomplish the same thing in the lexer? /mats --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "il-antlr-inter

[il-antlr-interest: 21204] Re: [antlr-interest] expression parser example Expr.g dont work

2009-01-07 Thread Mats Ekberg
: antlr-interest-boun...@antlr.org > [mailto:antlr-interest-boun...@antlr.org > ] On Behalf Of Jim Idle > Sent: Wednesday, January 07, 2009 11:31 AM > Cc: antlr-inter...@antlr.org > Subject: Re: [antlr-interest] expression parser example Expr.g dont > work > > > > Mats

[il-antlr-interest: 21196] Re: [antlr-interest] expression parser example Expr.g dont work

2009-01-07 Thread Mats Ekberg
> > The current form hits the ‘(‘ and then looks for expr which requires a > NEWLINE after ‘2’ which you don’t have. > > > > I didn’t verify this though. > > > > C > > > > > > __ > > From:antlr-interest-boun...@antlr.org > [mailto:antlr-int

[il-antlr-interest: 21194] [antlr-interest] expression parser example Expr.g dont work

2009-01-06 Thread Mats Ekberg
I have stripped the classical expr.g example and when I run it in ANTLRWorks it dont work. The input "(1 + 2) * 3 - 4" (with a newline at the end) just recognizes "( 1 + 2" and the nothing more. How come? grammar Expr; prog: stat+ ; stat: expr NEWLINE | NEWLINE ; expr : mul

[il-antlr-interest: 21128] Re: [antlr-interest] Location dependent token?

2008-12-29 Thread Mats Ekberg
its a measurement. ok? regards mats mån 2008-12-29 klockan 08:10 -0600 skrev Gary R. Van Sickle: > > From: Mats Ekberg > > > > Lets say a three letter word in uppercase can mean one of two > > tings like: > > > > 10 EUR > > where EUR means

[il-antlr-interest: 21119] [antlr-interest] Location dependent token?

2008-12-29 Thread Mats Ekberg
Lets say a three letter word in uppercase can mean one of two tings like: 10 EUR where EUR means a monetary unit 10 EUR / TNE where EUR still means a monetary unit but the three letters TNE now means a measurement uniot. How can that be expressed in a grammar?? /mats --~--~-~--~

[il-antlr-interest: 21074] [antlr-interest] Pattern to macth if no other match

2008-12-24 Thread Mats Ekberg
I want to have one action being executed if no patterns match, like: stat: 'SWAP' { fh.swap();} | 'DROP' { fh.drop();} | { fh.print(text);} on SWAP fh.swap() gets executed. on DROP fh.drop() and if no match i want fh.print() be called with the text that did not match any