[il-antlr-interest: 27680] Re: [antlr-interest] Running ANTLRWorks 1.3.1 -- javac error

2010-01-26 Thread Bart Kiers
Karljürgen, In order to run ANTLRWorks, you do not need 'javac', but 'java'. 'javac' is the compiler that will compile java source files into byte codes that the JRE (Java Runtime Environment) interprets/executes. 'java' is the application that executes the byte codes produced by 'javac'. Since

[il-antlr-interest: 27681] Re: [antlr-interest] Running ANTLRWorks 1.3.1 -- javac error

2010-01-26 Thread Bart Kiers
, Andreas Stefik, Ph.D. Assistant Professor Department of Computer Science Southern Illinois University Edwardsville On Tue, Jan 26, 2010 at 12:19 PM, Bart Kiers bki...@gmail.com wrote: Karljürgen, In order to run ANTLRWorks, you do not need 'javac', but 'java'. 'javac' is the compiler

[il-antlr-interest: 27782] Re: [antlr-interest] Noob question

2010-02-04 Thread Bart Kiers
Security http://www.ebasedsecurity.com/ You're either hardened or you're hacked! We Watch Your Website http://www.wewatchyourwebsite.com/ We Watch Your Website - so you don't have to. *From:* Bart Kiers [mailto:bki...@gmail.com] *Sent:* Thursday, February 04, 2010 6:29 AM *To:* Thomas

[il-antlr-interest: 27805] Re: [antlr-interest] Anyone have some good Python examples?

2010-02-05 Thread Bart Kiers
Thomas, I highly recommend *carefully* reading the book. Forgive me for saying, but I doubt that you actually read it. And if so, you could only have skimmed through it (you have ordered it only yesterday!). Regards, Bart. On Fri, Feb 5, 2010 at 10:23 PM, Thomas Raef

[il-antlr-interest: 27807] Re: [antlr-interest] Anyone have some good Python examples?

2010-02-05 Thread Bart Kiers
Thomas, Especially read the paragraph 'Element Labels' on page 95 carefully: that's what you need to print the part(s) you're interested in. Regards, Bart. On Fri, Feb 5, 2010 at 10:59 PM, Bart Kiers bki...@gmail.com wrote: Thomas, I highly recommend *carefully* reading the book. Forgive

[il-antlr-interest: 27810] Re: [antlr-interest] Anyone have some good Python examples?

2010-02-05 Thread Bart Kiers
It just occurred to me that the PDF version has different page numbering... My hard copy has 'Element Labels' on page 80. Also see the entire chapter 6 Attributes and Actions. Good luck! Bart. On Sat, Feb 6, 2010 at 7:20 AM, Bart Kiers bki...@gmail.com wrote: Thomas, Especially read

[il-antlr-interest: 27822] Re: [antlr-interest] Parse 1 - N repeats

2010-02-08 Thread Bart Kiers
Hi Adam, You could handle it in (plain) programming logic inside your grammar. Here's a little demo: grammar Test; @parser::members { public static void main(String[] args) throws Exception { String text = FIELD1\n+ REPEATING_GROUP fields=2 min=0, max=20\n+

[il-antlr-interest: 27981] Re: [antlr-interest] C# example of lexical filter mode ??

2010-02-18 Thread Bart Kiers
Hi John, On Thu, Feb 18, 2010 at 7:52 PM, John Pool j.p...@ision.nl wrote: ... Question: how do I 'execute' such a grammar lexer in C# without feeding it into a parser? You probably meant to instantiate a FuzzyLexer instead of a FuzzyParser (unless your lexer grammar is called

[il-antlr-interest: 27992] Re: [antlr-interest] Fwd: Mapping ANTLR grammar to XML

2010-02-19 Thread Bart Kiers
On Fri, Feb 19, 2010 at 5:13 PM, Ketan Maheshwari ketancmaheshw...@gmail.com wrote: ... For instance the following assignment statement : in = [t1 hyde%patient:mr hyde, t1 argan%patient:mr argan] is equivalent to the following xml: source name=in type=String array

[il-antlr-interest: 28087] Re: [antlr-interest] help: using antlr

2010-02-25 Thread Bart Kiers
On Thu, Feb 25, 2010 at 11:27 PM, Scott Stanchfield sc...@javadude.comwrote: ... See http://javadude.com/misc/astvis.mp4 for the basic idea (the stuttering is only due to the vid capture - the animation itself runs smoothly). Edgar and I are thinking of integrating this into ANTLR IDE once

[il-antlr-interest: 28142] Re: [antlr-interest] behaviour of lexer

2010-03-02 Thread Bart Kiers
On Tue, Mar 2, 2010 at 5:25 PM, Philippe Frankson philippe.frank...@frsglobal.com wrote: ... @int('444') is a function converting a string into integer. If I don't have parentheses, then it is not a function, it is only a column name. Ex.: @test, @integer, @in, Here is a part of lexer

[il-antlr-interest: 28143] Re: [antlr-interest] behaviour of lexer

2010-03-02 Thread Bart Kiers
On Tue, Mar 2, 2010 at 7:00 PM, Bart Kiers bki...@gmail.com wrote: On Tue, Mar 2, 2010 at 5:25 PM, Philippe Frankson philippe.frank...@frsglobal.com wrote: ... @int('444') is a function converting a string into integer. If I don't have parentheses, then it is not a function, it is only

[il-antlr-interest: 28217] Re: [antlr-interest] Unexpected behavior - Error?

2010-03-09 Thread Bart Kiers
is given here: http://www.antlr.org/pipermail/antlr-interest/2009-November/036719.html Best of luck! Regards, Bart. On 09.03.2010 15:04, Bart Kiers wrote: Hi Chris, Since the input ' .mine' does not contain any illegal tokens, the parser just stops parsing since (statement)* will also match

[il-antlr-interest: 28220] Re: [antlr-interest] MismatchedTokenException in simple grammar

2010-03-09 Thread Bart Kiers
FYI: http://stackoverflow.com/questions/2412440/antlr-mismatchedtokenexception-on-simple-grammar 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

[il-antlr-interest: 28276] Re: [antlr-interest] Grammar help

2010-03-16 Thread Bart Kiers
On Tue, Mar 16, 2010 at 4:54 AM, Brian Catlin bri...@sannas.org wrote: When I compile the grammar with ANTLR, I get the following: warning(149): Commands.g:0:0: rewrite syntax or operator with no output option; setting output=AST Hi Brian, The '!' and '^' are tree-rewrite operators, so

[il-antlr-interest: 28277] Re: [antlr-interest] Grammar help

2010-03-16 Thread Bart Kiers
On Tue, Mar 16, 2010 at 7:35 AM, Bart Kiers bki...@gmail.com wrote: On Tue, Mar 16, 2010 at 4:54 AM, Brian Catlin bri...@sannas.org wrote: When I compile the grammar with ANTLR, I get the following: warning(149): Commands.g:0:0: rewrite syntax or operator with no output option; setting

[il-antlr-interest: 28279] Re: [antlr-interest] Grammar help

2010-03-16 Thread Bart Kiers
On Tue, Mar 16, 2010 at 8:10 AM, Brian Catlin bri...@sannas.org wrote: While that gets rid of those warnings (why don't the warnings print a reasonable line number? I would call that a BUG), Note that the '!' is a valid operator inside your grammar, ANTLR just assumes that you're building

[il-antlr-interest: 28344] Re: [antlr-interest] Parse assignments and method calls

2010-03-23 Thread Bart Kiers
On Tue, Mar 23, 2010 at 2:56 PM, Damien Urruty lepila...@hotmail.comwrote: Hello I have been working on the Java grammar,... What is the Java grammar here? A ANTLR grammar you found on the net, or on one of ANTLR's wiki pages[1]? If so, you might want to tell which one (there's more than one

[il-antlr-interest: 28362] Re: [antlr-interest] Mutual left recursive problem

2010-03-25 Thread Bart Kiers
On Thu, Mar 25, 2010 at 9:19 AM, foxterri foxterri foxter...@hotmail.comwrote: Hi I have this left recursive problem which i cannot figure out how to solve and ANTLR WORKS cannot recognize the left recursive problem. There is no left recursive rule in the part of your grammar you posted.

[il-antlr-interest: 28367] Re: [antlr-interest] strange MismatchedTokenException

2010-03-25 Thread Bart Kiers
On Thu, Mar 25, 2010 at 10:00 AM, Simon zack simonz...@gmail.com wrote: hi, I'm new to antler tried writing a little grammer, but it tells me MismatchedTokenException when I interpret namespace_specification using the string: hello.world Then you start interpreting hello.world with the

[il-antlr-interest: 28372] Re: [antlr-interest] Lexer rule for strings with quoted strings within

2010-03-25 Thread Bart Kiers
On Thu, Mar 25, 2010 at 2:01 PM, Anders Sollander anders.sollan...@mathworks.de wrote: Hi, I've been trying to write a lexer rule for strings with strings in them, like This has a quoted string within Is there a simple lexer rule for this, or do I need some kind of look ahead?

[il-antlr-interest: 28373] Re: [antlr-interest] Lexer rule for strings with quoted strings within

2010-03-25 Thread Bart Kiers
On Thu, Mar 25, 2010 at 2:50 PM, Bart Kiers bki...@gmail.com wrote: On Thu, Mar 25, 2010 at 2:01 PM, Anders Sollander anders.sollan...@mathworks.de wrote: Hi, I've been trying to write a lexer rule for strings with strings in them, like This has a quoted string within

[il-antlr-interest: 28393] Re: [antlr-interest] (no subject)

2010-03-27 Thread Bart Kiers
On Sat, Mar 27, 2010 at 9:16 AM, Gouasmi Thouraya gthour...@yahoo.frwrote: Hello, I have to develop a tool which makes the generation of a specification in CSP-Z from a specification Z, It is possible to use your tool ANTLR to introduce the grammar of language Z and the grammar of language

[il-antlr-interest: 28433] Re: [antlr-interest] Empty complement set?

2010-03-31 Thread Bart Kiers
On Wed, Mar 31, 2010 at 11:47 AM, Anton Bychkov bychkov.an...@gmail.comwrote: ... There is also a strange thing in rule view, it looks like antlr does not see LParen and RParen in twiddle operator. I attached screenshot with it. Ah, I see. There are no other tokens than '(' and ')' defined,

[il-antlr-interest: 28434] [antlr-interest] Fwd: Empty complement set?

2010-03-31 Thread Bart Kiers
-- Forwarded message -- From: Bart Kiers bki...@gmail.com Date: Wed, Mar 31, 2010 at 12:01 PM Subject: Re: [antlr-interest] Empty complement set? To: antlr-interest@antlr.org On Wed, Mar 31, 2010 at 11:47 AM, Anton Bychkov bychkov.an...@gmail.comwrote: ... There is also

[il-antlr-interest: 28462] Re: [antlr-interest] posting

2010-04-01 Thread Bart Kiers
On Thu, Apr 1, 2010 at 11:05 AM, Kumar, Amitesh amitesh.ku...@standardbank.com wrote: Hi im trying to post to the antlr interest group but it seems I get bouced everytime Not any more: this one went through just fine. Regards, Bart. List:

[il-antlr-interest: 28466] Re: [antlr-interest] Syntax of rewrite rule

2010-04-01 Thread Bart Kiers
On Thu, Apr 1, 2010 at 1:21 PM, Christian Mayer christian.ma...@bsse.ethz.ch wrote: I am wondering how to transform the rewrite rule Expr: mul_expr ( ( PLUS | MINUS )^ mul_expr )*; Into the explicit form with the arrow Expr: a=mul_expr ( op=( PLUS | MINUS ) b=mul_expr )* -

[il-antlr-interest: 28567] Re: [antlr-interest] need some advice

2010-04-09 Thread Bart Kiers
On Fri, Apr 9, 2010 at 10:56 AM, Dietmar Schaefer dietma...@online.dewrote: ... DefSequence L { -- } works DefSequence L { A1200} gives me MismatchedTokenException: line 1:16 mismatched input 'A1200' expecting '\u0006' When stumbling upon the 'A' from 'A1200', the lexer tries to

[il-antlr-interest: 28550] Re: [antlr-interest] Non-determinism (was: Can I force a token to have precendence in the lexer?)

2010-04-21 Thread Bart Kiers
On Wed, Apr 21, 2010 at 2:41 AM, Andy Hull an...@sunrunhome.com wrote: Wow, thanks for the article. I was able to redefine the language to avoid the problem in order to keep the parser as simple as possible (now using to instead of ... ). My parser needs to be able to handle nested array

[il-antlr-interest: 28614] Re: [antlr-interest] VHDL Target

2010-04-26 Thread Bart Kiers
On Mon, Apr 26, 2010 at 10:02 PM, David Blubaugh davidblubaugh2...@yahoo.comhttp://us.mc1133.mail.yahoo.com/mc/compose?to=davidblubaugh2...@yahoo.com wrote: To All, Has anyone developed a VHDL target within ANTLR?? Hi, do you really mean a VHDL-target (being able to generate VHDL

[il-antlr-interest: 28747] Re: [antlr-interest] antlr doubt

2010-05-06 Thread Bart Kiers
On Thu, May 6, 2010 at 3:44 PM, Nishanth singh singh.nishan...@gmail.comwrote: ... This is the error I get when I try to compile: $ javac locoTokensLexer.java locoTokensLexer.java:3: package org.antlr.runtime does not exist import org.antlr.runtime.*; ^

[il-antlr-interest: 28877] Re: [antlr-interest] Custom lexer and parser constructors

2010-05-18 Thread Bart Kiers
, Bart Kiers. 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

[il-antlr-interest: 28890] Re: [antlr-interest] help please

2010-05-19 Thread Bart Kiers
/articles/antlr3xtut/ Kind regards, Bart Kiers. 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

[il-antlr-interest: 28951] Re: [antlr-interest] Java Target - How to Generate the Parser and Lexer at Runtime?

2010-05-22 Thread Bart Kiers
On Sat, May 22, 2010 at 1:33 PM, Sameh W. Zaky sameh...@gmail.com wrote: Greetings, I am still an ANTLR beginner.. I run a software where I generate the .g grammar file automatically. So I would love to know how to generate the lexer and parser at runtime given the .g file? When

[il-antlr-interest: 29095] Re: [antlr-interest] .* consuming all input

2010-06-03 Thread Bart Kiers
On Thu, Jun 3, 2010 at 11:09 AM, Oliver Zeigermann oliver.zeigerm...@gmail.com wrote: Hi, I am pretty sure wildcards are *greedy* by default and ... + and * are normally greedy, except when preceded by a DOT. From the Definitive ANTLR reference: *What you really want to type, though, and

[il-antlr-interest: 29296] Re: [antlr-interest] Noob Question

2010-07-02 Thread Bart Kiers
, you're still stuck, could you post the grammar? Is there a searchable archive I can trawl through? Yes: http://antlr.markmail.org/ Regards, Bart Kiers. List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email

[il-antlr-interest: 29728] Re: [antlr-interest] Filtering Java expressions

2010-08-07 Thread Bart Kiers
Forgot to reply to the entire group... On Fri, Aug 6, 2010 at 8:03 PM, Bill Andersen bill.ander...@mac.com wrote: Is there a good way to do a partial parse of Java code to pick out declarations (or any other structure). If it helps, I'm limiting this to pretty vanilla Java assignment and

[il-antlr-interest: 29813] Re: [antlr-interest] Using Own classes to recolect or parse the data withing the grammar

2010-08-12 Thread Bart Kiers
On Thu, Aug 12, 2010 at 7:10 AM, Victor Giordano power_gio...@yahoo.com.arwrote: ... The question is: How i can do this, without definig the class inside the @menbers section. That class, in fact, is one of my program.. so i only want to reuse that. ... Hi Victor, Define a class

[il-antlr-interest: 30345] Re: [antlr-interest] cretae the inverse of a rule

2010-10-15 Thread Bart Kiers
On Fri, Oct 15, 2010 at 3:39 PM, Remi Marechal remi.marec...@gmail.comwrote: if i create a rule like LETTER: 'a'..'z' ; With the '~' (tilde): NON_LETTER : ~LETTER ; Note that the negation only works on single characters (or lexer rules that match a single character). For example, you

[il-antlr-interest: 30355] Re: [antlr-interest] Tree grammar: How to handle rule arguments

2010-10-16 Thread Bart Kiers
On Sat, Oct 16, 2010 at 1:16 AM, Stephanie Balzer stephanie.bal...@gmail.com wrote: ... What is the meaning of id+= above? A java.util.List is defined at the start of the rule and all Identifier-tokens are added to it. Token id=null; List list_id=null; *// - !!!*

[il-antlr-interest: 30388] Re: [antlr-interest] Very high runtime and memory usage caused by trivial grammar = Is it my mistake?

2010-10-21 Thread Bart Kiers
On Thu, Oct 21, 2010 at 9:13 AM, Cremerius Ralf (DGS-EC/ECC3) ralf.cremer...@de.bosch.com wrote: ... SOMETOKEN : ('a')*; ... public static void main(String[] args) throws Exception { ANTLRStringStream input = new ANTLRStringStream(); problemLexer

[il-antlr-interest: 30778] Re: [antlr-interest] jar file changes in version 3.3?

2010-12-05 Thread Bart Kiers
Hi, On Sun, Dec 5, 2010 at 10:14 AM, Chao Wang chaowan...@gmail.com wrote: only an antlr-3.3-complete.jar file in the lib folder. The compiling failed with only this file in classpath. Can you post the stack trace? Can you post the grammar (assuming things go wrong when generating a

[il-antlr-interest: 30779] Re: [antlr-interest] jar file changes in version 3.3?

2010-12-05 Thread Bart Kiers
On Sun, Dec 5, 2010 at 11:21 AM, Chao Wang chaowan...@gmail.com wrote: here is the stack trace: localhost:output mac$ javac TLexer.java TParser.java Test.java Test.java:8: cannot find symbol symbol : constructor ANTLRFileStream(java.io.InputStream) location: class

[il-antlr-interest: 30928] Re: [antlr-interest] How work wih C# target?

2010-12-21 Thread Bart Kiers
with CSharp2. Regards, Bart Kiers. 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

[il-antlr-interest: 31170] Re: [antlr-interest] a range as single token?

2011-01-15 Thread Bart Kiers
On Sat, Jan 15, 2011 at 11:43 AM, fikin nikolai.fii...@gmail.com wrote: most likely this is obviously stupid question, pardon me in advance please. what exactly is wrong with this grammar? lines : line (NEWLINE line)*; line: '\u0020'..'\u007F'*; NEWLINE : '\r'?

[il-antlr-interest: 31172] Re: [antlr-interest] a range as single token?

2011-01-15 Thread Bart Kiers
i also noticed that following works just fine: lines : line (NEWLINE line)*; line: CHAR*; NEWLINE : '\r'? '\n'; CHAR: '\u0020'..'\u007F'; Yes, because you are now using the range operator inside a lexer rule (I presume you know the difference between

[il-antlr-interest: 31173] Re: [antlr-interest] a range as single token?

2011-01-15 Thread Bart Kiers
On Sat, Jan 15, 2011 at 1:23 PM, fikin nikolai.fii...@gmail.com wrote: right. is there a way to make the lexer provide line content as single token as opposing to a container of char tokens? Sure, like this: lines : CHARS (NEWLINE CHARS)*; NEWLINE : '\r'? '\n'; CHARS :

[il-antlr-interest: 31189] Re: [antlr-interest] Strangeness when parsing strings and spaces

2011-01-17 Thread Bart Kiers
On Tue, Jan 18, 2011 at 7:41 AM, Kevin Jackson foamd...@gmail.com wrote: Hi, I know that this is a problem with my lexer and I'm doing something stupid, but I have a problem with simple k,v pairs of the format: [String quoted string with spaces and non-alhpa chars] My grammar

[il-antlr-interest: 31241] Re: [antlr-interest] org.antlr.runtime.CommonToken cannot be cast to org.antlr.runtime.tree.Tree

2011-01-26 Thread Bart Kiers
On Wed, Jan 26, 2011 at 10:40 PM, Ching zchin...@gmail.com wrote: Can anyone tell me why I got this exception? My output is AST. Thanks. Err, that error is pretty self-explanatory: you're trying to cast a org.antlr.runtime.CommonToken to a org.antlr.runtime.tree.Tree, which is illegal. As you

[il-antlr-interest: 31371] Re: [antlr-interest] Partial grammar for class counting

2011-02-06 Thread Bart Kiers
Il 06/02/2011 17:04, Pavel Martynov ha scritto: Hi! with best regards, Pavel Martynov Answered here: http://stackoverflow.com/questions/4914073/partial-grammar-for-counting-class-count/4914224#4914224 as well.

[il-antlr-interest: 31387] Re: [antlr-interest] Unicode input

2011-02-08 Thread Bart Kiers
Hi, On Tue, Feb 8, 2011 at 11:18 PM, Alex Lujan a...@apption.com wrote: Im having an issue with parsing an input that contains unicode characters. This is the code Im using to test the parser (messageBytes is an array created by reading bytes from a binary file): private static void

[il-antlr-interest: 31402] Re: [antlr-interest] Ident with ending In or Out word

2011-02-10 Thread Bart Kiers
On Thu, Feb 10, 2011 at 6:08 PM, Roohul roohu...@yahoo.com wrote: Hi, I am working on a grammar which have some variables ending with In or Out which is treated as the connector between two components. I do not know how to handle this. For example: real abcIn real abcOut these are

[il-antlr-interest: 31408] Re: [antlr-interest] Ident with ending In or Out word

2011-02-11 Thread Bart Kiers
On Fri, Feb 11, 2011 at 2:27 PM, Roohul roohu...@yahoo.com wrote: Hi, This is my sample grammar.. this did not work.. another thing is that my variables and connectors both can have digits so I created Alpha : LETTER (LETTER | DIGIT)*; for this but it also give an error. The problem

[il-antlr-interest: 31417] Re: [antlr-interest] [SPAM] [SPAM] Re: [SPAM] [SPAM] Optional expression rule alternative

2011-02-11 Thread Bart Kiers
On Fri, Feb 11, 2011 at 7:04 PM, Olivier Lefevre lefev...@yahoo.com wrote: Great! Not to abuse but would you know in which section of The Definitive ANTLR Reference this mentioned? I couldn't find it. What is this syntax called? It's called a validating semantic predicate which is explained

[il-antlr-interest: 31448] Re: [antlr-interest] Own Tree Class

2011-02-14 Thread Bart Kiers
On Mon, Feb 14, 2011 at 6:50 PM, Filip Habr habr.fi...@seznam.cz wrote: Hello, can you help me somebody? I wrote ExpressionParser in ANTLR, which parse math expression to a tree. I was using CommonTree class as a target. Now I need to create my own tree class, because I have to create

[il-antlr-interest: 31476] Re: [antlr-interest] [begginer question] could somebody help me to see this simple grammar?

2011-02-16 Thread Bart Kiers
On Wed, Feb 16, 2011 at 9:18 AM, devdoer bird devdo...@gmail.com wrote: ... As you see, the last ')' is missed. So what's wrong with my grammar? Nothing. Given your grammar (and adding a `parse` rule to it): grammar T; parse : logicExp EOF {System.out.println(parsed :: +

[il-antlr-interest: 31710] Re: [antlr-interest] How to get the complete syntax tree

2011-03-03 Thread Bart Kiers
Hi, 2011/3/3 Juan Manuel Cámara juanm...@gmail.com ... The Parser works fine, but its return is a flat tree, all tokens are childs of the root. Is this the normal use? Can someone guess what I'm doing wrong, or tell me the way to get the complete tree? ... _You_ need to tell how the

[il-antlr-interest: 31722] Re: [antlr-interest] Tree grammar for expression subrules?

2011-03-04 Thread Bart Kiers
On Fri, Mar 4, 2011 at 6:53 PM, g...@novadsp.com g...@novadsp.com wrote: Is there a pattern to follow for creating tree grammars for subrules? // parser rule. this works. expression : (a=term - $a) ( ( '|' b=term - ^(OR $expression $b) | '|'- ^(OR

[il-antlr-interest: 31735] Re: [antlr-interest] Tree grammar for expression subrules?

2011-03-05 Thread Bart Kiers
On Fri, Mar 4, 2011 at 11:23 PM, g...@novadsp.com g...@novadsp.com wrote: On 04/03/2011 19:13, Bart Kiers wrote: I'd expect that to become the tree-grammar rule: expression : term | ^(OR expression term) | ^(OR expression EPSILON) ; Hello Bart Once

[il-antlr-interest: 31800] Re: [antlr-interest] #include mechanism for grammar files?

2011-03-13 Thread Bart Kiers
Hi Jerry,. On Sun, Mar 13, 2011 at 3:33 PM, g...@novadsp.com g...@novadsp.com wrote: Sorry! Must remember to post plain-text only. It would be useful to be able to #include a file in a grammar. use case: grammar is generated by another tool but the lexer definitions are not. i.e.

[il-antlr-interest: 31846] Re: [antlr-interest] problem with characters in grammar

2011-03-19 Thread Bart Kiers
On Sat, Mar 19, 2011 at 8:14 PM, Wojciech Tomasz Cichon wtcic...@googlemail.com wrote: i decided to extend my grammar for characters and i added: factor : '-'? (NUMBER ) | character ; character : AP (LETTER | NUMBER) AP; AP : '\''; LETTER : 'A'..'Z' | 'a'..'Z'; There's

[il-antlr-interest: 31944] Re: [antlr-interest] problems getting a simple grammar to accept it's input

2011-03-24 Thread Bart Kiers
On Thu, Mar 24, 2011 at 4:08 PM, Florian Franzmann siflf...@hawo.stw.uni-erlangen.de wrote: ... As I understand it the parser consumes 'Model' as IDENTIFIER and goes into state block. It ignores a WS, then finds a '{'. This should be recognized as BLOCK_BEGIN, which is the next token

[il-antlr-interest: 31988] Re: [antlr-interest] NPE at DefineGrammarItemsWalker.java:94

2011-03-28 Thread Bart Kiers
On Mon, Mar 28, 2011 at 5:58 PM, J. Talafous jtalaf...@gmail.com wrote: Why am I getting an NPE on the following test grammar? Thanks. I am having a hard time getting the @header into my grammar without getting a NPE error. What am I doing wrong? Thanks for the help. For ANTLR 3.x, the

[il-antlr-interest: 32031] Re: [antlr-interest] Fwd: F77 grammar

2011-03-31 Thread Bart Kiers
On Thu, Mar 31, 2011 at 9:24 AM, piet...@agh.edu.pl wrote: Hi, I have problem with running this grammar (downloaded from ANTLR website). Someone familiar with it? I'm not, but the first line of the grammar says: *Fortran 77 grammar for ANTLR 2.7.5. *So, my question to you is: are you

[il-antlr-interest: 32091] Re: [antlr-interest] Grammar not detecting stray syntax after certain valid blocks

2011-04-05 Thread Bart Kiers
This is enough to demonstrate the problem. When I create a program such as: state hello { } } The trailing close bracket is not detected as an error. http://www.antlr.org/mailman/options/antlr-interest/your-email-address Try to anchor it by adding an EOF at the end of your entry-rule:

[il-antlr-interest: 32151] Re: [antlr-interest] Interactive processing of input

2011-04-11 Thread Bart Kiers
On Mon, Apr 11, 2011 at 8:49 AM, NeoPhyte 20neophyt...@gmail.com wrote: Does ANTLR give me an option for interactive processing of input. ie Processing every line of input one by one From whatever I know till now, it starts processing after it encounters an EOF. Is there some way I can make

[il-antlr-interest: 32157] Re: [antlr-interest] Need pointers for getting comment statements in trees produced by v3 grammer files

2011-04-11 Thread Bart Kiers
On Mon, Apr 11, 2011 at 6:31 PM, The Researcher researcher0...@gmail.comwrote: Hi Ankit, If I understand the question correctly, then have you tried removing {$channel=HIDDEN;} from the lexer rule? i.e. LINE_COMMENT : '//' ~('\n' | '\r')* '\r'? '\n' {$channel=HIDDEN;} ; should

[il-antlr-interest: 32209] Re: [antlr-interest] v2-v3 Skip chars in Lexer?

2011-04-16 Thread Bart Kiers
On Sat, Apr 16, 2011 at 12:06 PM, Ruslan Zasukhin ruslan_zasuk...@valentina-db.com wrote: ... How to remove that quotes in v3? :-) Here's a way: DELIMITED @init { String q = null; } @after { String text = getText(); // remove the first and last quote, replace all 2

[il-antlr-interest: 32357] Re: [antlr-interest] Lexer too quick to grab a token?

2011-05-02 Thread Bart Kiers
On Mon, May 2, 2011 at 1:19 AM, Todd O'Bryan toddobr...@gmail.com wrote: ... Does this make any sense? Is there some way to deal with it? ... You could let '/]]' be matched in the 'R_TAG' rule and emit another token as per the instructions described here:

[il-antlr-interest: 32367] Re: [antlr-interest] Inserting missing nodes

2011-05-04 Thread Bart Kiers
On Wed, May 4, 2011 at 4:12 PM, Jean-Sebastien Vachon jean-sebastien.vac...@wantedtech.com wrote: No one can help me with this? :S Let me know if something is not clear. I need to fix this issue as soon as I can. Thanks The fact that you didn't provide the lexer rules (although they might

[il-antlr-interest: 32381] Re: [antlr-interest] Inserting missing nodes

2011-05-05 Thread Bart Kiers
: antlr-interest-boun...@antlr.org] On Behalf Of Bart Kiers Sent: May-04-11 10:21 AM To: antlr-interest@antlr.org Subject: Re: [antlr-interest] Inserting missing nodes On Wed, May 4, 2011 at 4:12 PM, Jean-Sebastien Vachon jean-sebastien.vac...@wantedtech.com wrote: No one can help me

[il-antlr-interest: 32385] Re: [antlr-interest] rules that takes rules as arguments

2011-05-05 Thread Bart Kiers
Both parser- and lexer rules can take parameters of any (Java) type. However, rules in ANTLR are translated to methods, and methods aren't first class objects in Java. So providing a rule (read: method) to another rule as parameter is not possible. Perhaps you can elaborate a bit and explain what

[il-antlr-interest: 32394] Re: [antlr-interest] Multiple Occurrence Read Out

2011-05-06 Thread Bart Kiers
Only at the end. You need to place the code-block *inside* the parenthesis like this: keysAndValues : ('' key '' value { // Some code to read the key(s) and value(s) out. System.out.println(key= + $key.text + , value= + $value.text); } )* ; Regards,

[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
tree. See: http://www.antlr.org/wiki/display/ANTLR3/Tree+construction or: http://stackoverflow.com/questions/4931346/how-to-output-the-ast-built-using-antlr Regards, Bart. On Mon, May 9, 2011 at 4:10 PM, Bart Kiers bki...@gmail.com wrote: I get the impression you think that when creating

[il-antlr-interest: 32430] Re: [antlr-interest] Geting all tokens from lexer / token stream

2011-05-11 Thread Bart Kiers
CommonTokenStream inherits getTokens() which returns a List of Tokens. You'll need to cast them to a Token (or something that extends a Token), since it's a non-generics List list: CommonTokenStream tokens = new CommonTokenStream(lexer); for(Object o : tokens.getTokens()) { Token t = (Token)o;

[il-antlr-interest: 32449] Re: [antlr-interest] Lexer code missing @header info

2011-05-13 Thread Bart Kiers
Hi David, The snippet: @header { package parser; import java.util.HashMap; } is short for: @parser::header { package parser; import java.util.HashMap; } You'll need to do the following as well: @lexer::header { package parser; import java.util.HashMap; } Regards, Bart. On Fri, May

[il-antlr-interest: 32479] Re: [antlr-interest] Parsing comment-like sequences of arbitrary characters

2011-05-18 Thread Bart Kiers
Hi Rajesh, Inside a parser rule, the `~` negates tokens, not characters. So if you have no lexer rule that tokenizes one of: '%', ''^' or '$', then ~SEMICOLON won't match any of such tokens/characters. Your grammar (with minor modifications): grammar Test; options { output=AST; } tokens {

[il-antlr-interest: 32481] Re: [antlr-interest] Fragment rules inside parser rules

2011-05-18 Thread Bart Kiers
Hi Ben, You cannot use fragment rules inside parser rules. So yes, you need to make LKU a normal token. If you don't want that (for whatever reason), you need to include the '' in the 'NAME' rule: NAME : '' ('a'..'z')+ ; Regards, Bart. On Wed, May 18, 2011 at 3:00 PM, Ben Corne

[il-antlr-interest: 32499] Re: [antlr-interest] Can't figure this one out

2011-05-20 Thread Bart Kiers
Hi David, Your parser does not handle: ans = 3 * (-x + y) * 4 properly since `ans` is an ANS-token and not an IDENT-token. Therefor it does not get matched by your `assignmentStatement` rule. Also, you should probably add the EOF at the end of your `script` rule in your combined grammar.

[il-antlr-interest: 32502] Re: [antlr-interest] AST Question

2011-05-20 Thread Bart Kiers
Hi Your rule: targetsExpr : category ('CAND' targetsExpr)* - ^('CAND' category targetsExpr*) ; is incorrect. You're always using `CAND` in your rewrite rule but that rule could just match `category` only. You'll probably want to do: targetsExpr : category ('CAND'^ targetsExpr)* ;

[il-antlr-interest: 32507] Re: [antlr-interest] AST Question

2011-05-20 Thread Bart Kiers
On Fri, May 20, 2011 at 9:54 PM, massimiliano.m...@gmail.com massimiliano.m...@gmail.com wrote: Hi, On Fri, May 20, 2011 at 10:55 AM, Bart Kiers bki...@gmail.com wrote: targetsExpr : category ('CAND' targetsExpr)* - ^('CAND' category targetsExpr*) ; is incorrect. You're always

[il-antlr-interest: 32513] Re: [antlr-interest] Collecting parameters

2011-05-21 Thread Bart Kiers
Hi David, Every root (or leaf) in the AST must be an instance of a ` org.antlr.runtime.tree.Tree`, so you can't create a node that is a `java.util.List`. By default, ANTLR creates its AST using `org.antlr.runtime.tree.CommonTree` objects which inherits the `getChildren()` method from

[il-antlr-interest: 32565] Re: [antlr-interest] question about antlr

2011-05-26 Thread Bart Kiers
Hi Patrick, I have a hard time understanding what it is you're trying to do. Instead of springing the entire grammar on us (or me), could you extract only those rules that are causing the problem(s)? And could you include some example input you'd like to match/parse? Regards, Bart Kiers

[il-antlr-interest: 32567] Re: [antlr-interest] Nasty LHS expression

2011-05-26 Thread Bart Kiers
Hi David, Can an `expr` match something that starts with `ID OPENP` and/or `ID GETS`? Perhaps you can post your entire grammar? Or at least the `expr` rule? Regards, Bart. On Thu, May 26, 2011 at 7:02 PM, David Smith david.sm...@cc.gatech.eduwrote: I am having a difficult time

[il-antlr-interest: 32609] Re: [antlr-interest] Do you need an ANTLR programmer?

2011-05-30 Thread Bart Kiers
On Mon, May 30, 2011 at 9:23 PM, ante...@freemail.hu wrote: On 5/30/2011 11:20 PM, Bart Kiers wrote: On Mon, May 30, 2011 at 9:13 PM, ante...@freemail.hu wrote: On 5/30/2011 10:41 PM, Bart Kiers wrote: Could you stop spamming the ANTLR mailing list please? Bart. You may not know

[il-antlr-interest: 32611] Re: [antlr-interest] options greedy : getting the tokens consumed during the greedy match

2011-05-30 Thread Bart Kiers
) == '*') { isJavaDoc = true; } } (options {greedy=false;} : . )* '*/' ; Regards, Bart Kiers. On Mon, May 30, 2011 at 8:08 PM, Vijay Raj call.vijay...@yahoo.com wrote: Hi - I am trying to parse a given java file, with a code fragment that consumes

[il-antlr-interest: 32612] Re: [antlr-interest] Do you need an ANTLR programmer?

2011-05-30 Thread Bart Kiers
On Mon, May 30, 2011 at 10:38 PM, Jim Idle j...@temporal-wave.com wrote: It always been OK, but there is obvious common sense involved, such as not posting such messages every week. For a start, I make a lot of my living writing professional ANTLR grammars and occasionally, you need to ask for

[il-antlr-interest: 32637] Re: [antlr-interest] Accentuated chars in brazilian portuguese

2011-06-01 Thread Bart Kiers
Hi Nilo, The grammar: grammar Brasil; parse : WORD EOF ; WORD : ('\u00c0'..'\u00ff' | 'a'..'z' | 'A'..'Z' | '-')+ ; parses the input não just fine in ANTLRWorks. I'm not really familiar with C#, but for those who are, could you perhaps post *how* you are testing it? (post a

[il-antlr-interest: 32660] Re: [antlr-interest] Any way to search the ANTLR interest archives?

2011-06-05 Thread Bart Kiers
Hi George, Sure, use Markmail: http://antlr.markmail.org/ http://antlr.markmail.org/Regards, Bart. On Sun, Jun 5, 2011 at 3:59 PM, George Spears geo...@woh.rr.com wrote: Hello, The ANTLR interest archives have a lot of valuable information in them..

[il-antlr-interest: 32685] Re: [antlr-interest] AST with optional parameters

2011-06-07 Thread Bart Kiers
Hi David, Try this: (ID GETS) = ID GETS expr SEMI? - ^(GETS ID expr SEMI?) Regards, Bart. On Tue, Jun 7, 2011 at 1:41 PM, David Smith david.sm...@cc.gatech.eduwrote: I'm parsing a grammar in which the semicolon on the end of a line is optional. So two of the statement rules might be:

[il-antlr-interest: 32697] Re: [antlr-interest] AST with optional parameters

2011-06-07 Thread Bart Kiers
Jim, From an earlier message, David wrote: *Yes, the language is Matlab and a semicolon on the end of an assignment expression suppresses display of the result of the assignment. ...* Bart. On Tue, Jun 7, 2011 at 6:30 PM, Jim Idle j...@temporal-wave.com wrote: Why do you want the SEMI in

[il-antlr-interest: 32703] Re: [antlr-interest] issue with antlr requiring a whitespace at a specific place

2011-06-08 Thread Bart Kiers
it to maximum (see first line of attached screenshot) However I see in my editor (antlrworks) in interpreter tab: Ignore rules: WHITESPACE. I wonder why, I did not ask for such ignore, and I do not see how to remove this. Maybe this occurs in generated code too. Olivier Le 6/8/11 12:58 PM, Bart

[il-antlr-interest: 32770] Re: [antlr-interest] Facing NoSuchMethodError:CommonTreeNodeStream.getNodeIndex(obj) after upgrating ANTLR V3.1.1 to ANTLR v3.3

2011-06-14 Thread Bart Kiers
Meena, You appear to be running a v3.1 lexer parser with the run-time classes from v3.3. On Stackoverflow I recommended you generate a new lexer and parser using ANTLR v3.3 (and compile them!) which you can then use with the ANTLR v3.3 runt-time classes. Did you do that already? Bart. On Tue,

[il-antlr-interest: 32771] Re: [antlr-interest] Facing NoSuchMethodError:CommonTreeNodeStream.getNodeIndex(obj) after upgrating ANTLR V3.1.1 to ANTLR v3.3

2011-06-14 Thread Bart Kiers
that *getNodeIndex(obj)* Method is missing. Thanks, Meena. *From:* Bart Kiers [mailto:bki...@gmail.com] *Sent:* Tuesday, June 14, 2011 4:38 PM *To:* Meena Subramanian (WT01 - Banking Financial Services) *Cc:* antlr-interest@antlr.org *Subject:* Re: [antlr-interest] Facing

[il-antlr-interest: 32844] Re: [antlr-interest] test release of antlr 3.4

2011-06-20 Thread Bart Kiers
The file `/META-INF/MANIFEST.MF` is missing the 'Main-Class' attribute. Add the line: Main-Class: org.antlr.Tool to the file (inside the JAR) and all should be OK. Regards, Bart. On Mon, Jun 20, 2011 at 6:28 PM, Julien BLACHE j...@jblache.org wrote: A Z asicaddr...@gmail.com wrote:

[il-antlr-interest: 32878] Re: [antlr-interest] Token Stream Rewriting

2011-06-22 Thread Bart Kiers
(...) is returning a String. Fabien. Le 22/06/11 00:36, Bart Kiers a écrit : Fabien, but what is the return type of this `merge(...)` method? Could you post the method? Or even better: post a SSCCE http://sscce.orgthat causes such an exception? Regards, Bart. On Wed, Jun 22, 2011

[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

[il-antlr-interest: 32978] Re: [antlr-interest] Someting about range (to change)

2011-06-28 Thread Bart Kiers
Hi Fabien, Can you post the grammar that produces the error? Bart. On Wed, Jun 29, 2011 at 5:57 AM, Fabien Hermenier hermenierfab...@gmail.com wrote: Hi I am sorry, but this is another problem related to sequence of integer. I don't understand my error(s), despite severals pass on the

[il-antlr-interest: 32989] Re: [antlr-interest] rule parameter question

2011-06-30 Thread Bart Kiers
Hi Mark, I presume you didn't see my answer on Stackoverflow: http://stackoverflow.com/questions/6529359/how-to-pass-commontree-parameter-to-an-antlr-rule ? If you did, is there anything that wasn't clear? Regards, Bart. On Thu, Jun 30, 2011 at 2:26 PM, Mark Truluck

  1   2   >