[il-antlr-interest: 20833] Re: [antlr-interest] Generating text from models

2008-12-03 Thread Mike Pagel
Hi Terrence, does that approach require extensions to ANTLR or ST? Are you defining the object traversal in a declarative grammar instead of plain procedural code? Can you specify predicates like "only process methods that have a certain Java annotation applied"? Could you just leak a bit more

[il-antlr-interest: 20832] [antlr-interest] Tree Parser Rule - 'throws' my-own-exception is silently ignored

2008-12-03 Thread Michael Lee
Hi, I am troubling to throw my-own-exception during tree parsing. I have a tree rule - nothing too complicated. Here is the snippet expression returns [ Expression exp ] *throws* *ExpressionParseException* : ^(op='+' a=expression b=expression ) { $exp = NumericOperationExpression.createOperat

[il-antlr-interest: 20831] Re: [antlr-interest] errors in embedding grammar files in maven project - regd.

2008-12-03 Thread Jared Bunting
I guess I'm a bit confused about the issue you're having then. Between having the package statement "package dot.grammar" and having your source code in a "dot/grammar" folder structure, your classes should be in the package. Do you actually have folders named "dot.grammar" ? But basically, what

[il-antlr-interest: 20830] Re: [antlr-interest] Survey: Places where parsers and compilers are used practically

2008-12-03 Thread Randall R Schulz
On Wednesday 03 December 2008 16:21, Oliver Zeigermann wrote: > Folks! > > I need your support as I want to figure out where parsers > and/or compilers are practically used these days. > > Any input highly appreciated. Wouldn't the list of where they're used _impractically_ be a lot shorter? >

[il-antlr-interest: 20829] Re: [antlr-interest] errors in embedding grammar files in maven project - regd.

2008-12-03 Thread Jim Idle
On Wed, 2008-12-03 at 20:26 -0600, Ashok Varikuti wrote: > Hi List, > > I encapsulated antlr grammar files in a eclipse maven project. The > compilation task of grammar files is done at maven compile time. I > specified the output directory to be the following :- Here is a sample configuratio

[il-antlr-interest: 20828] Re: [antlr-interest] Survey: Places where parsers and compilers are used practically

2008-12-03 Thread Monty Zukowski
At Temboo we're using ANTLR & ANTXR parsing and tree transformation for our visual language and our expression language. Monty On Wed, Dec 3, 2008 at 4:21 PM, Oliver Zeigermann <[EMAIL PROTECTED]> wrote: > Folks! > > I need your support as I want to figure out where parsers and/or > compilers ar

[il-antlr-interest: 20827] [antlr-interest] How to set the token buffer length?

2008-12-03 Thread chain one
I just found that ANTLR V3 would firstly turn input file stream into tokens, then the parser started to work.Is there anyway to set the token buffer length? Check the following Lexer rule: IDENT : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')* { if (!parser.isFirst) $type=globalSearchI

[il-antlr-interest: 20826] Re: [antlr-interest] errors in embedding grammar files in maven project - regd.

2008-12-03 Thread Ashok Varikuti
Ashok Varikuti wrote: > Hi List, > > I encapsulated antlr grammar files in a eclipse maven project. The > compilation task of grammar files is done at maven compile time. I > specified the output directory to be the following :- > >* target/generated-sources/antlr >* dot.grammar >

[il-antlr-interest: 20825] [antlr-interest] errors in embedding grammar files in maven project - regd.

2008-12-03 Thread Ashok Varikuti
Hi List, I encapsulated antlr grammar files in a eclipse maven project. The compilation task of grammar files is done at maven compile time. I specified the output directory to be the following :- * target/generated-sources/antlr * dot.grammar o dot.tokens

[il-antlr-interest: 20824] [antlr-interest] Survey: Places where parsers and compilers are used practically

2008-12-03 Thread Oliver Zeigermann
Folks! I need your support as I want to figure out where parsers and/or compilers are practically used these days. Any input highly appreciated. Cheers and thanks in advance Oliver List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org:8080/mailman/

[il-antlr-interest: 20823] Re: [antlr-interest] Generating text from models

2008-12-03 Thread Terence Parr
Hi Mike, I've currently got a nice example in my upcoming language design patterns book where I build a poor man's object relational database model using reflection. The basic idea is that you iterate over the list of methods in a class or whatever and build up the output (using templates

[il-antlr-interest: 20822] [antlr-interest] Generating text from models

2008-12-03 Thread Mike Pagel
Hi there, first of all: I am pretty new to ANTLR and to this mailing list. I did search the archive for information but could not find anything addressing my question. If it's in there, just send the link, please... Now: I am coming from a modeling (UML-like, graphical DSLs) background, where

[il-antlr-interest: 20821] [antlr-interest] New Maven artifact for compiling antlr grammars

2008-12-03 Thread Jim Idle
I have just released org.antlr - antlr3-maven-plugin version 3.1.1.1, which should sync up with Maven central no later than 4 hours from now (depending on when in the sync cycle I deployed the artifacts). This release incorporates a few donated re-jigs, but more importantly I have re-implemented t

[il-antlr-interest: 20820] Re: [antlr-interest] Getting started with Antlr: Resolving a conflicting lexer rule

2008-12-03 Thread Jim Idle
On Wed, 2008-12-03 at 09:49 -0800, Howard Lewis Ship wrote: > I'm working on an improved property expression language for Tapestry > 5.1. My first step was to recreate what T5.0 accepted in the past > (using an ad-hoc parser based on regular expressions). > > > My problem is a conflict betwee

[il-antlr-interest: 20819] Re: [antlr-interest] Getting started with Antlr: Resolving a conflicting lexer rule

2008-12-03 Thread Carl Crowder
I believe using lookahead would work - options { k=2; } Carl On 3 Dec 2008, 5:52 PM, "Howard Lewis Ship" <[EMAIL PROTECTED]> wrote: I'm working on an improved property expression language for Tapestry 5.1. My first step was to recreate what T5.0 accepted in the past (using an ad-hoc parser ba

[il-antlr-interest: 20818] [antlr-interest] Getting started with Antlr: Resolving a conflicting lexer rule

2008-12-03 Thread Howard Lewis Ship
I'm working on an improved property expression language for Tapestry 5.1. My first step was to recreate what T5.0 accepted in the past (using an ad-hoc parser based on regular expressions). lexer grammar PELexer; @header { package propexp; } fragment LETTER : ('a'..'z'|'A'..'Z'

[il-antlr-interest: 20817] Re: [antlr-interest] Parser/Lexer rules final in generated code / manually implemented rules

2008-12-03 Thread Jim Idle
On Wed, 2008-12-03 at 12:45 +0100, Oliver Zeigermann wrote: > Folks! > > Any idea why parser and lexer rules are final in generated code? If it > is for performance I doubt it does any significant speed up. > > Anyway, how do I manually implement a certain lexer or parser rule? I > though of sub

[il-antlr-interest: 20816] Re: [antlr-interest] Help! Predicate failed messages

2008-12-03 Thread Jim Idle
On Wed, 2008-12-03 at 17:41 +0800, chain one wrote: > procedure_id > : { isFirst }? id=IDENT { addId($id.getText(),PROCEDURE_IDENT); } > | nid=PROCEDURE_IDENT { $nid.setType(IDENT);} -> > ^(PROCEDURE_ID[] PROCEDURE_IDENT) > ; > In the first pass, isFirst is true, an

[il-antlr-interest: 20815] Re: [antlr-interest] How to translate this V2 Lexer rule to V3 Lexer rule?

2008-12-03 Thread Jim Idle
On Wed, 2008-12-03 at 14:57 +0800, chain one wrote: > Sorry for spaming > > > > I noticed that only to remove the '$' in front of getText and > setType() would work. > What a stupid question! : ) > Actually, you should not do that in V3 lexers :-) You hsoudl use: System.out.println($text);

[il-antlr-interest: 20814] Re: [antlr-interest] lexing nested comments

2008-12-03 Thread micha
On Wednesday 03 December 2008 15:27:29 you wrote: > > | ('/' ~'*') => '/' > | ('*' ~'/') => '*' > | MULTI_COMMENT ..with a syntactic predicate, nice. thanks, Michael List: http://www.antlr.org:8080/mailman/lis

[il-antlr-interest: 20813] Re: [antlr-interest] lexing nested comments

2008-12-03 Thread Sam Harwell
MULTI_COMMENT : '/*' { $channel=HIDDEN; } ( ~('/'|'*') | ('/' ~'*') => '/' | ('*' ~'/') => '*' | MULTI_COMMENT

[il-antlr-interest: 20812] [antlr-interest] TokenStream in ANTLR V3

2008-12-03 Thread chain one
I found in ANTLR V3, before Parser rules began to be appiled, all the tokens have been recognized(That is also to say that all the Lexer Rules have been applied.). Such as this rule: IDENT : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')* { $type=globalSearchId($text); } ; globa

[il-antlr-interest: 20811] [antlr-interest] Parser/Lexer rules final in generated code / manually implemented rules

2008-12-03 Thread Oliver Zeigermann
Folks! Any idea why parser and lexer rules are final in generated code? If it is for performance I doubt it does any significant speed up. Anyway, how do I manually implement a certain lexer or parser rule? I though of subclassing and overriding the specific rule. Which does not work because of

[il-antlr-interest: 20810] Re: [antlr-interest] help - Parser problem

2008-12-03 Thread virg g
On Wed, Dec 3, 2008 at 4:26 PM, Gavin Lambert <[EMAIL PROTECTED]> wrote: > At 23:05 3/12/2008, virg g wrote: > >> 1. As i have set of commands to parse >> if there is any unknown command found it breaks the parsing and returns >> with the error. But how to continue the parsing even though it fin

[il-antlr-interest: 20809] Re: [antlr-interest] Help! Predicate failed messages

2008-12-03 Thread chain one
I noticed the first time parse is OK.But when turning isFirst to false, this kind of error message keep coming out. I don't know why the failure of a predicate would lead to an error. 2008/12/3 chain one <[EMAIL PROTECTED]> > And there are a lot of error tag in the final printed tree like this:

[il-antlr-interest: 20808] Re: [antlr-interest] help - Parser problem

2008-12-03 Thread Gavin Lambert
At 23:05 3/12/2008, virg g wrote: >1. As i have set of commands to parse >if there is any unknown command found it breaks the parsing and >returns with the error. But how to continue the parsing even >though it finds unknown command after returning the error. Normally ANTLR will try to contin

[il-antlr-interest: 20807] [antlr-interest] lexing nested comments

2008-12-03 Thread micha
Hi, I don't get the lexer rules correct to lex my nested comments. As a workaround I use the following, see below. What are the right rules for this ? thanks Michael -- one lexer rule: MULTI_COMMENT: '/*' { nestedComment(0); skip(); } and in the @

[il-antlr-interest: 20806] Re: [antlr-interest] help - Parser problem

2008-12-03 Thread virg g
Thanks for your very quick response. Now i have understood how lexer and parser works. 1. As i have set of commands to parse if there is any unknown command found it breaks the parsing and returns with the error. But how to continue the parsing even though it finds unknown command after returning

[il-antlr-interest: 20805] Re: [antlr-interest] Help! Predicate failed messages

2008-12-03 Thread chain one
And there are a lot of error tag in the final printed tree like this: (TYPE_DECL Is it caused by the failure of the predicate? 2008/12/3 chain one <[EMAIL PROTECTED]> > procedure_id > : { isFirst }? id=IDENT { addId($id.getText(),PROCEDURE_IDENT); } > | nid=PROCEDURE_IDENT

[il-antlr-interest: 20804] [antlr-interest] Help! Predicate failed messages

2008-12-03 Thread chain one
procedure_id : { isFirst }? id=IDENT { addId($id.getText(),PROCEDURE_IDENT); } | nid=PROCEDURE_IDENT { $nid.setType(IDENT);} -> ^(PROCEDURE_ID[] PROCEDURE_IDENT) ; In the first pass, isFirst is true, and in the second pass, isFirst is set to be false. When running t