[il-antlr-interest: 32079] Re: [antlr-interest] Q: how to incorporate a preprocessor in the flow?

2011-04-05 Thread A Z
I tried that approach when I first started with ANTLR but had difficulty handling arbitrary token rearrangement. Early on I couldn't figure out how to backtrack in the token stream in order to detect identifier construction using macros. Something like the following requires that 'prefix' be lexed

[il-antlr-interest: 32084] [antlr-interest] antlr v4 wish list

2011-04-05 Thread Alexander Herz
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address -- You received this message because you are subscribed to the Google Groups il-antlr-interest group. To post to this group, send email to

[il-antlr-interest: 32085] Re: [antlr-interest] Examples of semantic predicates with ...

2011-04-05 Thread Sam Harwell
Hi James, In this case, I'm dealing with semantic predicates of the form {...}? and gated semantic predicates of the form {...}?=. The ones you're using in this case are syntactic predicates, which aren't processed by the Boolean logic algorithm I've been working on recently. Sam -Original

[il-antlr-interest: 32087] [antlr-interest] Which to use StringTempates version 3 or 4?

2011-04-05 Thread The Researcher
I have the lexing, parsing and tree rewriting completed and will now be doing a proof of concept for the next phase to see if StringTemplates will work as expected. This will be my first use of StringTemplates. Since ST4 is so new and is not documented in the books, should I start with ST3 or jump

[il-antlr-interest: 32088] Re: [antlr-interest] Which to use StringTempates version 3 or 4?

2011-04-05 Thread Sam Harwell
ST4 is *tremendously* faster than ST3 and includes the most useful debugger for any template engine I've seen to date. For a new application, it's not even a question IMO - definitely ST4. Sam -Original Message- From: antlr-interest-boun...@antlr.org

[il-antlr-interest: 32089] Re: [antlr-interest] Which to use StringTempates version 3 or 4?

2011-04-05 Thread The Researcher
On Tue, Apr 5, 2011 at 11:01 AM, Sam Harwell sharw...@pixelminegames.comwrote: ST4 is *tremendously* faster than ST3 and includes the most useful debugger for any template engine I've seen to date. For a new application, it's not even a question IMO - definitely ST4. Sam Thanks, Eric

[il-antlr-interest: 32090] [antlr-interest] Grammar not detecting stray syntax after certain valid blocks

2011-04-05 Thread David Daeschler
Hello list, I currently have a grammar that looks something like this: //this is the root public prog : globalStmt+ ; globalStmt: stateDef; stateDef : 'state' ID stateBlock; stateBlock : '{' stateBlockContent* '}' ; stateBlockContent : NEWLINE! ; This is enough to demonstrate the

[il-antlr-interest: 32091] Re: [antlr-interest] Grammar not detecting stray syntax after certain valid blocks

2011-04-05 Thread Bart Kiers
This is enough to demonstrate the problem. When I create a program such as: state hello { } } The trailing close bracket is not detected as an error. http://www.antlr.org/mailman/options/antlr-interest/your-email-address Try to anchor it by adding an EOF at the end of your entry-rule:

[il-antlr-interest: 32092] Re: [antlr-interest] Grammar not detecting stray syntax after certain valid blocks

2011-04-05 Thread David Daeschler
Thank you Bart! That of course did the trick. I dont know why I didnt think of that. I appreciate the quick response, have a nice week! -- David Daeschler On Tue, Apr 5, 2011 at 2:31 PM, Bart Kiers bki...@gmail.com wrote: This is enough to demonstrate the problem. When I create a program

[il-antlr-interest: 32096] Re: [antlr-interest] AST cardinality from called rules

2011-04-05 Thread Sam Harwell
The AST operators are the most efficient manner: localVariableDeclaration : LOCAL^ variableDeclarationList ; variableDeclarationList : variableDcl ( ','! variableDcl )* ; Or use rewrites: localVariableDeclaration : LOCAL variableDeclarationList - ^(LOCAL

[il-antlr-interest: 32097] Re: [antlr-interest] AST cardinality from called rules

2011-04-05 Thread Michael Bedward
Hi Graham Does this give you what you want ? localVariableDeclaration : LOCAL! variableDeclarationList ; variableDeclarationList : variableDcl ( ',' variableDcl )* - ^(LOCAL variableDcl)+ ; If you also use the variableDeclarationList rule for non-local declarations you could give

[il-antlr-interest: 32098] Re: [antlr-interest] AST cardinality from called rules

2011-04-05 Thread Graham Mer
Problem solved. Thanks for the replies, the parameterized version does exactly what I need: localVariableDeclaration: : LOCAL! variableDeclarationList[LOCAL] ; variableDeclarationList[int type] : variableDcl ( ',' variableDcl )* - {type == LOCAL}? ^(LOCAL variableDcl)+ - //

[il-antlr-interest: 32099] Re: [antlr-interest] to stop walking into a subtree

2011-04-05 Thread Martijn Reuvers
Hello, I personally prefer a manual tree-visitor (which walks the AST), that way you can just evaluate a node and based on the result take appropriate action, it also allows more control (e.g. multi-phases if needed). The main reason I do it that way is I don't want any of my grammars getting