[il-antlr-interest: 23513] [antlr-interest] Parsing Best Practices---Where to check for predefined names

2009-05-04 Thread Matthew M. Burke
I am building a parser for a language that has the following syntax for function invocations and a few "function-like" usages. In particular, statements such as Set 17 are valid for a handful of predefined names. In my grammar, I have a rule which describes what's allowed to be o

[il-antlr-interest: 23512] Re: [antlr-interest] getting data from a grammar

2009-05-04 Thread Brian Nelson
Thanks, Jim. That gets me pretty far... I think you gave me the initial CSS grammar I am working on, so you'd probably understand this more complex example: given foo>bar .foo as the selector, I want an array of ['foo>bar', '.foo']... selector : elementName (elementSubsequent? elementName

[il-antlr-interest: 23511] Re: [antlr-interest] getting data from a grammar

2009-05-04 Thread Jim Idle
Brian Nelson wrote: So I have been working on this for about a week, and I even bought the ANTLR book, but I can't seem to find how to get what seems like simple data out of the grammar. Here's a very, very limited example. I am merely trying to get data out of CSS files. I guess the q

[il-antlr-interest: 23510] Re: [antlr-interest] getting data from a grammar

2009-05-04 Thread Brian Nelson
This was a small example of a much larger problem. This isn't this simple case only, I am processing CSS files and trying to object-ize the entire file (rules, declarations, media blocks, etc) On 5/4/09 12:21 PM, Micha wrote: > On Monday 04 May 2009 21:08:50 Brian Nelson wrote: > >> The inpu

[il-antlr-interest: 23509] Re: [antlr-interest] getting data from a grammar

2009-05-04 Thread Micha
On Monday 04 May 2009 21:08:50 Brian Nelson wrote: > The input would be "aa, bb, cc" and I simply want a list of > ['aa','bb','cc']. I am not trying to process it, just get the list out > of it, ignoring the commas, in a variable I can use. > > prog : rone (COMMA rone)* >; > >

[il-antlr-interest: 23508] [antlr-interest] getting data from a grammar

2009-05-04 Thread Brian Nelson
So I have been working on this for about a week, and I even bought the ANTLR book, but I can't seem to find how to get what seems like simple data out of the grammar. Here's a very, very limited example. I am merely trying to get data out of CSS files. I guess the questions I have are: 1) Shoul

[il-antlr-interest: 23507] Re: [antlr-interest] Problems defining a simple Integer Match

2009-05-04 Thread Marwan Ajraoui
MANY THX; The problem is solved thanks to the information you gave me. Kind regards, Marouane 2009/5/4 Jim Idle : > Marwan Ajraoui wrote: >> Hi There; >> >> I'm currently defining a grammar for a based tag language using ANTLR; >> The problem I'm facing is that a single digit doesn't match my d

[il-antlr-interest: 23506] Re: [antlr-interest] Problems defining a simple Integer Match

2009-05-04 Thread Marwan Ajraoui
MANY THX; The problem was solved. Kind regards, Marouane 2009/5/4 Michael Strelnikov : > Try to add "fragment" prefix before "DIGITO" > > On Mon, May 4, 2009 at 10:49 PM, Marwan Ajraoui > wrote: >> Hi There; >> >> I'm currently defining a grammar for a based tag language using ANTLR; >> The p

[il-antlr-interest: 23505] Re: [antlr-interest] New Maven artifacts, some fixes, buidlable source

2009-05-04 Thread Jim Idle
Pete Siemsen wrote: > Jim, > > Sorry to be dense, but I couldn't get the snapshot to work. My pom > file is probably wrong. Attached are my new pom file and the results > of using it: > > It seems that you need as well as just repository (though I have never needed that but I build the ac

[il-antlr-interest: 23504] Re: [antlr-interest] "explosion" rewrite

2009-05-04 Thread Steve Ebersole
One thing I could not decode here... What is it that sortKey should be returning in this case we are discussing, assuming I have changed the sortSpecification rule? sortSpecification : sortKey collationSpecification? orderingSpecification? -> ^( SORT_SPEC sortKey collationSpecificati

[il-antlr-interest: 23503] Re: [antlr-interest] Problems defining a simple Integer Match

2009-05-04 Thread Jim Idle
Marwan Ajraoui wrote: > Hi There; > > I'm currently defining a grammar for a based tag language using ANTLR; > The problem I'm facing is that a single digit doesn't match my defined > rule INTEGER, here is the definition I put (as i saw in The Definitive > guide of ANTLR): > > DIGITO: '0'..'9' ; >

[il-antlr-interest: 23502] [antlr-interest] accessing multiple return values

2009-05-04 Thread Des Hartman
I have an interesting problem. I have written a tree parser for Actionscript and in it I call external code to convert a reference from Stirng to Number. I also calculate additional attributes of this reference (Type and format) The details of the actual reference call is not really relevant. the c

[il-antlr-interest: 23501] Re: [antlr-interest] Problems defining a simple Integer Match

2009-05-04 Thread Michael Strelnikov
Try to add "fragment" prefix before "DIGITO" On Mon, May 4, 2009 at 10:49 PM, Marwan Ajraoui wrote: > Hi There; > > I'm currently defining a grammar for a based tag language using ANTLR; > The problem I'm facing is that a single digit doesn't match my defined > rule INTEGER, here is the definiti

[il-antlr-interest: 23500] [antlr-interest] Problems defining a simple Integer Match

2009-05-04 Thread Marwan Ajraoui
Hi There; I'm currently defining a grammar for a based tag language using ANTLR; The problem I'm facing is that a single digit doesn't match my defined rule INTEGER, here is the definition I put (as i saw in The Definitive guide of ANTLR): DIGITO: '0'..'9' ; INT : DIGITO + ; This rule should ma

[il-antlr-interest: 23499] EARN $5000-$15000 PER MONTH WITHOUT INVESTMENT

2009-05-04 Thread guru
EARN $5000-$15000 PER MONTH WITHOUT INVESTMENT SIMPLE ONLINE SURVEYS AND EARN MORE I HAVE EARN $1000 DAILY VIEW MORE DETAILS ** http://www.AWSurveys.com/HomeMain.cfm?RefID=anusuyageetha http://www.AWSurveys.com/Ho

[il-antlr-interest: 23498] Re: [antlr-interest] Tuning parser to non-default channel

2009-05-04 Thread Indhu Bharathi
It is true that the parser can 'tune' to any channel. But you can't do it while parsing. The channel should be set before parsing begins. If you want to see the off channel token while parsing, you can use LA( int ) and LT( int ) within the parser. For your example, you can write something li

[il-antlr-interest: 23497] [antlr-interest] Tuning parser to non-default channel

2009-05-04 Thread Iztok Kavkler
The ANTLR reference claims that parser can tune to any channel, however I couldn't find any mention about how this can be done. What I'd like is to use grammar rule like this (or something equivalent): end_statement: options { channels = NEWLINES; } : NEWLINE ; Is something like this possibl

[il-antlr-interest: 23496] Re: [antlr-interest] Comment Problem

2009-05-04 Thread Thomas Dill
I tried your solution but wasn't successful. I understand the point with the NLCHARS and NEWLINE but this doesn't really change something with my origin problem. From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Jim Idle Sent: Donnerstag, 30. April 20

[il-antlr-interest: 23495] Re: [antlr-interest] [3.1.1][ C-target] @init/@after pairing lost with backtracking/semant ic predicates?

2009-05-04 Thread Sven Van Echelpoel
> > You can generally do what you need though like this: > > s : {start();} ( alt1 | alt2 | alt3) { end(); } ; > > I also recommend that you do not use backtracking for a production parser. Well, I'm not using backtracking on the whole parser, but only the one induced by syntactic predicates h