[il-antlr-interest: 23677] [antlr-interest] Ambiguities or resolving the rules

2009-05-12 Thread Bharath R
Hi All ,, Good morning. I m very new to ANTLR , I m facing a below problme like the second rule is getting matched with the first rule and its not able to be parsed. This is my grammar grammar tel; TEL : T E L COLON ; COLON : ':'; fragment T : ('t'|'T'); fragment E : ('e'|'E'); fragment L

[il-antlr-interest: 23676] Re: [antlr-interest] cannot find tokens file /file.tokens

2009-05-12 Thread Marwan Ajraoui
Thanks a lot for ur help; I'm using eclipse I did run a configuration of org.antlr.Tool passing as an argument ${file_prompt} and "-lib dir" , didn't work. I ' ve also tried to put the token in the same directory then Tool, in vain. So I've debug source code till i found where it does set the na

[il-antlr-interest: 23675] Re: [antlr-interest] literal has no associated lexer rule...

2009-05-12 Thread Jim Idle
Yurushkin Michael wrote: > Good day! > I use Antlr 3. > There are 2 grammar files (lexer and parser). Lexer contains tokens > definitions and parser imports tokens tabel. > Is it possible to avoid definition of all literals (such as '+', '-' > etc)... > > I want to write such rules in parser:

[il-antlr-interest: 23674] [antlr-interest] literal has no associated lexer rule...

2009-05-12 Thread Yurushkin Michael
Good day! I use Antlr 3. There are 2 grammar files (lexer and parser). Lexer contains tokens definitions and parser imports tokens tabel. Is it possible to avoid definition of all literals (such as '+', '-' etc)... I want to write such rules in parser: "expr : (expr '+' factor) | (exp

[il-antlr-interest: 23673] Re: [antlr-interest] C# grammar for ANTRL3

2009-05-12 Thread Jim Idle
Wolfram Bernhardt wrote: > Hi! > > Has anyone recently done a working antlr3-grammar to parse C#-files? > > There are some on the antlr web-site, but they seem to be for older > version of antlr and I doesn't seem too easy to make them work... > I have a commercial version that you can try here

[il-antlr-interest: 23672] [antlr-interest] Rewrite rules with context-sensitive values

2009-05-12 Thread dhjdhj
Below is a partial (pretty standard, I would assume) grammar that creates a tree representing a boolean comparison. The TAttributeType is essentially a constant that represents the type of the found expressions, e.g, TAttributeType.atString, TAttributeType.atInteger, TAttributeType.atBo

[il-antlr-interest: 23671] [antlr-interest] C# grammar for ANTRL3

2009-05-12 Thread Wolfram Bernhardt
Hi! Has anyone recently done a working antlr3-grammar to parse C#-files? There are some on the antlr web-site, but they seem to be for older version of antlr and I doesn't seem too easy to make them work... Thanks, Wolfram signature.asc Description: OpenPGP digital signature

[il-antlr-interest: 23670] [antlr-interest] Position of 'scope' delcaration

2009-05-12 Thread Bill Steer
The book says, at the bottom of page 143, "Simply define a named scope outside any rule." If I put a named scope just before the first rule, I get an error "unexpected token: scope" when generating code. Where should the 'scope' statement appear in the .g file? Thanks. Bill List: http://w

[il-antlr-interest: 23669] Re: [antlr-interest] Advice on using Antlr in Eclipse

2009-05-12 Thread Gerald Rosenberg
At 08:22 AM 5/12/2009, Johan Cockx wrote: >2. AntlrDT > >I sent a mail to supp...@certiv.net for >help and I am waiting for a reply. Already answered - most likely, you just need to install Zest to complete the installation. --~--~-~--~~~

[il-antlr-interest: 23668] [antlr-interest] Advice on using Antlr in Eclipse

2009-05-12 Thread Johan Cockx
Hello, I need to use Antlr from the Eclipse IDE (under Windows XP) and I am trying to figure out what the best approach is. There seem to be at least three Eclipse plug-ins for Antlr: 1. AntlrEclipse ( http://antlreclipse.sourceforge.net/ ) 2. AntlrDT ( http://www.certiv.net/downloads/antlrdtdo

[il-antlr-interest: 23667] Re: [antlr-interest] What does this error mean in english?

2009-05-12 Thread Jim Idle
Christopher Laco wrote: > "mismatched tree node: DOCUMENT expecting DOCUMENT" > > > I'm not having very good luck trying to do simple things apparently. > > My ToStringTree: > > > (DOCUMENT (PRINT 'variable')) > > > My tree grammar: > > > document > > : ^(DOCUMENT statement*) > > ; > > sta

[il-antlr-interest: 23666] Re: [antlr-interest] cannot find tokens file /file.tokens

2009-05-12 Thread Iztok Kavkler
By default, it will look in the current working directory (which is the directory from where you started antlr, not the directory of .g file). To look for .token files in other directories, use "-lib dir" option. > Hi there; > > I'm getting this error: cannot find tokens file > /file.tokens. I

[il-antlr-interest: 23665] Re: [antlr-interest] Problem with AST parsing for ST

2009-05-12 Thread Nauman
Thanks a lot Michael. That was the problem. Now that I know it, I can't see how I could've missed it! On Tue, May 12, 2009 at 1:07 PM, Michael wrote: > Am Tuesday 12 May 2009 08:35:29 schrieb Nauman: > > Hi all, > > > > I'm trying to parse a high level policy and generate a low-level > structure

[il-antlr-interest: 23664] Re: [antlr-interest] simple return value problem

2009-05-12 Thread Michael
Am Tuesday 12 May 2009 09:42:25 schrieb Tobias Wunner: > Hello, > > still new ANTLR I ran into a simple return value problem. I would like > to parse a token sequence and return the matched string. often it's simpler to let the lexer do the token foo and the parser do the checking of the syntax

[il-antlr-interest: 23663] Re: [antlr-interest] Problem with AST parsing for ST

2009-05-12 Thread Michael
Am Tuesday 12 May 2009 08:35:29 schrieb Nauman: > Hi all, > > I'm trying to parse a high level policy and generate a low-level structured > text. > > The grammar rule for policy set and policy are: > > policyset > (policy)+ > -> ^(POLICYSET policy+); > > and > > policy: policy

[il-antlr-interest: 23662] [antlr-interest] simple return value problem

2009-05-12 Thread Tobias Wunner
Hello, still new ANTLR I ran into a simple return value problem. I would like to parse a token sequence and return the matched string. For example I would like to match the characters "hello" in "11 hello 22" and return it as a string. I used $var.getText() and matched with something like

[il-antlr-interest: 23661] Re: [antlr-interest] [C Targe t][3.1.1] Trying to understand the behavior of rules with klee ne stars

2009-05-12 Thread Sven Van Echelpoel
On Mon, 2009-05-11 at 12:03 -0700, Loring Craymer wrote: > This is a symptom of not having an EOF at the end of your top level rule--you > need to add EOF after ';'. > I'm sorry, but I don't exactly understand what you mean here. I don't think I have ever seen this mentioned before, but I may ha