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
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
"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.
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 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
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
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
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
"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
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
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
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
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* )
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
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
15 matches
Mail list logo