... Coming from a flex background, I thought the "multiple lexer" solution sounded too complex until I started using it. It's actually quite simple. If your...
I suggest you create a class or class hierarchy which does the "wrapping" or "helper generation", create context based instances as you parse, and pass...
Sigh, a newbie to ANTLR and compiler construction tools. I have a problem where I need to process a Java source file and generate some helper and wrapper...
Hi, we have the following problem In the .g file in lexer we have a rule called NAME like this NAME : ALPHA ( ALPHA | DIGIT )*; ALPHA : 'a'..'z39; | 'A'..'Z39;; ...
... I don't know of any problems, since switching was designed to happen in lexers. But I also haven't personally used switching much in my own code. Monty...
I am having a problem defining a Parser/Lexer combination that will allow me to detect custom tags in an HTML stream. The basic concept is, when a tag is...
Hi! Since my upgrade from 2.7.0 to 2.7.1a3, I'm getting compiler errors on HPUX with aCC 3.13.3, like: Error 108: "CondWalker.hpp", line 22 # Line number in...
... Yes, but the correct way is much easier. Create an istrstream and pass that to your lexer. Something like this: #include <strstream> string input("input to...
Hi, I'm generating C++ code with ANTLR, and would like to parse from a C++ string instead of a file. Can I create my own constructor in my lexer to do that? ...
Hi Ric and Terence, here comes another proposal for a feature that I would like to see in ANTLR 2.7.1: How about allowing the user to define default values for...
Here is my understanding - in this example, "TEST" gets converted to TEST by excluding the double quotes after which literal testing is performed using TEST...
Hello, the following grammar returns the error line 1: expecting STRING, found 'TEST' for the input TEST "TEST" If I don't exclude the '"39; in STRING, it works....
Hello! I have an application where I am going to be running multiple antlr-generated interpreters for messages each in its own theread. I did a grep on the...
This rule will be broken up into a number of rules based on the precedences of the operators. In the examples directory, java.g is a good place to start...
The 'README39; file says it exactly: In theory do: ... In practice, 'make' does not work correctly with Sun CC on Solaris. It uses flags like '-Wall39; which are...
heya to all, and sorry for jumping right in, but i'm currently stuck on a left factoring problem for a freeware project i'm working on, it's a scripting...
This one should be easy.... I would like to put all my generated java code into a single package. The package statement has to appear at the top of the java...
Hello! I am utilizing multiple lexers in my program and switching between them. How do I determine which one is currently active from the parser? Thanks for...
... send 'em to this list and to me. C++ bugs will be direct to Ric Klaren or Peter Wells. Thanks, Ter -- Chief Scientist, http://www.jGuru.com -- Your Java...
Hello! I am constructing a parser where I need to skip over the input for sections of the input. I do this by defining a dummy lexer with a single rule that...
Hello! I am writing a parser using antlr 2.1.1a4 and I would like to report line numbers on error messages. However, the parser always seems to report "error...
Folks, Ric Klaren made a number of C++ output fixes for ANTLR and included the contributed MSVC++ build defs and such. He puts some makefiles in there as well...
Hello! I dont know if this is a bug or a specificiation! Here is the problem: Here is a trivial grammar: class fooParser extends Parser; bar returns [ String s...
In the example java.g that comes with ANTLR, there is a comment in the statement rule about symbol tables. It notes that "ID DOT" is ambiguous at this point,...
Hello! I am working on a public domain (non-copyright) piece of code for which I am using antlr. For part of this project, I need an imbedded parser for mail...
Do take a look at my C/GCC parser on the antlr.org website. I suggest doing lots of little tests which print out the trees generated and inspect them ...