[il-antlr-interest: 25902] Re: [antlr-interest] Howto modify token creation?

2009-09-24 Thread David-Sarah Hopwood
Indhu Bharathi wrote: > You can do something like > > ID: LETTER (LETTER|DIGIT)* > { > String text = getText(); > Integer tknType; > if( (tknType=table.get(text))!=null ) { > $type = tknType; > } > } > >

[il-antlr-interest: 25904] Re: [antlr-interest] Updates for release 3.2 of the C Target

2009-09-24 Thread Gavin Lambert
At 13:05 24/09/2009, Jim Idle wrote: >Some platforms define this to be undefined though. Remember there >are lots if embedded systems that use this. Hence the qualification. >I think it would have been better to define free(NULL) as safe >myself but early Lib C would crash if you did this an

[il-antlr-interest: 25906] [antlr-interest] gUnit build error under Windows

2009-09-24 Thread Sergiy Karpenko
Hello, colleagues I found build error when run gUnit test.  Environment: - OS is Windows, it's important, because there is no problem under Linux;- project has many dependencies; - gUnit pom configuration is typical:     org.codehaus.mojo   exec-maven-plu

[il-antlr-interest: 25908] Re: [antlr-interest] Rule coverage testing

2009-09-24 Thread Micke Hovmöller
On Mon, Sep 21, 2009 at 5:43 PM, Jim Idle wrote: > On 09/21/2009 08:21 AM, Micke Hovmöller wrote: > > > > The coverage report says that my tests cover 2338 of 2966 lines. > > Unfortunately, I can't find out how to break this down by function. > Sounds like you need to use a different plugin - the

[il-antlr-interest: 25909] Re: [antlr-interest] Question with greedy

2009-09-24 Thread Gordon Tyler
To exclude the /* and */ would something like this work? COMMENT : '/*'! ( options {greedy=false;} : . )* '*/'! ; -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Andreas Volz Sent: September 23, 2009 5:36

[il-antlr-interest: 25911] Re: [antlr-interest] Question with greedy

2009-09-24 Thread Indhu Bharathi
'!' is a rewrite operator used in tree construction. Since lexer doesn't construction a tree, I don't think this will work. -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Gordon Tyler Sent: Thursday, September 24, 2009 6:5

[il-antlr-interest: 25912] [antlr-interest] Lexing XQuery in antlr 3

2009-09-24 Thread Josh Spiegel
Hi, I am trying to migrate our XQuery lexer from antlr 2 to antlr 3. The match for a given token depends on the text before or after it. For example, in a certain state the string "declare" should be a keyword token if it is followed by "namespace" and otherwise it should be a QName token. We su

[il-antlr-interest: 25913] Re: [antlr-interest] Rule coverage testing

2009-09-24 Thread Jim Idle
On 09/24/2009 05:10 AM, Micke Hovmöller wrote: > On Mon, Sep 21, 2009 at 5:43 PM, Jim Idle > wrote: > > On 09/21/2009 08:21 AM, Micke Hovmöller wrote: > > > > The coverage report says that my tests cover 2338 of 2966 lines. > > Unfortunately, I can't

[il-antlr-interest: 25914] Re: [antlr-interest] Question with greedy

2009-09-24 Thread Jim Idle
On 09/24/2009 06:20 AM, Gordon Tyler wrote: > To exclude the /* and */ would something like this work? > > COMMENT > : '/*'! ( options {greedy=false;} : . )* '*/'! > No :-) List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/a

[il-antlr-interest: 25915] Re: [antlr-interest] Lexing XQuery in antlr 3

2009-09-24 Thread Jim Idle
On 09/24/2009 09:12 AM, Josh Spiegel wrote: > Hi, > > I am trying to migrate our XQuery lexer from antlr 2 to antlr 3. > > The match for a given token depends on the text before or after it. > For example, in a certain state the string "declare" should be a > keyword token if it is followed by

[il-antlr-interest: 25916] Re: [antlr-interest] Question with greedy

2009-09-24 Thread Dave Dutcher
Didn't that used to work in Antlr 2? I think that would be a very useful feature to have back. Dave > -Original Message- > From: antlr-interest-boun...@antlr.org > [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Jim Idle > Sent: Thursday, September 24, 2009 11:39 AM > Cc: ant

[il-antlr-interest: 25917] [antlr-interest] Baffled using Antlr to parse custom markup language

2009-09-24 Thread Sam Kuper
Antlr is stumping me. Perhaps it's because I'm trying to use it to parse a pretty gnarly markup language, but maybe not... Between the [BEGIN] and [END] markers below is a sample of the markup I'm dealing with. [BEGIN] .Extract field for no. 16 can be added as the last line of an entry, in the f

[il-antlr-interest: 25919] Re: [antlr-interest] Baffled using Antlr to parse custom markup language

2009-09-24 Thread Sam Kuper
2009/9/24 Sam Kuper : > *a \\Albert, John\\ (b. 1912/13). Gardener. George Robert Fox's > gardener at The Vicarage, \circa\ 1941. (Census returns 1841 (Public Record > Office HO137/916/8).) > *b expanded by EL > *c > *v 2, 3 > *e 18 19 > [END] I should add that each set of star fields represents

[il-antlr-interest: 25918] Re: [antlr-interest] Question with greedy

2009-09-24 Thread Jim Idle
On 09/24/2009 10:11 AM, Dave Dutcher wrote: > > Didn't that used to work in Antlr 2? I think that would be a very useful > feature to have back. > > We have explained this many times in the past but it is to do with the performance gains achieved by not associating text with tokens unless y

[il-antlr-interest: 25920] Re: [antlr-interest] Updates for release 3.2 of the C Target

2009-09-24 Thread David-Sarah Hopwood
Gavin Lambert wrote: > At 13:05 24/09/2009, Jim Idle wrote: >>Some platforms define this to be undefined though. Remember there >>are lots if embedded systems that use this. Hence the qualification. >>I think it would have been better to define free(NULL) as safe >>myself but early Lib C would cras

[il-antlr-interest: 25921] Re: [antlr-interest] Rule coverage testing

2009-09-24 Thread Terence Parr
Have you used antlr's -profile option? Ter On Sep 18, 2009, at 3:58 AM, Micke Hovmöller wrote: > I've written a reasonably large grammar for handling poker hand > histories. I have worked on and off for about a year or so on this. > During this time, the file format has changed slightly. I s

[il-antlr-interest: 25922] Re: [antlr-interest] Updates for release 3.2 of the C Target

2009-09-24 Thread Jim Idle
On 09/24/2009 11:04 AM, David-Sarah Hopwood wrote: > Gavin Lambert wrote: > >> At 13:05 24/09/2009, Jim Idle wrote: >> >>> Some platforms define this to be undefined though. Remember there >>> are lots if embedded systems that use this. Hence the qualification. >>> I think it would have b

[il-antlr-interest: 25923] Want to make $200+ Daily on net fast?

2009-09-24 Thread Lula Gillespie
Tired of home jobs that not work fast?Then this for you, the home job that has been recorded make money . Proven method go here: http://processemailonline.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "il-antlr-

[il-antlr-interest: 25924] Re: [antlr-interest] Question with greedy

2009-09-24 Thread Andreas Volz
Am Wed, 23 Sep 2009 15:29:32 -0700 schrieb Jim Idle: > > Could anyone explain this error and how to prevent it? > > > > Well, you have not specified to the lexer what it should do with > those chars (I assume that this is C from your code above): > > NL : ('\r' | '\n')+ { $channel=HIDDEN; }

[il-antlr-interest: 25925] Re: [antlr-interest] Baffled using Antlr to parse custom markup language

2009-09-24 Thread Sam Kuper
Here's my (grossly incomplete, but better than nothing) progress so far: [BEGIN] grammar name_reg; options { language=Java; } name_reg: ( options {greedy=false;} : . )* a_field b_field? c_field? v_field? e_field? EOF; a_field: STAR_A '' name ' ' dateblock? description '('

[il-antlr-interest: 25927] Re: [antlr-interest] modifying token creation

2009-09-24 Thread Heiko Folkerts
Hi Indhu and David, OK, maybe indhu is right and modifying the token creation is the wrong way to solve my error handling problems. When I try to retrieve user friendly error messages from wrong input the recognizer state gives me nothing to help me. The backtracking tries all paths and returns