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
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
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
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
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
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
--~--~-
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
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
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
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.
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)
>> | ^(('<'|'>'
ResponseNumber();
>$value = idvalue;
>System.out.println("=> Parsing ID = " + $ID.text
> + " value = " + idvalue);
>} else System.err.println("undefined variable
> "+$ID.text);
>} catch (Exception e)
&
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
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
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
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
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
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
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..
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
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
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
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
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
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
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
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:
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
; 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
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
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/
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
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
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:
>>>>
>>>>
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
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)+)
>>
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
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
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 "."
>> &
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
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
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,
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
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
>
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
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
46 matches
Mail list logo