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

2011-06-14 Thread meena.subramanian
Hi All,

 

Currently I am using Antlr v3.1.1. Now I have upgraded it to Antlr v3.3
after that I am getting the following error while compiling my java
files with the latest version Antlr.

 

I am facing some compilation issues so not able to build. The error
message is given below,

 

UnexpectedException occurred: java.lang.NoSuchMethodError: 

Org.antlr.runtime.CommonTreeNodeStream.getNodeIndex(Ljava/lang/object;)
I

 At
*.expressoin.FocusCommonTreeNodeStream.getNodeIndex(FocusCommonTreeNodeS
tream.java)

 

Can you please suggest some solution for the above  problem?

 

Observation:

 

As per my analysis CommonTreeNodeStream.getNodeIndex(obj) method is
present till  Antlr jar v3.1.2 but the releases after this version, does
not contain the CommonTreeNodeStream.getNodeIndex(obj) method. So
obviously v3.3 does not contain the method getNodeIndex(obj) so it is
throwing  NoSuchMethodError.

 

Can you please clarify, is there any equivalent method available in the
v3.3 for getNodeIndex(obj) method?

 

Thanks in Advance!!!

 

Regards,

Meena.


Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email. 

www.wipro.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: 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, Jun 14, 2011 at 1:04 PM, meena.subraman...@wipro.com wrote:

 Hi All,



 Currently I am using Antlr v3.1.1. Now I have upgraded it to Antlr v3.3
 after that I am getting the following error while compiling my java
 files with the latest version Antlr.



 I am facing some compilation issues so not able to build. The error
 message is given below,



 UnexpectedException occurred: java.lang.NoSuchMethodError:

 Org.antlr.runtime.CommonTreeNodeStream.getNodeIndex(Ljava/lang/object;)
 I

  At
 *.expressoin.FocusCommonTreeNodeStream.getNodeIndex(FocusCommonTreeNodeS
 tream.java)



 Can you please suggest some solution for the above  problem?



 Observation:



 As per my analysis CommonTreeNodeStream.getNodeIndex(obj) method is
 present till  Antlr jar v3.1.2 but the releases after this version, does
 not contain the CommonTreeNodeStream.getNodeIndex(obj) method. So
 obviously v3.3 does not contain the method getNodeIndex(obj) so it is
 throwing  NoSuchMethodError.



 Can you please clarify, is there any equivalent method available in the
 v3.3 for getNodeIndex(obj) method?



 Thanks in Advance!!!



 Regards,

 Meena.


 Please do not print this email unless it is absolutely necessary.

 The information contained in this electronic message and any attachments to
 this message are intended for the exclusive use of the addressee(s) and may
 contain proprietary, confidential or privileged information. If you are not
 the intended recipient, you should not disseminate, distribute or copy this
 e-mail. Please notify the sender immediately and destroy all copies of this
 message and any attachments.

 WARNING: Computer viruses can be transmitted via email. The recipient
 should check this email and any attachments for the presence of viruses. The
 company accepts no liability for any damage caused by any virus transmitted
 by this email.

 www.wipro.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: 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
Yes, you're running it all with v3.3, but did you generate a new lexer and
parser from your grammar using v3.3?

Bart.


On Tue, Jun 14, 2011 at 1:43 PM, meena.subraman...@wipro.com wrote:

  Bart,



 Yes brat, I have did the following to use Antlr v3.3. (we are downloading
  the ANTLR jars from maven.)



 1.   I have changed my  *pom.xml* as below

 From :
dependency
 groupIdorg.antlr/groupId
 artifactIdantlr-runtime/artifactId
 version3.1.1/version
/dependency

   To :
 dependency
groupIdorg.antlr/groupId
artifactIdantlr-complete/artifactId
version3.3/version
 /dependency

  2.   Rename the jar FROM antlr-3.3-complete TO antlr-complete-3.3

 3.   Run the below maven command to install the local repository with
 the new jar.

 mvn install:install-file -DgroupId=org.antlr -DartifactId=antlr-complete
 -Dversion=3.3 -Dpackaging=jar -Dfile=local\Path\to\antlr-complete-3.3.jar

 *4.   *Run the below mvn command to compile: *mvn install
 -DskipTests=true*



 After following the above steps I got the below error:



 Build Failure : Compilation Error: NoSuchMethodError….and in the error
 message it clearly indicates 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
 NoSuchMethodError:CommonTreeNodeStream.getNodeIndex(obj) after upgrating
 ANTLR V3.1.1 to ANTLR v3.3



 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, Jun 14, 2011 at 1:04 PM, meena.subraman...@wipro.com wrote:

 Hi All,



 Currently I am using Antlr v3.1.1. Now I have upgraded it to Antlr v3.3
 after that I am getting the following error while compiling my java
 files with the latest version Antlr.



 I am facing some compilation issues so not able to build. The error
 message is given below,



 UnexpectedException occurred: java.lang.NoSuchMethodError:

 Org.antlr.runtime.CommonTreeNodeStream.getNodeIndex(Ljava/lang/object;)
 I

  At
 *.expressoin.FocusCommonTreeNodeStream.getNodeIndex(FocusCommonTreeNodeS
 tream.java)



 Can you please suggest some solution for the above  problem?



 Observation:



 As per my analysis CommonTreeNodeStream.getNodeIndex(obj) method is
 present till  Antlr jar v3.1.2 but the releases after this version, does
 not contain the CommonTreeNodeStream.getNodeIndex(obj) method. So
 obviously v3.3 does not contain the method getNodeIndex(obj) so it is
 throwing  NoSuchMethodError.



 Can you please clarify, is there any equivalent method available in the
 v3.3 for getNodeIndex(obj) method?



 Thanks in Advance!!!



 Regards,

 Meena.


 Please do not print this email unless it is absolutely necessary.

 The information contained in this electronic message and any attachments to
 this message are intended for the exclusive use of the addressee(s) and may
 contain proprietary, confidential or privileged information. If you are not
 the intended recipient, you should not disseminate, distribute or copy this
 e-mail. Please notify the sender immediately and destroy all copies of this
 message and any attachments.

 WARNING: Computer viruses can be transmitted via email. The recipient
 should check this email and any attachments for the presence of viruses. The
 company accepts no liability for any damage caused by any virus transmitted
 by this email.

 www.wipro.com

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



 * Please do not print this email unless it is absolutely necessary. *

 The information contained in this electronic message and any attachments to
 this message are intended for the exclusive use of the addressee(s) and may
 contain proprietary, confidential or privileged information. If you are not
 the intended recipient, you should not disseminate, distribute or copy this
 e-mail. Please notify the sender immediately and destroy all copies of this
 message and any attachments.

 WARNING: Computer viruses can be transmitted via email. The recipient
 should check this email and any attachments for the presence of viruses. The
 company accepts no liability for any damage caused by any virus transmitted
 by this email.

 www.wipro.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-interest: 32776] Re: [antlr-interest] minimalistic grammar approach

2011-06-14 Thread The Researcher
 Hi Arturo,

I would start with Compilers Principles, Techniques,  Tools by Aho, Lam,
Sethi, and Ullman a.k.a the Dragon Book. If you don't have it you really
should for a project of that level.

http://en.wikipedia.org/wiki/Compilers:_Principles,_Techniques,_and_Tools

Eric

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: 32777] [antlr-interest] Antlr, Errors, and the console

2011-06-14 Thread Andreas Stefik
Hey folks,

Simple question. I want to turn off the default behavior of reporting
lexer/parser errors to the console. The most obvious way I could think
was to just override a few methods:

@lexer::members {
public void reportError(RecognitionException e) { //override and do nothing
}
}

@members{
public void reportError(RecognitionException e) {
}
}

This seems to work. While I don't immediately see a problem in my
application (with limited testing so far), is there a different/easier
way I am supposed to be doing this? Will this cause potential problems
(perhaps antlr uses this internally for something important)?

Stefik

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: 32779] [antlr-interest] Parse guided by preceding input

2011-06-14 Thread Bob
With bison/flex the lexical analyzer pipelines tokens on demand to the
parser

as the grammar rules are processed.

 

It appears in Antlr (3) that lexical analysis tokenizes the input stream

before any grammar rules are activated.

 

By pipelining, it's possible to influence the parse from preceding input at 

the lexical level.

 

For example, an identifier rule ( 'a'..'z' )* can lookup

the string in a table built from grammar rules of preceding input and 

return either an identifier-token or a table-token to guide subsequent

rule activation.

 

If Antlr does not pipeline, the equivalent would have to be done

somehow in the grammar rules, not the lex rules.

 

Is there a way to do this?


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: 32780] Re: [antlr-interest] gunit failing on update to ANTLR 3.3

2011-06-14 Thread Simon Marchi
Ping !

On Mon, Jun 6, 2011 at 19:52, Terence Parr pa...@cs.usfca.edu wrote:
 hi guys. at a conference for another day or two. if no response this
 week, ping me!

 a simple grammar / gunit test that fails should yield a quick fix :)

 Ter
 On Jun 6, 2011, at 4:47 PM, Simon Marchi wrote:

 I also have experienced some strange behavior with gunit, although it
 is the first time I use it. I sent a message about this on May 20
 (http://www.antlr.org/pipermail/antlr-interest/2011-May/041650.html)
 and have seen one or two other on the same subject. I would really
 like a follow-up on this !

 Thanks,

 Simon

 On Mon, Jun 6, 2011 at 08:32, Jasper Floor jasperfl...@gmail.com
 wrote:
 Dear All,

 I have a small DSL for the company I work for. I have used gunit to
 make some tests. I also have my own tests next to this but operating
 on a higher level.

 I recently made a small change to the language and decided to update
 Antlr to the latest version.

 Unfortunately most of my (g)unit tests broke.

 The reason in one case is that the following test (the first test in
 the file for whatever that is worth):

 $1=#1; OK

 Does not return OK. The output says parsing stopped at character 4.
 Tracing through the generated junit code I found out that the return
 value is not OK but the AST. So the test should pass with OK.
 This isn't consistent however. Or rather. FAIL seems to work and
 some AST pass.

 All tests pass with antlr 3.2. They also pass my own test suite which
 tests at a higher level from gunit.
 This implies a problem with gunit.

 mvg,
 Jasper

 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: 32782] Re: [antlr-interest] minimalistic grammar approach

2011-06-14 Thread Arturo Hernandez

Hello everybody,
Here is an informal draft of the (minimalist) Implementation Independent 
grammar. It's not meant as a play grammar, but as a practical grammar to 
specify transformations that are easy to translate to commercial grade 
implemented languages. Object and unit support is conspicuously absent, not so 
exceptions. Any criticism, references, ect.. are very welcome.
The language used for description in this email is not relevant, I am just 
taking a shortcut to express the grammar.
type aaa integer;type sss record( aaa integer, bbb string);type xxx arrayof aaa 
index by ;
integer ccc;var sss;   //infer typeconst int ;
sss:=function(ref a, const b, c){};return ;
// pascal sugar inrecord xxx { .:=;}   //equivalent to xxx.:=;
procedure(a, b, c) {};exit;  //end proc
foreach item in collection {};foreach idx indexin collection {};for i is 1 to 4 
step 2 {};while (exp) {};break (exp); //exit loop
if (exp) {};else (exp) {};elsif (exp) {};case (a) { const: {} const: {} 
const: {} default: {}}  //a is an expression const are constants
throw excep ss; //ss is a variable
try {};
exception {};  // after a try blockexception (integer ex) {};exception (var ex) 
{};  // infer type
rethrow; // inside an exception block (benign if extra)
 From: arther...@hotmail.com
 To: antlr-interest@antlr.org
 Date: Tue, 14 Jun 2011 15:30:53 -0500
 Subject: Re: [antlr-interest] minimalistic grammar approach
 
 
 Sergiy and Researcher,
 Thanks for your answers.
 The twist in this case is that I want to get the grammar first and then the 
 language should be very easy. I have gathered the utility of having 
 semicolons, thanks for that.
 I would rather not start from scratch if I don't have to. I think I could 
 potentially find simple expression grammar in ANLTR.
 I'll be posting some beginning grammar later today.
 
 Arturo
 -- I want to be part of the code generation! --
 
 
  Date: Tue, 14 Jun 2011 22:58:16 +0300
  Subject: Re: [antlr-interest] minimalistic grammar approach
  From: sergiy.dubo...@gmail.com
  To: arther...@hotmail.com
  
  Hi,
  
  I usually start with examples of target language I want to develop.
  Write how to declare variables, structures, functions. Then identify
  terminals: strings, integers, floats, operators, identifiers, keywords
  and so on.
  I start from arithmetic expressions, they are quite tricky because of
  precedence. Then define boolean expressions, variable declaration,
  assignments, functions. This process is very iterative you can make it
  as complex as you wish. Use AntlrWorks, it can quickly run your
  grammar on test input, also it can show how AST will look like in
  debugger mode.
  
  It's much easier to start with a grammar which has ending symbol for
  each statement, in C it's ;. Ruby like grammars are more difficult
  (at least i spent several days figuring out how to make it working)
  because of new line which can be separator and whitespace.
  
  Can't promise this will work for you.
  
  br,
  Sergiy
  
  On Tue, Jun 14, 2011 at 8:23 PM, Arturo Hernandez arther...@hotmail.com 
  wrote:
  
   Hello everybody,
   I am making a spec for code generation that I am intending to use on my 
   own Information Systems development
   My first step is to create a minimalistic implementation independent (II) 
   grammar with support for record types, nested records, typed arrays, 
   function calls and basic loop and contol logic. Such that expressions in 
   a language that implemented this II grammar would be easy to translate to 
   any language. And also easier to manipulate.
   Hash arrays would also be supported and the typical collection loops. 
   Would also be supported.
   Does anyone here have any suggestions. Is there such a thing or close to 
   it already implemented in ANTLR.
  
   Any info will be greatly appreciated.
  
   Arturo-- Object orientation works by hiding data behind more complex 
   data. --
  
   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.