[il-antlr-interest: 26755] Re: [antlr-interest] tree rewriting - change not propagating upwards

2009-11-09 Thread Michael Bedward
> I know this will be something stupid and obvious and trivial > And (sigh) it was... The problem was not in the grammar, nor in how ANTLR processed it, but in the way I was using the re-written AST. As Douglas Adams said: you live and learn; at any rate you live... Michael List: http://www.a

[il-antlr-interest: 26734] [antlr-interest] tree rewriting - change not propagating upwards

2009-11-08 Thread Michael Bedward
Hi folks, I have a grammar to rewrite an AST, most of which works wonderfully well. But one bit has had me pulling what remains of my hair out... The relevant excerpts are: expr : ^(FUNC_CALL id=ID expr_list) -> {isPosFunc($id.text)}? IMAGE_POS_LOOKUP[getProxyVar($id.t

[il-antlr-interest: 26710] Re: [antlr-interest] Maven archetype for ANTLR

2009-11-05 Thread Michael Bedward
Many thanks Jim !  Using ANTLR in my maven projects has been a breeze thanks to your efforts. Michael 2009/11/6 Jim Idle : > I note that the new Maven Archetype for building a starting project for > Maven and the Java target is now synced in the Maven central repository and > shows up in the IDE

[il-antlr-interest: 26709] Re: [antlr-interest] Problem parsing unit symbols

2009-11-05 Thread Michael Bedward
Hi Mark, Just out of interest, are working with the units supported by Java JSR-275 which I think are based on UCUM http://unitsofmeasure.org/ ? Michael List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-addre

[il-antlr-interest: 25886] Re: [antlr-interest] ANTLR book

2009-09-23 Thread Michael Bedward
Hi Ivan, Details and advanced draft are here: http://www.pragprog.com/titles/tpdsl/language-implementation-patterns Michael 2009/9/23 Ivan Yu Titov : > Hello, > > I've recently heard about new ANTLR book. Is there any release date for it? > Thanks in advance. > > With best wishes, > Ivan > > Li

[il-antlr-interest: 25218] Re: [antlr-interest] case-insensitivity in ANTLR (Java)

2009-08-13 Thread Michael Bedward
Hi Bruce, Just like this... ANTLRNoCaseFileStream strm = new ANTLRNoCaseFileStream( myfilename ); MyLexer lexer = new MyLexer( strm ); That's all there is to it really. If only all things in life were so easy :) Michael List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe:

[il-antlr-interest: 25013] Re: [antlr-interest] Reload an AST from serialized form.

2009-08-03 Thread Michael Bedward
Thanks Tommy, this is a very good idea. Michael 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 subscri

[il-antlr-interest: 24959] Re: [antlr-interest] Help with compile errors in generated source

2009-07-31 Thread Michael Bedward
Here's a fragment of the pom.xml that I use... org.antlr antlr3-maven-plugin 3.1.3-1 antlr

[il-antlr-interest: 24898] Re: [antlr-interest] About AST construction and rewriting for tree parsers?

2009-07-29 Thread Michael Bedward
Hi, There are some fairly simple examples of tree rewriting in my Jiffle language grammars: http://code.google.com/p/jai-tools/source/browse/#svn/trunk/jiffle/src/main/antlr3/jaitools/jiffle/parser Jiffle.g is the initial lexer / parser grammar. The various MorphX.g files plus VarClassifier.g a

[il-antlr-interest: 24726] Re: [antlr-interest] Multiple evaluations of the same tree

2009-07-17 Thread Michael Bedward
Hello Hugo, Try this: BufferedTreeNodeStream nodes = new BufferedTreeNodeStream(myTree); LangWalker evaluator = new LangWalker(nodes); for(int i = 0; i < 1; i++) evaluator.rule(); evaluator.reset(); end Hope this helps, Michael List: http://www.antlr.org/mailman/listinfo

[il-antlr-interest: 24081] Re: [antlr-interest] "Language design patterns" book available in beta

2009-06-06 Thread Michael Bedward
2009/6/6 Sam Barnett-Cormack : > Not as annoying as having complete working code that's an example of > something that's insufficiently explained... a lot of books go with the > approach of a full description, illustrative (but brief!) snippets, and > full code downloadable. I like this approach.

[il-antlr-interest: 24019] Re: [antlr-interest] "Language design patterns" book available in beta

2009-06-03 Thread Michael Bedward
I got the pragprog email late last night (local time) and had the beta book about a minute later :-) I've been looking forward to this for months ! Michael List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-add

[il-antlr-interest: 23718] Re: [antlr-interest] Can antlr be used for this?

2009-05-14 Thread Michael Bedward
Hi Juanjo The short answer is yes :) But is your use case really one of complete translation or more searching for particular elements in the input data ? And, if so, would it be less work to build a few language-specific search routines (which ANTLR can help you do of course) rather than build

[il-antlr-interest: 23693] Re: [antlr-interest] ToStringTree

2009-05-13 Thread Michael Bedward
Very nice - thanks for the link Steve Michael 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 subscribe

[il-antlr-interest: 23478] Re: [antlr-interest] New Mave n artifacts, some fixes, buidlable source

2009-05-01 Thread Michael Bedward
many thanks for all that Jim ! Michael 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 th

[il-antlr-interest: 23330] Re: [antlr-interest] Resetting an AST tree walker

2009-04-22 Thread Michael Bedward
> I wonder what the logic is there.  One of the big benefits of a tree walker > is to be able to repeatedly walk the nodes.  I hope they don't remove that > capability from the BufferedTreeNodeStream.  Did that one work for you? > Except for increased memory is there ever a reason not to use > Buf

[il-antlr-interest: 23328] Re: [antlr-interest] Resetting an AST tree walker

2009-04-22 Thread Michael Bedward
Hi Steve, > I would think CommonTreeNodeStream should work however, so it > seems like a bug. but as I tried to explain, the new behaviour of CommonTreeNodeStream is that its contents are discarded as they are accessed by the tree walker, so you can reset the stream but there's nothing there any

[il-antlr-interest: 23326] Re: [antlr-interest] Resetting an AST tree walker

2009-04-22 Thread Michael Bedward
Hi Steve, I posted the message you're quoting. Just to clarify - I call the reset method too. My problem was that prior to 3.1.3 reset worked with CommonTreeNodeStream but with 3.1.3 the stream is empty after the tree walker has used it once so reset is useless. I think this should have been h

[il-antlr-interest: 23083] Re: [antlr-interest] Collecting Values in Lists

2009-04-09 Thread Michael Bedward
Hi Behdad, I'm sorry - I didn't read your question properly. Here is an example that might be more relevant... grammar Test; x returns [List values] @init { $values = new ArrayList(); } : e=y {$values.add($e.value)} (',' e=y {$values.add($e.value)} )* ; y returns [int va

[il-antlr-interest: 23052] Re: [antlr-interest] Collecting Values in Lists

2009-04-08 Thread Michael Bedward
Hi Behdad You can do this... x: foo+=y (',' foo+=y)* ; The += notation tells ANTLR to create a List which, in the example above, would be called list_foo. ANTLR doesn't do generics though, so list_foo will be a List and you will need to cast the elements to the appropriate type. Hope this he

[il-antlr-interest: 23001] Re: [antlr-interest] A Simple Question on Channels

2009-04-03 Thread Michael Bedward
Hi Indhu, Thanks very much for posting this example - it explains something that I want to do too. Michael 2009/4/3 Indhu Bharathi : > As expected, there were some bugs :-) Here is a implementation that works > fine: > > grammar Test; > > @members{ > >     private boolean newLineBef

[il-antlr-interest: 23000] Re: [antlr-interest] selective debug code generation for maven plugin

2009-04-03 Thread Michael Bedward
2009/4/4 Jim Idle wrote: > Please read the plugin docs. Jim - is it possible to get the plugin docs linked from http://www.antlr.org/wiki/display/ANTLR3/ANTLR+3+Wiki+Home ? At the moment the only thing you see there is a link to the old page. I put a note at the top of that page yesterday linkin

[il-antlr-interest: 22902] Re: [antlr-interest] reset method on a tree parser

2009-03-31 Thread Michael Bedward
OK, a with a bit more delving I found the problem was caused by the CommonTreeNodeStream stream being emptied after the first run of the tree walker, so calling reset didn't achieve much. This differs from ANTLR 3.1.1 behaviour but doesn't seem to be in the release notes for 3.1.2 or 3.1.3 (someo

[il-antlr-interest: 22901] Re: [antlr-interest] reset method on a tree parser

2009-03-31 Thread Michael Bedward
Sorry, that should have been "migrating an app from ANTLR 3.1.1 to 3.1.3" I've now also looked in the release notes for 3.1.2 but don't see my answer there either (or perhaps I just don't understand it :). So, still hoping for advice. cheers Michael 2009/4/1

[il-antlr-interest: 22900] [antlr-interest] reset method on a tree parser

2009-03-31 Thread Michael Bedward
Dear ANTLRites, I'm migrating an app from ANTLR 3.1.2 to 3.1.3, using the java target. It seems that I can no longer use the reset method on a tree parser - is that intentional ? In 3.1.2, calling reset on the tree parser would rewind its node stream, whereas in 3.1.3 this does not seem to happ

[il-antlr-interest: 22898] Re: [antlr-interest] Maven plugin documentation...

2009-03-31 Thread Michael Bedward
2009/4/1 Jim Idle wrote: > I'll check the examples, but: > The Libraries example has goals within configuration. The Netbeans editor, following the pom schema I guess, doesn't suggest goals as an element when you are within a configuration block, only outside. Michael List: http://www.antlr.or

[il-antlr-interest: 22897] Re: [antlr-interest] using the antlr maven repository

2009-03-31 Thread Michael Bedward
cheers Jim - I missed that Michael 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 Go

[il-antlr-interest: 22894] Re: [antlr-interest] using the antlr maven repository

2009-03-31 Thread Michael Bedward
2009/4/1 Jim Idle wrote: > Don't use the -SNAPSHOT versions, it should be just 3.1.3. You can only use > the snapshot versions if you define the ANTLR snapshot repository in your > pom, and you don't need to do that unless you absolutely require some fix > from the latest snapshot, which is 3.1.4

[il-antlr-interest: 22893] Re: [antlr-interest] Maven plugin documentation...

2009-03-31 Thread Michael Bedward
That's terrific, thanks Jim. I notice that in the different examples is sometimes inside and sometimes outside. Is this right ? I ask because when I'm editing the pom.xml file in Netbeans, the editor doesn't suggest the goals element when inside configuration. cheers Michael 2009/4/1 Jim Id

[il-antlr-interest: 22561] Re: [antlr-interest] Small example of local variable semantic analysis for an IDE

2009-03-19 Thread Michael Bedward
Thanks for posting this Sam ! I want to do some editor-related ANTLR work soon so it's nice to have your example. cheers Michael List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~-~--~--

[il-antlr-interest: 22548] Re: [antlr-interest] Tree - Replace nodes in tree

2009-03-18 Thread Michael Bedward
Hello Des, It's no problem to do this in a tree grammar. For instance, here is an example from one of my tree grammars expr: ^(ASSIGN assign_op var expr) -> {isImageVar($var.text)}? ^(IMAGE_WRITE var expr) -> ^(ASSIGN assign_op var expr) Here I r

[il-antlr-interest: 22526] Re: [antlr-interest] A newbie's question

2009-03-17 Thread Michael Bedward
Hi, First decide if you really need step 3 (the tree parser). If you want to parse some program / script and then perform evaluation multiple times, or you want to work on the AST to optimize execution or make it easier to do translation etc. then the answer is yes. But if you just want to pars

[il-antlr-interest: 22524] Re: [antlr-interest] How can I modify a tree node value according to the value of another tree node ?

2009-03-17 Thread Michael Bedward
> How could I store value in AS.g and how can AS.g and AStree.g communicate? > Could you plz give me a small example? > Hi Annie Just define variables in the members section of each grammar. Here's a general example where parser grammar A.g needs to collect data which will then be used in tree

[il-antlr-interest: 22504] Re: [antlr-interest] failed predicate problem

2009-03-16 Thread Michael Bedward
Hi Annie, Sorry for the confusion on my part. I haven't used StringTemplate yet and so went off in the wrong direction... But luckily, I see that Johannes has proposed a solution for you on the other thread about your question. Michael List: http://www.antlr.org/mailman/listinfo/antlr-interes

[il-antlr-interest: 22499] Re: [antlr-interest] failed predicate problem

2009-03-16 Thread Michael Bedward
So back to your rule... callExpression : ^(CALL_EXPRESSION memberExpression indexSuffix* propertyReferenceSuffix* argumentSuffix*) -> {$memberExpression.text.equals("Math.abs")}? mathabs(x={$argumentSuffix.text}) -> /* discard rule */ ; You want to rewrite the node if memberExpression is "Ma

[il-antlr-interest: 22498] Re: [antlr-interest] failed predicate problem

2009-03-16 Thread Michael Bedward
> * ?  - Match element one or more times. > > Does that what you mean? I just hadn't seen an asterisk in front of a rule or token name before... *propertyReferenceSuffix* argumentSuffix*) ^ This one. It's probably just an email text thing - sorry to go off an a tangent :-) Michael List: h

[il-antlr-interest: 22493] Re: [antlr-interest] How can I modify a tree node value according to the value of another tree node ?

2009-03-16 Thread Michael Bedward
Hi Annie, One way to pass data between sub-trees is to use global scope. See section 4.5 in the ANTLR book. Hope this helps Michael 2009/3/17 YINGAnnie : > > Hi everyone, > > > What I want to do is to replace var t:Number=Math.ceil(1.5); to var > t:int=int(1.5); The tree I got is something

[il-antlr-interest: 22492] Re: [antlr-interest] failed predicate problem

2009-03-16 Thread Michael Bedward
Hi Annie, > using-> before {  } ? Oops, you're quite right. The arrow should be before the predicate, not after (although that page in the book is about writing output with string templates. For rewriting ASTs you're better off looking at the wiki pages, for example... http://www.antlr.org/wi

[il-antlr-interest: 22470] Re: [antlr-interest] distinguishing between int and double in a tree grammar

2009-03-16 Thread Michael Bedward
Hi Anders, This is how I distinguish between int and double in my lexer rules: INT_LITERAL : '0' | NonZeroDigit Digit* ; FLOAT_LITERAL : ('0' | NonZeroDigit Digit*)? Dot Digit* FloatExp? ; fragment Digit : '0'..'9' ; fragment Dot

[il-antlr-interest: 22460] Re: [antlr-interest] failed predicate problem

2009-03-15 Thread Michael Bedward
Hi You are re-writing an AST ? I ask because your question made it sound like you are running actions but the grammar looks like re-writing. I was under the impression that you MUST provide an explicit alternative for when the predicate is not true. So... callExpression : ^(CALL_EXPRESSION me

[il-antlr-interest: 22446] Re: [antlr-interest] Doc-comments in generated Java

2009-03-13 Thread Michael Bedward
2009/3/14 Sam Barnett-Cormack : > yourself. Of course, that would avoid the spurious includes that keep > causing me warnings, but one almost expects them in generated code. > I've wondered about those includes. With the caveat that I've never looked at the back-end code, I would have thought it

[il-antlr-interest: 22409] Re: [antlr-interest] SVN repository for ANTLR Maven plugin?

2009-03-11 Thread Michael Bedward
rustle, rustle... that's the sound of me rubbing my hands together in anticipation :) Michael List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~-~--~~~---~--~~ Yo

[il-antlr-interest: 22407] Re: [antlr-interest] SVN repository for ANTLR Maven plugin?

2009-03-11 Thread Michael Bedward
Hi Emmanuel, I'm forwarding your post and this reply to the ANTLR list. I was going to look into that issue myself but haven't got to it, so it's really nice to hear from you :) But before you do too much hacking have a look at this latest work if you haven't already... http://antlr.org/hudson

[il-antlr-interest: 22387] Re: [antlr-interest] skipping whitespaces in code and avoiding it in comments

2009-03-10 Thread Michael Bedward
Have a look at this page... http://www.antlr.org/wiki/pages/viewpage.action?pageId=557063 Michael 2009/3/9 Sam Barnett-Cormack : > The whole point of the hidden channel (rather than just discarding) is > that the parser *can* tune to it, or use it for context checking in > predicates, or use it

[il-antlr-interest: 22326] Re: [antlr-interest] unary minus

2009-03-07 Thread Michael Bedward
Hi Anders, I have a fairly simpler grammar that has unary minus working ok. Perhaps it might provide some hints... http://code.google.com/p/jai-tools/source/browse/trunk/jiffle/src/main/antlr/jaitools/jiffle/parser/Jiffle.g Look for the unary_expr rule. I doubt if how I do it is best practice

[il-antlr-interest: 22148] Re: [antlr-interest] Is this the correct use of ANTLR

2009-02-27 Thread Michael Bedward
Hi Bob, Have just written my first language, which is also quite C-ish, while learning ANTLR at the same time my advice would be slightly different to Jim's. Yes, it's really helpful to start from an example. No, don't start with a giant C grammar because you're likely to get lost. That was my

[il-antlr-interest: 22104] Re: [antlr-interest] request for comments on language implementation

2009-02-25 Thread Michael Bedward
Hi folks, Nice discussion - I'm finding it most interesting and helpful. Andy: many thanks for your specific comments on Jiffle. That's just the kind of feedback that I was hoping for. Regarding "how to" info: I'm in the process of adding demo code and updating the wiki pages to help people tr

[il-antlr-interest: 22063] Re: [antlr-interest] RElease 3.1.2 now in Maven repo

2009-02-23 Thread Michael Bedward
also this wiki page... http://www.antlr.org/wiki/display/ANTLR3/Using+ANTLR+3+with+Maven+2 Michael List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~-~--~~~---~--~

[il-antlr-interest: 22045] Re: [antlr-interest] Match A with exception of B .....how do I do that?

2009-02-22 Thread Michael Bedward
> > Assume, there are two rules: > > 1) A : character_set_a; > > 2) B : character_set_b; > > How do I set up a rule for parsing a character which must be in the > > character_set_a but not in character_set_b? > Are the characters in the A and B sets mutually exclusive ? I'm guessing they are n

[il-antlr-interest: 22043] Re: [antlr-interest] Match A with exception of B .....how do I do that?

2009-02-22 Thread Michael Bedward
2009/2/23 Vlastimil Adamovsky : > > I want to parse digits, that are from 0 to 9 except those that are from 4 > to 7. > In reality, I want to parse only digits 0,1,2,3,8,9 > A: '0'..'3' | '8' | '9' ; Is this what you want ? Michael List: http://www.antlr.org/mailman/listinfo/antlr-inter

[il-antlr-interest: 22035] Re: [antlr-interest] RElease 3.1.2 now in Maven repo

2009-02-21 Thread Michael Bedward
> On Feb 21, 2009, at 6:00 PM, Jim Idle wrote: > >> Should make it to Maven central within about 4 hours. The main >> development builds will now all be bumped to 3.1.3-SNAPSHOT... >> >> Also, maven antlr plugin becomes release 3.1.2 to reflect the fact >> that that version will build using ANTLR

[il-antlr-interest: 22024] [antlr-interest] request for comments on language implementation

2009-02-20 Thread Michael Bedward
Hi folks, This is a plug and a request for feedback on my first ANTLR project: Jiffle - a simple language for creating raster images from maths expressions. You can find it at http://code.google.com/p/jai-tools/ Look for the Jiffle link at the bottom of that page. There is a preliminary descri

[il-antlr-interest: 22013] Re: [antlr-interest] When a comment not a comment

2009-02-19 Thread Michael Bedward
> Shouldn't do - you are using the debug mode and not the interpreting mode? > yep I must be doing something wrong but I can't spot it... (probably too close to my nose :) Michael List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antl

[il-antlr-interest: 22009] Re: [antlr-interest] When a comment not a comment

2009-02-19 Thread Michael Bedward
2009/2/20 Jim Idle wrote: > COMMENT : '#' > ( > ( 'ABCD')=> 'ABCD' > | ~('\r' | '\n')* NEWLINE > ) > { $channel = HIDDEN; } > ; > > NEWLINE

[il-antlr-interest: 21995] Re: [antlr-interest] When a comment not a comment

2009-02-18 Thread Michael Bedward
Hi Joe, How about this... NONCOMMENT : '#ABCD' { $channel = HIDDEN; } ; COMMENT : '#' ~('\r' | '\n')* NEWLINE { $channel = HIDDEN; } ; NEWLINE : '\r' ('\n')? | '\n' ; Michael List: http://www.antlr.org/mailman/listinfo/antlr-interest

[il-antlr-interest: 21909] Re: [antlr-interest] Maven plugin source etc now available from ANTLR Hudson

2009-02-12 Thread Michael Bedward
that's terrific Jim - many thanks Michael 2009/2/13 Jim Idle : > As well as deploying the source and javadoc jars to the ANTLR snapshot > repository (which means they will go to the maven central respository at the > next point release), the ANTLR Hudson continuous build system is also aware > o

[il-antlr-interest: 21903] Re: [antlr-interest] maven plugin always regenerates sources

2009-02-12 Thread Michael Bedward
super - thanks Jim Michael 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 Gro

[il-antlr-interest: 21901] Re: [antlr-interest] maven plugin always regenerates sources

2009-02-12 Thread Michael Bedward
Hi Jim > Did you tell Netbeans to use the the Maven 2.0.9 installation, or di d > you let it use its supplied one, which in Netbeans 6.1 is the > development version M2 or M1 of 2.0.10 and has a few issues. I've tried both, as well as running 2.0.9 from the command line just in case it was an ID

[il-antlr-interest: 21886] Re: [antlr-interest] Summing values from "+="

2009-02-12 Thread Michael Bedward
At the start of the rule the generated parser code will have... var e:Token=null; var list_e:Array=null; and then in the sumStat rule loop... if (list_e==null) list_e=new Array(); list_e.push(e); Hope this helps, Michael 2009/2/12 Des Hartman : > I have a simple function to sum values, where

[il-antlr-interest: 21883] [antlr-interest] maven plugin always regenerates sources

2009-02-12 Thread Michael Bedward
Hi folks, I'm using the org.antlr maven plugin. It does a great job - it just seems to want to do it all the time :-) In other words, it _always_ wants to re-generate the sources, even when the existing files are more recent that the grammar files. I'm using maven from within Netbeans. I've f

[il-antlr-interest: 21851] Re: [antlr-interest] grammar highlighting in Netbeans

2009-02-10 Thread Michael Bedward
> Yes - I like what I see so far. It needs some updates for actions and > stuff like that (most of my grammar shows up red ;-), but I think that > it will be really good as it develops. Well your grammars would probably make excellent advanced test cases for the developer Jim... Michael List: h

[il-antlr-interest: 21848] Re: [antlr-interest] grammar highlighting in Netbeans

2009-02-10 Thread Michael Bedward
Just another plug for the netbeans plugin :-) I've been using it with NB 6.1 and it's _so_ nice. The only real prob that I've found with it so far is that it doesn't seem to like catch[ ] clauses at the end of a rule - unless i'm doing something wrong... Michael List: http://www.antlr.org/mail

[il-antlr-interest: 21846] Re: [antlr-interest] multiple tree walkers

2009-02-10 Thread Michael Bedward
2009/2/9 Oliver Zeigermann: > > I set up a page where I share my experience with multiple tree > transformer stages: > > http://www.antlr.org/wiki/display/ANTLR3/Complex+tree+transformations+using+cascading+tree+rewriters > > Maybe you would like to add yours? > Hi Oliver, I'm loving the tree re

[il-antlr-interest: 21814] Re: [antlr-interest] multiple tree walkers

2009-02-09 Thread Michael Bedward
Andreas - many thanks for the tip about grammar imports. That sound like a good way to do some of what I'm trying (and learning how) to do. I didn't know about this since composite grammars are more recent than the book (my primary learning resource so far). Oliver - thanks for the useful page

[il-antlr-interest: 21790] [antlr-interest] multiple tree walkers

2009-02-08 Thread Michael Bedward
Hi folks, I'm working on a little DSL, called jiffle, to create raster images from maths expressions. I build an initial AST from the input jiffle script, and next use a couple of tree walkers to (1) check for undefined vars and (2) categorize vars on whether thay depend on pixel position or not

[il-antlr-interest: 21629] [antlr-interest] error with modulo operator in tree grammar action

2009-01-29 Thread Michael Bedward
Hello all, I search the list for this but only found a related bug report - no solution. I have a rule and associated action (java) in my tree grammar... expr: ^(MOD a=expr b=expr) {$value = a % b;} This provokes get an invalid string template error. I imagine there must be some simple option

[il-antlr-interest: 21607] [antlr-interest] expression list in tree grammar

2009-01-28 Thread Michael Bedward
Hello all, I think I should probably apologize in advance for this question because (a) it's probably really obvious and (b) I know it's been asked before but as a newbie I've had trouble understanding the previous posts or finding the solution in the book. In my parser grammar: expr_list