[il-antlr-interest: 32946] Re: [antlr-interest] ANTLR problem with .+ in tree grammar

2011-06-25 Thread Sam Harwell
I use the following rule for that:

genericBlock
:   '{'
(genericBlock | ~('{'|'}'))*
'}'
;

Since the curly braces are inside the genericBlock rule, you'll have to modify 
your componentStatement rule:

componentStatement
:'component'^ IDENT  genericBlock ';'!
;

Sam

-Original Message-
From: antlr-interest-boun...@antlr.org 
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of Dariusz Dwornikowski
Sent: Saturday, June 25, 2011 5:30 AM
To: antlr-interest@antlr.org
Subject: [antlr-interest] ANTLR problem with .+ in tree grammar

Hi,

I've got such a problem. I am experimenting with the ANTLR in order to 
implement some kind of language later. The example below.

Grammar file (interesting part):
...
tokens{
BODY;
}

componentStatement
:'component'^ IDENT  '{'! body '}'! ';'!
;

body
:.+ - BODY
;
...

tree gramar file:
...

component




:   ^('component' name=IDENT body=BODY) {comp.add(new
Component($name.text, $body.text));}





;

..

What i want is to catch such a situation (for experiment purposes only):

component Foo {
anything goes here 123 :)
};

Now, I know rewrite in my example rewrites .+ to BODY it is ok. When I change 
the grammar to body
:.+ - BODY
;

and tree grammar to:

component
:   ^('component' name=IDENT body=(.+)) {comp.add(new
Component($name.text, $body.text));}





;

the generates Walker generates it wrong:
comp.add(new Component((name!=null?name.getText():null), b.text)); it should 
have been b.getText()


How can I change files in order to catch what I want?





PS: ANTLR is great:) And Greetings to everybody :)



--
Pozdrawiam,
-
Dariusz Dwornikowski,
Institute of Computing Science, Poznań University of Technology 
www.cs.put.poznan.pl/ddwornikowski/
room 421 WE | tel. +48 61 665 21 24   | mobile: +48 533 890 600
-

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
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-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.



[il-antlr-interest: 32947] Re: [antlr-interest] ANTLRWorks Interpreter

2011-06-25 Thread Mike Kappel
I just downloaded ANTLRWorks and tried the example expression grammar.  I type 
in a simple expression into the Interpreter and see the generated parse tree.  
Fine.  I then load the SQL 2003 grammar and type in a simple Insert statement.  
I click the arrow and it never returns from Interpreting (Operation in 
progress).  Can ANTLRWorks handle a more complex grammar?

Dr. Michael R. Kappel
mkap...@appfluent.commailto:mkap...@appfluent.com


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
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-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.



[il-antlr-interest: 32948] Re: [antlr-interest] ANTLRWorks Interpreter

2011-06-25 Thread Bart Kiers
The interpreter is only suitable for very small grammars (without
predicates!). For more complicated grammars, use ANTLRWorks' debugger
instead.

Regards,

Bart.


On Sat, Jun 25, 2011 at 10:25 PM, Mike Kappel mkap...@appfluent.com wrote:

 I just downloaded ANTLRWorks and tried the example expression grammar.  I
 type in a simple expression into the Interpreter and see the generated parse
 tree.  Fine.  I then load the SQL 2003 grammar and type in a simple Insert
 statement.  I click the arrow and it never returns from Interpreting
 (Operation in progress).  Can ANTLRWorks handle a more complex grammar?

 Dr. Michael R. Kappel
 mkap...@appfluent.commailto:mkap...@appfluent.com


 List: http://www.antlr.org/mailman/listinfo/antlr-interest
 Unsubscribe:
 http://www.antlr.org/mailman/options/antlr-interest/your-email-address


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
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-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.



[il-antlr-interest: 32949] Re: [antlr-interest] ANTLR ActionScript target broken | ANTLR 3.3 fail to compile : antlr3-maven-archetype does not exist

2011-06-25 Thread Stefan
Since the ActionScript target is buggy, I tried to compile ANTLR 3.3.

Installed Maven, set the PATH, and followed the instructions to compile ANTLR.

While I actually can maven subproject like gunit, I fail to maven the ANTLR 
folder.
I mean the main pm.xml. Get this error:

   [ERROR] Child module /Users/KKK/Desktop/Neuer Ordner 4/antlr-3 
2.3/antlr3-maven-archetype 
of /Users/KKK/Desktop/Neuer Ordner 4/antlr-3 2.3/pom.xml does 
not exist

Part of the ANTLR distribution is antlr3-maven-plugin.

Since BUILD.txt states that building ANTLR is trivial, I wonder, I forgot to 
perform 
a trivial step ;-)

Could someone assist?

Stefan


Am 24.06.2011 um 00:50 schrieb Stefan:

 Thx Jim!
 
 Ah, I see. I'll try to contact the author
 
 I'd probably jump in and invest some days to reanimate the project. There are
 several problems, but all seem to be small and relatively easy fixable.
 
 Let's see. Installing the Maven Eclipse plugin right now ;-)
 
 Stefan
 
 
 Am 24.06.2011 um 00:29 schrieb Jim Idle:
 
 ActionScript has been orphaned as far as I can tell - you could try
 emailing the original author of that target and see if they have any plans
 to continue with it.
 
 Jim
 
 -Original Message-
 From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-
 boun...@antlr.org] On Behalf Of Stefan
 Sent: Thursday, June 23, 2011 2:48 PM
 To: antlr-interest@antlr.org
 Subject: [antlr-interest] ANTLR ActionScript target broken
 
 Hi,
 
 According to these instructions, I'm trying to use ANTLR generated *.as
 files in a current Flash Builder 4.5.1 project.
 
 Therefore, I added this ANTLR's Actionscript runtime to my project -
 without problems.
 
 I compiled lexer/parser specs using ANTLRWorks without problems too.
 
 I added the language option to the source *.g file to make ANTLR
 generate Actionscript sources:
 
 options {
   backtrack = true;
   memoize = true;
   k=2;
   output = AST;
   language=ActionScript;// Added this
   ASTLabelType = CommonTree;
 }
 Unfortunately, the ANTLR/ANTLRworks generated Actionscript code is
 buggy:
 
 Catch statements read like this catch (RecognitionException re), but
 should read like this:catch ( re:RecognitionException ).
 
 Furthermore, Flash Builder complains about the use of Array here:
 
 public override function get tokenNames():Array { return
 PhpParser.tokenNames; } Besides this, other problems exist in the
 generated ActionScript sources. E.g. wrong function declaration,
 package declaration inside package, ChartStream.getLine() called
 instead of ChartStream.line(),...
 
 I checked ANTLR itself too. But the pure JAR renders the same problem.
 Thus, ANTLRworks isn't the problem, but ANTLR itself.
 
 Assuming that I did everything correct, I wonder if and when the ANTLR
 project may provide a bug fix.
 
 Ah, hints how to make the current ANTLR work with ActionScript, would
 be even better ;-)
 
 
 Kinds regards,
 
 S
 
 List: http://www.antlr.org/mailman/listinfo/antlr-interest
 Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
 email-address
 
 List: http://www.antlr.org/mailman/listinfo/antlr-interest
 Unsubscribe: 
 http://www.antlr.org/mailman/options/antlr-interest/your-email-address
 
 
 List: http://www.antlr.org/mailman/listinfo/antlr-interest
 Unsubscribe: 
 http://www.antlr.org/mailman/options/antlr-interest/your-email-address


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
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-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.



[il-antlr-interest: 32951] Re: [antlr-interest] ANTLR ActionScript target broken | ANTLR 3.3 fail to compile : antlr3-maven-archetype does not exist

2011-06-25 Thread Jim Idle
Please send the full output and make sure you followed the instructions step by 
step with maven 2.x

On Jun 25, 2011, at 13:51, Stefan seaside...@me.com wrote:

 Since the ActionScript target is buggy, I tried to compile ANTLR 3.3.
 
 Installed Maven, set the PATH, and followed the instructions to compile ANTLR.
 
 While I actually can maven subproject like gunit, I fail to maven the ANTLR 
 folder.
 I mean the main pm.xml. Get this error:
 
   [ERROR] Child module /Users/KKK/Desktop/Neuer Ordner 4/antlr-3 
 2.3/antlr3-maven-archetype 
of /Users/KKK/Desktop/Neuer Ordner 4/antlr-3 2.3/pom.xml does not exist
 
 Part of the ANTLR distribution is antlr3-maven-plugin.
 
 Since BUILD.txt states that building ANTLR is trivial, I wonder, I forgot to 
 perform 
 a trivial step ;-)
 
 Could someone assist?
 
 Stefan
 
 
 Am 24.06.2011 um 00:50 schrieb Stefan:
 
 Thx Jim!
 
 Ah, I see. I'll try to contact the author
 
 I'd probably jump in and invest some days to reanimate the project. There are
 several problems, but all seem to be small and relatively easy fixable.
 
 Let's see. Installing the Maven Eclipse plugin right now ;-)
 
 Stefan
 
 
 Am 24.06.2011 um 00:29 schrieb Jim Idle:
 
 ActionScript has been orphaned as far as I can tell - you could try
 emailing the original author of that target and see if they have any plans
 to continue with it.
 
 Jim
 
 -Original Message-
 From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-
 boun...@antlr.org] On Behalf Of Stefan
 Sent: Thursday, June 23, 2011 2:48 PM
 To: antlr-interest@antlr.org
 Subject: [antlr-interest] ANTLR ActionScript target broken
 
 Hi,
 
 According to these instructions, I'm trying to use ANTLR generated *.as
 files in a current Flash Builder 4.5.1 project.
 
 Therefore, I added this ANTLR's Actionscript runtime to my project -
 without problems.
 
 I compiled lexer/parser specs using ANTLRWorks without problems too.
 
 I added the language option to the source *.g file to make ANTLR
 generate Actionscript sources:
 
 options {
  backtrack = true;
  memoize = true;
  k=2;
  output = AST;
  language=ActionScript;// Added this
  ASTLabelType = CommonTree;
 }
 Unfortunately, the ANTLR/ANTLRworks generated Actionscript code is
 buggy:
 
 Catch statements read like this catch (RecognitionException re), but
 should read like this:catch ( re:RecognitionException ).
 
 Furthermore, Flash Builder complains about the use of Array here:
 
 public override function get tokenNames():Array { return
 PhpParser.tokenNames; } Besides this, other problems exist in the
 generated ActionScript sources. E.g. wrong function declaration,
 package declaration inside package, ChartStream.getLine() called
 instead of ChartStream.line(),...
 
 I checked ANTLR itself too. But the pure JAR renders the same problem.
 Thus, ANTLRworks isn't the problem, but ANTLR itself.
 
 Assuming that I did everything correct, I wonder if and when the ANTLR
 project may provide a bug fix.
 
 Ah, hints how to make the current ANTLR work with ActionScript, would
 be even better ;-)
 
 
 Kinds regards,
 
 S
 
 List: http://www.antlr.org/mailman/listinfo/antlr-interest
 Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
 email-address
 
 List: http://www.antlr.org/mailman/listinfo/antlr-interest
 Unsubscribe: 
 http://www.antlr.org/mailman/options/antlr-interest/your-email-address
 
 
 List: http://www.antlr.org/mailman/listinfo/antlr-interest
 Unsubscribe: 
 http://www.antlr.org/mailman/options/antlr-interest/your-email-address
 
 
 List: http://www.antlr.org/mailman/listinfo/antlr-interest
 Unsubscribe: 
 http://www.antlr.org/mailman/options/antlr-interest/your-email-address

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
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-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.



[il-antlr-interest: 32953] Re: [antlr-interest] ANTLRWorks Interpreter

2011-06-25 Thread Douglas Godfrey
The SQL2003 grammar requires a 64bit OS and Java and 8GB of heap to run at
all.
See the comments at the beginning of the Sql2003Parser.g file.

On Sat, Jun 25, 2011 at 4:25 PM, Mike Kappel mkap...@appfluent.com wrote:

 I just downloaded ANTLRWorks and tried the example expression grammar.  I
 type in a simple expression into the Interpreter and see the generated parse
 tree.  Fine.  I then load the SQL 2003 grammar and type in a simple Insert
 statement.  I click the arrow and it never returns from Interpreting
 (Operation in progress).  Can ANTLRWorks handle a more complex grammar?

 Dr. Michael R. Kappel
 mkap...@appfluent.commailto:mkap...@appfluent.com


 List: http://www.antlr.org/mailman/listinfo/antlr-interest
 Unsubscribe:
 http://www.antlr.org/mailman/options/antlr-interest/your-email-address


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
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-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.