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
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
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
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
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)*
>;
>
>
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
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
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
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
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
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' ;
>
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
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
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
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
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
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
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
>
> 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
19 matches
Mail list logo