[il-antlr-interest: 23931] [antlr-interest] ANTLR Conference next week: Still some open slots!

2009-05-30 Thread Oliver Zeigermann
Folks! Next weekend we will have an ANTLR and Stringtemplate conference at the University of San Francisco: http://www.antlr.org/wiki/display/ANTLR3/ANTLR+Conference+2009 There still are a couple of open slots. Join us! See you there! - Oliver List: http://www.antlr.org/mailman/listinfo/antl

[il-antlr-interest: 23369] [antlr-interest] ANTLR Conference 2009: Call for additional speakers

2009-04-25 Thread Oliver Zeigermann
Folks! For the upcoming ANTLR conference 2009 http://www.antlr.org/wiki/display/ANTLR3/ANTLR+Conference+2009 we would like to have a few more speakers. If you are positive to come (which of course is a requirement) and have something to tell us about, please let us know by replying to this ema

[il-antlr-interest: 22706] [antlr-interest] gUnit-Questions

2009-03-24 Thread Oliver Zeigermann
Hi folks! I have read the descritption for gUnit at http://www.antlr.org/wiki/display/ANTLR3/gUnit+-+Grammar+Unit+Testing and really like it. I was wondering about some features that would be really useful for me 1.) Compare the output of two different input statements: Useful to check if two

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

2009-02-09 Thread Oliver Zeigermann
Hi Michael! I do the same thing and have the same concerns. I have no better solution now, but ANTLR 3.2 will feature pattern based tree rewriting which might solve this: http://www.antlr.org/wiki/display/~admin/2008/11/30/Example+tree+rewriting+with+patterns I set up a page where I share my ex

[il-antlr-interest: 21589] Re: [antlr-interest] Source level include: Line numbers messed up

2009-01-27 Thread Oliver Zeigermann
This is one of my bad days. In case anyone else wonders how to do that: http://www.antlr.org/wiki/pages/viewpage.action?pageId=557057 - Oliver 2009/1/27 Oliver Zeigermann : > Folks! > > I am doing includes on the source level, but this messes up my line numbers. > > Any idea

[il-antlr-interest: 21587] [antlr-interest] Source level include: Line numbers messed up

2009-01-27 Thread Oliver Zeigermann
Folks! I am doing includes on the source level, but this messes up my line numbers. Any idea how to fix this? Thanks in advance - Oliver List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~-

[il-antlr-interest: 21570] Re: [antlr-interest] how do I accumulate multiple returns for parser matches in one variable?

2009-01-26 Thread Oliver Zeigermann
Have you tried this(not tested)? ingrediententry @init { List li = new List(); } // ingredient returns an id : q=number uid=unit iid=ingredient (qid=ingredient_qualifier {$li.Add($qi

[il-antlr-interest: 21562] [antlr-interest] ANTLR Conference 2009

2009-01-25 Thread Oliver Zeigermann
Folks! To get more serious about the ANTLR 2009 conference I created this Wiki page to collect ideas: http://www.antlr.org/wiki/display/ANTLR3/ANTLR+Conference+2009 Feel free to add you comments/topics/ideas. I have already added the topics I could gather from the mailing lists. Thanks and ho

[il-antlr-interest: 21559] Re: [antlr-interest] Shortcircuiting the tree parser

2009-01-25 Thread Oliver Zeigermann
2009/1/25 Johannes Luber : > Carter Cheng schrieb: >> Thanks everyone for the replies to my previous post. I have been wondering >> about one additional point >> when it comes to tree parsers. For alot of AST's when doing semantic > analysis you tend to have alot >> of separable distinct tasks wh

[il-antlr-interest: 21502] Re: [antlr-interest] Tree Evaluation with Logical Operators (AND and OR)

2009-01-22 Thread Oliver Zeigermann
se. > > a=1 > b=3 > c=1 > > So in the expression (a < 3) or (b < 3) or ((b = 3) AND (c < 3)) > > I need to mark b and c as the elements that caused the expression to be > false. I can't figure out the action of the AND. > > Thanks for your help.

[il-antlr-interest: 21499] Re: [antlr-interest] Tree Evaluation with Logical Operators (AND and OR)

2009-01-22 Thread Oliver Zeigermann
2009/1/22 shmuel siegel : > Oliver Zeigermann wrote: >> >> OK, so you need a tree grammar that can parse complex boolean >> expressions, right? >> >> expression >> : ^((AND|OR) expression expression) >> | ^(('<'|'>'

[il-antlr-interest: 21498] Re: [antlr-interest] Tree Evaluation with Logical Operators (AND and OR)

2009-01-22 Thread Oliver Zeigermann
ResponseNumber(); >$value = idvalue; >System.out.println("=> Parsing ID = " + $ID.text > + " value = " + idvalue); >} else System.err.println("undefined variable > "+$ID.text); >} catch (Exception e) &

[il-antlr-interest: 21493] Re: [antlr-interest] Tree Evaluation with Logical Operators (AND and OR)

2009-01-22 Thread Oliver Zeigermann
h expr such as (< a 3). I'm able to walk and evaluate > these simple expr too. But! when I walk (or (and (< a 3) (< b 3)) (< c 3)) > I'm stumped. > > This must have been solved before and I would guess that there is probably a > design pattern for walking bool

[il-antlr-interest: 21488] Re: [antlr-interest] Tree Evaluation with Logical Operators (AND and OR)

2009-01-22 Thread Oliver Zeigermann
Hi! Not quite sure what your problem is. Are you asking how an AST for a logical expression might look like? Or the grammar that creates it? Or the tree grammar that walks it? Or something else? -Oliver 2009/1/22 Priolo, Scott : > Hello, > > > > I've searched high and low and can't find a refe

[il-antlr-interest: 21167] Re: [antlr-interest] optional node in tree parser...

2009-01-02 Thread Oliver Zeigermann
rule : {$p}=> ^(A B) (^(C .))? ; 2009/1/2 Pady Srinivasan : > > Can I have some rule as follows ? > > rule > : {$p}=> ^(A B) ^(C .)? > ; > > When I do this, I get an error about "unexpected token '?'". How do I > indicate that the second subtree might not exist ? > > > Thanks > > -- pady > > > Li

[il-antlr-interest: 21158] Re: [antlr-interest] Location dependent token?

2008-12-31 Thread Oliver Zeigermann
SYMBOL : A-Z A-Z A-Z ; - Oliver 2008/12/31 Oliver Zeigermann : > Hi Mats! > > If you really need to distinguish monetary from measurement unit in > the _lexer_ - which I doubt for the same reasons as the others > answering - you could add a semantic predicate. > > Modifying Jared

[il-antlr-interest: 21157] Re: [antlr-interest] Location dependent token?

2008-12-31 Thread Oliver Zeigermann
Hi Mats! If you really need to distinguish monetary from measurement unit in the _lexer_ - which I doubt for the same reasons as the others answering - you could add a semantic predicate. Modifying Jared's grammar might lead to this: @lexer::members { protected boolean isMonetarySymbol = true

[il-antlr-interest: 21010] Re: [antlr-interest] ANTLR seminar in Europe

2008-12-17 Thread Oliver Zeigermann
Germany :) 2008/12/18 Terence Parr : > > On Dec 17, 2008, at 4:25 PM, Michael Fogeborg wrote: > >> What about an Antlr seminar in Europe ? >> Maybe in Finland ? > > Might be fun to do one in europe sometime...what country is considered > centrally located? > > Ter > > List: http://www.antlr.org:8

[il-antlr-interest: 20965] Re: [antlr-interest] Survey: Anyone interested in an ANTLR conference 2009?

2008-12-16 Thread Oliver Zeigermann
2008/12/16 Terence Parr : > > On Dec 15, 2008, at 4:18 PM, Alexandre Porcelli wrote: > >> It would be GREAT! >> >> (1) What would you like to discuss / learn about? >> - Better understand of DFA >> - ANTLR Roadmap >> (2) What can you tell us about? >> - I could show something about OpenSpotLight..

[il-antlr-interest: 20945] Re: [antlr-interest] Survey: Anyone interested in an ANTLR conference 2009?

2008-12-15 Thread Oliver Zeigermann
2008/12/15 Oliver Zeigermann : > (1) What would you like to discuss / learn about? > (2) What can you tell us about? I would like to learn about as much practical experience as possible. - How do your ASTs look like? - How do you avoid duplication? - How do you share work in compiler desig

[il-antlr-interest: 20942] [antlr-interest] Survey: Anyone interested in an ANTLR conference 2009?

2008-12-15 Thread Oliver Zeigermann
Folks! I was just wondering if anyone would be interested in an ANTLR conference in 2009? (I am not saying there will be one, though) What I am especially interested in: (1) What would you like to discuss / learn about? (2) What can you tell us about? Cheers Oliver List: http://www.antlr.org

[il-antlr-interest: 20933] Re: [antlr-interest] Complex AST transformaton

2008-12-14 Thread Oliver Zeigermann
importVocab is ANTLR2, but there is tokenVocab for ANTLR3. You can use it to define the complete token set, but it does not seem to do a merge of token types, though. 2008/12/14 Gavin Lambert : > At 23:46 14/12/2008, Oliver Zeigermann wrote: >>How can I import tree token types int

[il-antlr-interest: 20931] Re: [antlr-interest] Complex AST transformaton

2008-12-14 Thread Oliver Zeigermann
re the > parser token types are determined. > > --Loring > > > > - Original Message >> From: Oliver Zeigermann >> To: Terence Parr >> Cc: antlr-interest Interest >> Sent: Saturday, December 13, 2008 3:07:05 AM >> Subject: Re: [antlr-int

[il-antlr-interest: 20923] [antlr-interest] AST construction: partial null trees

2008-12-13 Thread Oliver Zeigermann
I have not investigated why, but including partial null trees often makes the whole generated ASTs null which makes debugging really hard. Am I doing anything wrong, or could that indeed be handled more gracefully by ANTLR? As an example have a look at such a parser grammar rule creating an AST

[il-antlr-interest: 20922] [antlr-interest] Again wildcards in tree grammars

2008-12-13 Thread Oliver Zeigermann
This rule in a tree grammar child : childNode=. {System.out.println("Child="+$childNode.text);} ; is accepted by the ANTLR tool without problems, but the generated code is broken, as there is a catch block for an exception (RecognitionException) that is never thrown: public final SQLEmitter

[il-antlr-interest: 20921] Re: [antlr-interest] Complex AST transformaton

2008-12-13 Thread Oliver Zeigermann
nyway?! Oliver 2008/12/12 Terence Parr : > Try a grammar import (from where the new tokens come from). that hsould > give a union of AST1/AST2 token types. > Ter > On Dec 12, 2008, at 4:36 AM, Oliver Zeigermann wrote: > >> Folks! >> >> I am struggeling to how to mak

[il-antlr-interest: 20908] [antlr-interest] Complex AST transformaton

2008-12-12 Thread Oliver Zeigermann
Folks! I am struggeling to how to make a complex AST1 -> AST2 transformation where the token types of AST1 are completely different from those in AST2. How do I specify "tokenVocab" in this case? Do I have to create a token file manually? Any hints welcome :) Oliver List: http://www.antlr.org:

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

2008-12-05 Thread Oliver Zeigermann
get and ST#, I was trying > to see whether you could select model fragments declaratively through a > grammar and then emit templates from it. Would be pretty cool I think. > > Of course, the model is already much like an AST so what you'd need is > something like a tree grammar

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

2008-12-04 Thread Oliver Zeigermann
; to see whether you could select model fragments declaratively through a > grammar and then emit templates from it. Would be pretty cool I think. > > Of course, the model is already much like an AST so what you'd need is > something like a tree grammar to walk the model. > > B

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

2008-12-04 Thread Oliver Zeigermann
I think what you were looking for is not Xtext, but raher Xpand2: http://www.eclipse.org/gmt/oaw/doc/4.3/html/contents/core_reference.html#xpand_reference_introduction which allows you to generate code from models (there are different types of models you can use). Especially, you can use EMF mod

[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: 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: 20796] Re: [antlr-interest] wildcard in tree grammar

2008-12-02 Thread Oliver Zeigermann
2008/12/2 Terence Parr <[EMAIL PROTECTED]>: > > On Dec 2, 2008, at 2:58 AM, Oliver Zeigermann wrote: >> >> Here is what I want to do: >> >>>> Traverse a *full tree* (i.e. from tree root down to each and every >>>> leaf), having access

[il-antlr-interest: 20783] Re: [antlr-interest] wildcard in tree grammar

2008-12-02 Thread Oliver Zeigermann
2008/12/1 Terence Parr <[EMAIL PROTECTED]>: > > On Dec 1, 2008, at 10:16 AM, Oliver Zeigermann wrote: > >> 2008/12/1 Terence Parr <[EMAIL PROTECTED]>: >>> >>> On Nov 30, 2008, at 11:15 PM, Gavin Lambert wrote: >>>> >>>>

[il-antlr-interest: 20770] Re: [antlr-interest] wildcard in tree grammar

2008-12-01 Thread Oliver Zeigermann
2008/12/1 Terence Parr <[EMAIL PROTECTED]>: > > On Nov 30, 2008, at 11:15 PM, Gavin Lambert wrote: >> >> And then of course there's Oliver's example, where he just wanted to >> traverse the (sub)tree regardless of structure (presumably to pretty-print >> it or something). > > If you don't care abo

[il-antlr-interest: 20757] Re: [antlr-interest] added pattern rewriting example

2008-11-30 Thread Oliver Zeigermann
2008/11/30 Terence Parr <[EMAIL PROTECTED]>: > > On Nov 30, 2008, at 1:07 PM, Oliver Zeigermann wrote: > >> OK. I do not quite grok it. Looking at >> >> topdown >> : ^('*' INT ^(VEC (e+=.)+)) -> ^(VEC ^('*' INT $e)+) >>

[il-antlr-interest: 20754] Re: [antlr-interest] wildcard in tree grammar

2008-11-30 Thread Oliver Zeigermann
ANTLR-368 > > Ter > On Nov 30, 2008, at 1:55 AM, Oliver Zeigermann wrote: > >> Great. Thanks! >> >> Can we expect that in 3.2? >> >> Oliver >> >> 2008/11/30 Terence Parr <[EMAIL PROTECTED]>: >>> >>> I agree. '.' as

[il-antlr-interest: 20747] Re: [antlr-interest] sneak preview of ANTLR v3.2 (book release version)

2008-11-30 Thread Oliver Zeigermann
I tried this out and it actually works great :) I am wondering if "bottomup" is really needed, though. I only need "topdown" as the whole structure already is encoded in the tree. So there is no need to track context for me in that way. Do you have any use case for that? Or did I get that all w

[il-antlr-interest: 20743] Re: [antlr-interest] wildcard in tree grammar

2008-11-30 Thread Oliver Zeigermann
sis. > Ter > On Nov 29, 2008, at 3:23 PM, Gavin Lambert wrote: > >> At 09:58 30/11/2008, Oliver Zeigermann wrote: >> >Hmmm. Just checked that with the latest snapshot of ANTLR 3.2, >> >but it really does not work, but it should, right? Why can "." >> &

[il-antlr-interest: 20733] Re: [antlr-interest] sneak preview of ANTLR v3.2 (book release version)

2008-11-29 Thread Oliver Zeigermann
That's pretty cool and exactly what I need. My trick to transform partial trees only was to have a rule like that treee : ^(. treee* ) ; which would walk a complete tree in ANTLR 2 as a starting point. For each subtree to match you then add an alternative into that rule. That's

[il-antlr-interest: 20732] Re: [antlr-interest] wildcard in tree grammar

2008-11-29 Thread Oliver Zeigermann
Hmmm. Just checked that with the latest snapshot of ANTLR 3.2, but it really does not work, but it should, right? Why can "." not be a tree root? Grammar: treee : ^(. treee* ) ; Command line: ANTLR Parser Generator Version 3.2-2008-10-21 error(166): OCLWalker.g:27:6: Wildcard i

[il-antlr-interest: 20718] Re: [antlr-interest] wildcard in tree grammar

2008-11-29 Thread Oliver Zeigermann
have here, but this rule > will only print 1 line, regardless of the input tree: > > tree : ^(. {System.out.println("tree node");} tree*) > > Sam > > -Original Message- > From: Oliver Zeigermann [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 27,

[il-antlr-interest: 20716] Re: [antlr-interest] wildcard in tree grammar

2008-11-28 Thread Oliver Zeigermann
2008/11/27 Gavin Lambert <[EMAIL PROTECTED]>: > In other words (in vaguely ANTLR-like syntax): > > wildtree : ANYNODE | ^(ANYNODE wildtree*) ; > > . => wild > ^(.) => ANYNODE > ^(. FOO) => ^(ANYNODE FOO) > ^(FOO .) => ^(FOO wildtree) > ^(FOO . .) => ^(FOO wildtree wi

[il-antlr-interest: 20714] Re: [antlr-interest] wildcard in tree grammar

2008-11-28 Thread Oliver Zeigermann
2008/11/27 Gavin Lambert <[EMAIL PROTECTED]>: > At 21:23 27/11/2008, Oliver Zeigermann wrote: >>> In other words (in vaguely ANTLR-like syntax): >>> >>> wildtree : ANYNODE | ^(ANYNODE wildtree*) ; >>> >>> . => wild >

[il-antlr-interest: 20682] Re: [antlr-interest] wildcard in tree grammar

2008-11-26 Thread Oliver Zeigermann
2008/11/26 Gavin Lambert <[EMAIL PROTECTED]>: > At 09:14 27/11/2008, Oliver Zeigermann wrote: >>Too bad for me as I have this in a tree parser (rule is spelled >>with 3xe on purpose): >> >>treee >> : ^(. treee* ) >> ; >> >>wh

[il-antlr-interest: 20680] Re: [antlr-interest] wildcard in tree grammar

2008-11-26 Thread Oliver Zeigermann
2008/10/21 Terence Parr <[EMAIL PROTECTED]>: > > On Oct 21, 2008, at 12:02 AM, Gavin Lambert wrote: >> For analysis purposes, shouldn't ^(anything at all) be considered >> equivalent to a single node anyway? In much the same way that in >> the expression "x + (y + z)", "x" and "(y + z)" are both