[il-antlr-interest: 32412] Re: [antlr-interest] Source code level of ANTLRWorks

2011-05-09 Thread Ben Corne
The path field expects a directory where it can find the javac binary in. Adding flags behind the directory also fails: The debugger fails to initialize and leaves some process running in the background requiring me to kill the process before I can try to run the debugger again. Any more

[il-antlr-interest: 32413] [antlr-interest] Translating expressions - advice?

2011-05-09 Thread Hans-Juergen Rennau
Hello People, being an ANTLR beginner, I would very much appreciate advice concerning good practise for a rather simple task. The task is the translation of a JPQL's (Java Persistence Query Language) where clause into a proprietary query language. The clause has the well-known expression

[il-antlr-interest: 32414] Re: [antlr-interest] Translating expressions - advice?

2011-05-09 Thread Bart Kiers
I get the impression you think that when creating AST's, ANTLR inserts parenthesis (brackets). This is not the case: I guess what you're seeing is just the tree's `toStringTree()` that displays these parenthesis to make the hierarchy of the tree apparent. Or am I misinterpreting your question?

[il-antlr-interest: 32415] Re: [antlr-interest] Translating expressions - advice?

2011-05-09 Thread Bart Kiers
Wait I think I misunderstood. Your example `(a OR (b OR (c AND d)))` is just an example expression, right? In that case, yes, these parenthesis are part of the token stream, but if you apply rewrite rules (or AST operators `^` and `!`) properly, these parenthesis are easily removed from your parse

[il-antlr-interest: 32417] Re: [antlr-interest] Source code level of ANTLRWorks

2011-05-09 Thread Jim Idle
You might be better using remote debugging but you can do what you suggested earlier and create a script, then tell Works that that is the java compiler. Jim -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- boun...@antlr.org] On Behalf Of Ben Corne

[il-antlr-interest: 32418] Re: [antlr-interest] Translating expressions - advice?

2011-05-09 Thread Jim Idle
If the output language has the same operator precedence as the input language then there is no need to add additional parens. Just preserve the presence of parens in the input and reflect them in the output: expression : expr - ^(EXPRESSION expr) ; // In AST will indicate () expr : orexpr -

[il-antlr-interest: 32419] Re: [antlr-interest] Translating expressions - advice?

2011-05-09 Thread Loring Craymer
Optimal placement of parentheses is tricky; as a first step, you want to use the form ^('+' A B C D E F ) as long as the operator is associative; then you want to parenthesize only when required to by changes in operator precedence; the easiest way is actually to have two versions of each

[il-antlr-interest: 32420] [antlr-interest] Composite grammars: compile error with @header tag.

2011-05-09 Thread Pavel Ganelin
I have 4 grammar file: lexer L.g, parser P.g and two grammars G1 and G2 (see below). After running antlr to generate Java files compilation fails: [mkdir] Created dir: target\classes [javac] Compiling 10 source files to target\classes [javac] target\src\example\G1Lexer.java:18: cannot

[il-antlr-interest: 32421] [antlr-interest] Feature Request - Visualize the Parse Graph for multiple rules by Rule Decisions and Tokens consumed

2011-05-09 Thread Douglas Godfrey
Feature Request: A way to visualize the Parse Graph of a grammar by the sequence of Tokens consumed by the rules. The Parse Graph should be generated by selecting a rule or rule decision and using the contextual menu or the Grammar menu. The root of the Parse Graph should be the start of the