[il-antlr-interest: 23660] [antlr-interest] Problem with AST parsing for ST

2009-05-11 Thread Nauman
Hi all, I'm trying to parse a high level policy and generate a low-level structured text. The grammar rule for policy set and policy are: policyset (policy)+ -> ^(POLICYSET policy+); and policy: policyType^ LBRAC! targetType RBRAC! LBRACE! condition

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

2009-05-11 Thread Steve Ebersole
We wrote this one for Hibernate that I love. Not overly complex, should be easy to port the code I would think... http://viewvc.jboss.org/cgi-bin/viewvc.cgi/hibernate/core/branches/antlr3/src/main/java/org/hibernate/sql/ast/util/TreePrinter.java?revision=16467&view=markup On Mon, 2009-05-11 at

[il-antlr-interest: 23657] [antlr-interest] What does this error mean in english?

2009-05-11 Thread Christopher Laco
"mismatched tree node: DOCUMENT expecting DOCUMENT" I'm not having very good luck trying to do simple things apparently. My ToStringTree: (DOCUMENT (PRINT 'variable')) My tree grammar: document : ^(DOCUMENT statement*) ; statement : ^(PRINT LITERAL) ; List: http://www.antlr.

[il-antlr-interest: 23656] [antlr-interest] ToStringTree

2009-05-11 Thread Christopher Laco
Is there a quick and dirty way to print out the tree with tabs/line feeds to make it a little more readable using the C# runtime? -=Chris List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~---

[il-antlr-interest: 23655] Re:仓储

2009-05-11 Thread ^ 货管 %
il-antlr-interest il-antlr-interest@googlegroups.com pe ie 282384 --~--~-~--~~~---~--~~ 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-antl

[il-antlr-interest: 23654] [antlr-interest] Defining a custom AST in the C target of ANTLR 3

2009-05-11 Thread Rosen, Mark
Is there any example code on how to define your own AST subclass in C/C++ using ANTLR 3.0? I was able to find some for ANTLR 2.x, but none for ANTLR 3.0. I know that you need to specify the AST type name in ASTLabelType, but 1) do you need to register it with some kind of factory, and 2) which c

[il-antlr-interest: 23653] [antlr-interest] cannot find tokens file /file.tokens

2009-05-11 Thread Marwan Ajraoui
Hi there; I'm getting this error: cannot find tokens file /file.tokens. I 've got the file .tokens in the same directory of the my ".g". Where does Antlr look for the file token. Do I need to set up enviremont variable ANTLR_home? Because I simply run org.antlr.Tool passing the file as an argumen

[il-antlr-interest: 23652] Re: [antlr-interest] [C Target][3.1.1] Trying to understand the behavior of rules with kleene stars

2009-05-11 Thread Loring Craymer
This is a symptom of not having an EOF at the end of your top level rule--you need to add EOF after ';'. --Loring - Original Message > From: Sven Van Echelpoel > To: "antlr-inter...@antlr.org" > Sent: Monday, May 11, 2009 7:30:29 AM > Subject: [antlr-interest] [C Target][3.1.1] Tr

[il-antlr-interest: 23651] "Beautiful innocent school teacher fucked by principal"

2009-05-11 Thread anu.sri...@gmail.com
"Beautiful innocent school teacher fucked by principal" http://hugemoneycollections.blogspot.com http://hugemoneycollections.blogspot.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To

[il-antlr-interest: 23650] Re: [antlr-interest] How to pass the current node to the action?

2009-05-11 Thread Jim Idle
Xie, Linlin wrote: Hi Jim,   The weird thing is if I use the $rule1.tree directly, the generated code would try to convert the rule1_return structure to common token type first, but if I assign the rule to a variable, say P: r1=Rule1 Rule2; then using $r1.tree would be compl

[il-antlr-interest: 23649] Re: [antlr-interest] MySQL grammar -- can I submit?

2009-05-11 Thread Jim Idle
Avid Trober wrote: > isn't MySql already written w/ ANTLR? No, it uses a bison grammar right now. We are exploring the possibilities of using ANTLR instead :-) Jim List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/you

[il-antlr-interest: 23648] [antlr-interest] Bad first token

2009-05-11 Thread Bill Steer
Hello, all. I've simplified my grammar, eliminating all of the non-determinisms in the lexer (I think). When I look at the tokens returned from the lexer, I get the following first token: {...@-1,0:0='',<-1>,0:-1]} The input string to the lexer appears to be correct. The token type is obvi

[il-antlr-interest: 23647] [antlr-interest] [C Target][3 .1.1] Trying to understand the behavior of rules with kleene s tars

2009-05-11 Thread Sven Van Echelpoel
Hi, I'm having trouble understanding the behavior of the parser w.r.t. invalid token in rules with Kleene star elements. I have this grammar that says that a translation unit is zero or more rules, declarations, etc. e.g. translation_unit : ( declaration | rule )* ';' -> ^( UNIT rule* )

[il-antlr-interest: 23646] Re: [antlr-interest] How to pass the current node to the action?

2009-05-11 Thread Xie, Linlin
Hi Jim, The weird thing is if I use the $rule1.tree directly, the generated code would try to convert the rule1_return structure to common token type first, but if I assign the rule to a variable, say P: r1=Rule1 Rule2; then using $r1.tree would be completely fine, as the generated code would

[il-antlr-interest: 23645] Re: [antlr-interest] How to pass the current node to the action?

2009-05-11 Thread Xie, Linlin
Hi Jim, Thank you very much for your reply. I tried with the .tree solution you suggested, but got errors like "error C2440: 'type cast' : cannot convert from 'p_return' to 'pANTLR3_COMMON_TOKEN'." I can see that you are trying to use the common token structure, but the way to get the common t