[il-antlr-interest: 32173] Re: [antlr-interest] Validating AST

2011-04-12 Thread The Researcher
> Jim, thanks I may use that in the future. I am using C# on Windows and > would have to do some work to get it working on my machine. The specific problem I had was that I created a token in source code with one token type and text implying another token type. Using ToTreeString only showed the

[il-antlr-interest: 32172] Re: [antlr-interest] Validating AST

2011-04-12 Thread Jim Idle
Use the built in code to produce the .dot file, then use Graphviz to produce a .png and then you can see what is going wrong very easily. I have posted the code to do this to the list lots of times so you should find it on antlr.markmail.org Jim > -Original Message- > From: antlr-interest

[il-antlr-interest: 32171] [antlr-interest] Validating AST

2011-04-12 Thread The Researcher
For some AST transformations I have to resort to writing code. A recent bug of mine was due to incorrectly building a AST. Is there any code to validate the structure of an AST? Thanks, Eric List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/opti

[il-antlr-interest: 32170] Re: [antlr-interest] Diferent output when running ANTLRWorks IDE and a test rig in both Java and C# versions

2011-04-12 Thread Jim Idle
program:command+ EOF; // Force the parser to consume token stream Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Hélder Silva > Sent: Tuesday, April 12, 2011 7:07 AM > To: antlr-interest@antlr.org > Subje

[il-antlr-interest: 32169] Re: [antlr-interest] Diferent output when running ANTLRWorks IDE and a test rig in both Java and C# versions

2011-04-12 Thread Hélder Silva
This is my current grammar: grammar Oven; options { language=CSharp2; //language=Java; output=AST; ASTLabelType=CommonTree; // Cria arvore para ser utilizada por outro parser a executar funções } @lexer::members { bool emailMode = false; } @members { //to create more un

[il-antlr-interest: 32168] Re: [antlr-interest] throwing non-antlr exceptions

2011-04-12 Thread Sam Harwell
Hi Joe, This feature is not yet implemented in v3. I may be able to get it implemented for release 3.4, but there are some technical issues that prevent it from working in a few cases that make it difficult. Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-inte

[il-antlr-interest: 32167] Re: [antlr-interest] throwing non-antlr exceptions

2011-04-12 Thread Joachim Schrod
Joe Lemmer wrote: > > I'd like to throw a Non-Antlr exception from one of my rules in a Parser. I'm > using ANTLR v3 > I've tried to find some documentation and came across some stuff for ANTLR v2 > that says the following: > > To specify that your parser (or > tree parser rule) can throw a non

[il-antlr-interest: 32166] Re: [antlr-interest] help

2011-04-12 Thread The Researcher
There is not enough info in the e-mail for me to determine the exact problem. If there is a problem with the grammar ANTLRWorks should catch it when building. If ANTLRWorks correctly builds the lexer and parser, and then the error appears when parsing, I would check the input against what the gram

[il-antlr-interest: 32165] [antlr-interest] throwing non-antlr exceptions

2011-04-12 Thread Joe Lemmer
Hi there, I'd like to throw a Non-Antlr exception from one of my rules in a Parser. I'm using ANTLR v3 I've tried to find some documentation and came across some stuff for ANTLR v2 that says the following: " To specify that your parser (or tree parser rule) can throw a non-ANTLR specific exc

[il-antlr-interest: 32164] Re: [antlr-interest] grammar for boolean expressions

2011-04-12 Thread Gary Miller
My two cents worth. I prefer rewrites as I can create virtual tokens. Regards Gary expr : or -> ^(EXPR or) ; or : (and -> and) ( OR b=and-> ^( LOGICAL_OR $or $b ) )* ; and : (atom -> atom) ( AND b=atom -> ^(LOGICAL_AND $and $b) )* ; atom : id ; id