Dear Jim,
this is very helpful. Thank you!
Best regards,
Wei
On Wed, 1 Apr 2009, Jim Idle wrote:
> wei@uni-konstanz.de wrote:
> > Dear all,
> >
> > we are using ANTLR3 (ver. 3.1.3) to generate a Java parser using C target.
> > The generated code is supposed to be compiled with Visual Stud
Hi,
I'm having some trouble with the lexer looping forever on input that
should be possible to disambiguate in limited time. Not exactly sure why
this happens. It is definitely possible I have done something stupid in
my grammar, of course.
I've seen eternal looping before, for some construct
The problem is most likely your DecimalLiteral rule:
DecimalLiteral
:
;
Non-fragment lexer rules that can match no input will cause infinite loops.
This may only occur for certain input as other input will be matched
before ANTLR checks whether the troublesome rule can match. Having
input
Thomas Brandon wrote:
> The problem is most likely your DecimalLiteral rule:
> DecimalLiteral
> :
> ;
> Non-fragment lexer rules that can match no input will cause infinite loops.
> This may only occur for certain input as other input will be matched
> before ANTLR checks whether the troub
Hi,
Im a newbie to ANTLR. Im trying to build a translator from Microsoft
Intermediate Language (MSIL) to another intermediate language which is used
by one of the libraries which i wanted to use in my research project.
Currently i have the Grammar for MSIL (source language) and JIMPLE (Target
L
Thomas Brandon wrote:
> The problem is most likely your DecimalLiteral rule:
> DecimalLiteral
> :
> ;
> Non-fragment lexer rules that can match no input will cause infinite loops.
> This may only occur for certain input as other input will be matched
> before ANTLR checks whether the troub
Thomas Brandon wrote:
> The problem is most likely your DecimalLiteral rule:
> DecimalLiteral
> :
> ;
> Non-fragment lexer rules that can match no input will cause infinite loops.
> This may only occur for certain input as other input will be matched
> before ANTLR checks whether the troub
Hi!
When opening my (big) grammar in AntlrWorks, I usually tell java to use
as much memory as possible, such as (from commandline)
$ java -Xmx1g -jar antlrworks.jar
Maybe the different look&feel implementations have different memory
usage patterns, so one look&feel runs out of memory earlier
I'm trying to create tokens for the guards of C header files (with
filter=true), e.g. '#define __hello_h_' => , and have the following rules defined:
GUARD : '#' LETTER+ WS+ IDPART '_';
ID : IDPART;
WS : (' ' | '\n')+ {$channel = HIDDEN;};
fragment
IDPART :
Pete Siemsen wrote:
> I'm using the new ANTLR3 maven plugin described at
> http://www.antlr.org/antlr3-maven-plugin/
> . Thanks to Jim Idle!
>
> The new plugin has a minor "feature" that the older plugin also had.
> If I edit my grammar and do "mvn package", maven doesn't detect that
> the
Joseph Klumpp wrote:
> I'm trying to create tokens for the guards of C header files (with
> filter=true), e.g. '#define __hello_h_' => __hello_h_>, and have the following rules defined:
>
> GUARD : '#' LETTER+ WS+ IDPART '_';
> ID: IDPART;
>
> WS: (' ' | '\n')+ {$chann
Jim Idle wrote:
2. Is there a way to set the value of token GUARD to be just the
IDPART portion of the lexem?
GUARD : '#' LETTER+ WS idp=IDPART '_'
{ $text = $idp.text; } // Should work
;
Sorry - not enough tea yet - this shoudl be:
GUARD : '#' LE
Hi,
Perhaps this will sound like a rather stupid question, but I am wondering if
there is a better way to approach the problem I am trying to solve.
I am interested in parsing SQL. I have developed a grammar based on the
(overly complex) SQL2003 specification for my corpus (something like 1G
On Thursday 02 April 2009 10:27:27 am Jim Idle wrote:
> Joseph Klumpp wrote:
> > I'm trying to create tokens for the guards of C header files (with
> > filter=true), e.g. '#define __hello_h_' => > __hello_h_>, and have the following rules defined:
> >
> > GUARD : '#' LETTER+ WS+ IDPART
Thanks John and Jim - the explanation of IDPART needing two
interpretations (underscore vs. no underscore) makes perfect sense and
explains why hoisting the rule in works. Also, setText works like a
charm. John, you're correct about guards like __GUARD_H_ being only a
programming convention, but I
Hi folks,Tried to setup a testsuite for my tree grammar. The testsuite can be run (allthough all tests fail) via the normal org.antlr.gunit.Interp command butwhen I try to generate JUnit-Code for it I get an NPE: java -cp ../../../target/classes/:$CLASSPATH org.antlr.gunit.Interp -o Optimizer.tests
Hi Tilman,
Thanks for the bug report and the testing grammars. I'll check this issue later
today.
Regards,
Leon
On Thursday, April 02, 2009, at 09:28AM, "Tilman Bender"
wrote:
>Hi folks,
>
>Tried to setup a testsuite for my tree grammar. The testsuite can be
>run (allthough all tests fail)
Hi,
It looks like memoize at rule level doesn't work in composite grammar. I
get the error message '! memo array is null for ParserPart.g'.
'state.ruleMemo' is always null.
Also, it looks like this is a known issue. Has this been fixed or is
there a workaround?
I tried turning on mem
Hello,
I am new to ANTLR. I am looking for a very simple SQL statement like SELECT
and INSERT written in ANTLR grammar. I am also looking for the corresponding
lexer, parser, and the test file (which reads the lexer, parser files and
produces output). I saw the grammar *for PL/SQL*
http://www.antl
Ramakrishnan Venkataramani wrote:
> Hello,
> I am new to ANTLR. I am looking for a very simple SQL statement like
> SELECT and INSERT written in ANTLR grammar. I am also looking for the
> corresponding lexer, parser, and the test file (which reads the lexer,
> parser files and produces output).
Alexander,
The crux of what I say here:
http://www.jazillian.com/articles/treewalkers.html
is that as the amount of logic needed in your treewalker grows,
the ANTLR treewalker doesn't really help. You start off with
a few simple actions triggered at various points of treewalking,
but then it grow
Wow, Andy. So well-said.
Both about the difficulty of parsing C/C++ and the state of tree walkers.
It's so easy to shoot yourself in the foot using Antlr. It can simplify the
initial design when you're still figuring out what you want to do, but as
the codebase grows, you can be thinking it's re
Foust wrote:
> Wow, Andy. So well-said.
>
> Both about the difficulty of parsing C/C++ and the state of tree walkers.
> It's so easy to shoot yourself in the foot using Antlr. It can simplify the
> initial design when you're still figuring out what you want to do, but as
> the codebase grows, yo
I think antlr has a weird bug that forgets to give timeout error.
T
On Apr 1, 2009, at 7:40 AM, Ola Bini wrote:
> Terence Parr wrote:
>> Hi Ola! Hmm...try -Xconversiontimeout 10 on antlr and see if
>> things change.
>> Lemme know.
>> T
> OK, doing this seems to have fixed it. The other weird
Jevitha--
Take a look at the papers on converting Java byte code to JIMPLE (referenced in
the wikipedia article; also look at http://www.sable.mcgill.ca/soot/); that
will give you a handle on the analysis pass(es) you need to go through to map
data representations. Once you have mapped data re
Hi Tilman,
The main reason of the NPE is due to a syntax error in your Optimizer.testsuite
in which you should use "{tree-rule} walks {rule}:" for defining the test
target (tree grammar's rules). Try to modify "expr:" to "expr walks expr:" in
your testsuite, and it should work. You can also re
Hi Leon,
Augh! How could I be that blind. I also misinterpreted the "walks"
keyword as I thought adding it to the heading of the testsuite would
suffice.
Thank you very much for you help and keep on the good work with GUnit!
Tilman Bender
Student des Software Engineering
Hochschule Heilbronn
Hello!
I'm working with the C# target. I'm writing test cases for my parser. I
try to parse a collection of input files to verify that they all parse as
expected (later I'll probably also verify that erronous input fails to
parse, but that's for another day). I'm trying to use NUnit to manage th
Unless you are parsing a set of very very simple statments then the short
answer is no. There is no such thing as a simple grammar that can parse SELECT
and INSERT statements. The complexity is that practically anywhere you can
have a simple identifier (like a column name), you can have a comp
Hi,
I guess this is the problem Ter talks about in this mail:
http://marc.info/?l=antlr-dev&m=121174142722552&w=2
Wondering if this bug is fixed or is still there...
- Indhu
-Original Message-
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of
Hello list,
I am an academic working on a new compiler architecture. I've written a
number of compilers in the past in other languages, including JavaCC and
Lex/Yacc, and am pretty well versed in compiler theory, and thought that it
might be fun and interesting to try out ANTLR. As such, I've writ
Woops, I suppose I didn't say it. My target language is Java.
Andreas
--~--~-~--~~~---~--~~
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@googlegroups.com
I don't have ANTLR right now to test this. But guess it would work
NEWLINE: '\r'?'\n' {$channel = HIDDEN;};
Then write expression_statement rule like this:
expression_statement
:expression { NewLineBeforeNextToken( input.LT(1) ) }?=> /*nothing*/
;
And in the @
Here's a new one: My imaginary tokens aren't getting printable names now
unless I explicitly set them via a rule like this:
struct_or_union_specifier
: [...whatever...]
| lc='struct' IDENTIFIER -> ^(STRUCT[$lc, "STRUCT"] IDENTIFIER)
If in my calling program I do this:
As expected, there were some bugs :-) Here is a implementation that
works fine:
grammar Test;
@members{
private boolean newLineBeforeNextToken( int index ) {
Token tkn;
input = (DebugTokenStream) input;
while( inp
35 matches
Mail list logo