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 grammar has changed. Maven says
What about chunking your input using some basic thing like a
StringTokenizer, then parse each paragraph separately?
Be aware that Wiki grammar is not a simple thing to parse.
c.
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-i
Hi,
Here is the Exceptions log and Stack Trace:
Exception in thread "Thread-7" java.lang.OutOfMemoryError: Java heap space
at java.util.HashMap.addEntry(HashMap.java:753)
at java.util.HashMap.put(HashMap.java:385)
at java.util.HashSet
I'm still struggling to get this working.
For example, a Wikipedia "title" looks like this:
STARTOFLINE == title text == WHITESPACE? EOL
There are a bunch of other control characters ('*', '<', etc...) as well that
can go into a title string. I need to be able to parse this:
ST
At 05:23 2/04/2009, Paul Bouché (NSN) wrote:
>I am doing this:
[...]
> // kind of a hack because tokenNames is final
> static {
> tokenNames[OL] = "'['";
> tokenNames[CL] = "'['";
You might want to double-check CL, unless that
was just an email typo.
List: h
Hi,
I have a language that can embed code snippet. For example the language can
look like this:
InvokeExternal("name"){
// the following code snippet will be send out
If(continue){
DoSomething("test");
}
}
The idea is to treat everything inside the Invo
Andy Grove wrote:
> I am using a subset of the token rewrite in Java actions called from
> the generated parser and I need to get the same functionality working
> in C. The Java code is using the following methods from the
> TokenRewriteStream class:
>
> public void insertAfter(int i, java.lang
Hello,
I am writing a lexer grammar with Antlr 3.1.3, and I've turned the filter
option turned on and I'm targeting Python. I tried to set the text of a
particular token calling self.setText in an action. The token I wanted to
change is changed, but every token in the stream after that point is
I am using a subset of the token rewrite in Java actions called from
the generated parser and I need to get the same functionality working
in C. The Java code is using the following methods from the
TokenRewriteStream class:
public void insertAfter(int i, java.lang.Object o)
public void rep
Tilman Bender wrote:
> Hi everybody,
>
> I am trying to make a simple compiler for a language that does simple
> arithmetic expression and read/write operations.
> I have a parser generating an AST. Now I would like to walk that AST
> an alter/rewrite it by removing superflous subtrees.
>
> e.g:
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 Studio 2008, and
> later used in a VC++ project.
>
> The grammar file that we used is Java 1.5 grammar for ANTLR v
Richard Thrippleton wrote:
Jim Idle wrote:
This may well be a safe point that I missed and I will look at it,
but I suspect it only works with your rule formulation.
Thanks.
It is not a good idea to use backtracking though unless your input is
always guaranteed
Hi everybody,
I am trying to make a simple compiler for a language that does simple
arithmetic expression and read/write operations.
I have a parser generating an AST. Now I would like to walk that AST
an alter/rewrite it by removing superflous subtrees.
e.g:
When I get a subtree for an addit
Jim Idle schrieb:
> Paul Bouché (NSN) wrote:
>
>> Hi,
>>
>> I would like to change the token names for error display.
>>
>> I used have this:
>> value : simpleValue | '{' property '}';
>> where a token type for the curly braces was created by ANTLR (T_XXX),
>> but if it was missing then in the
Jim Idle wrote:
> This may well be a safe point that I missed and I will look at it,
> but I suspect it only works with your rule formulation.
Thanks.
> It is not a good idea to use backtracking though unless your input is
> always guaranteed to be correct, as otherwise the ability to give
> good
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 Studio 2008, and
later used in a VC++ project.
The grammar file that we used is Java 1.5 grammar for ANTLR v3 written by
Terence Parr. We found it in
Richard Thrippleton wrote:
> Preamble/warning; I'm, yet again, doing disturbing and possibly
> undefined things with the C target ;-)
>
> The addition of the 'reuse' method on trees and the nilStack in the
> arboretum helped memory usage quite a bit in my parser, but we were
> still finding tha
Paul Bouché (NSN) wrote:
> Hi,
>
> I would like to change the token names for error display.
>
> I used have this:
> value : simpleValue | '{' property '}';
> where a token type for the curly braces was created by ANTLR (T_XXX),
> but if it was missing then in the error message a '{' was generate
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 thing is that the
first compile after a pull seems to work - while the rest fails. Even
when doing clean inbetween. Ve
Gavin Lambert wrote:
> At 00:02 2/04/2009, Sam Barnett-Cormack wrote:
> >However, k=*, it'll do whatever lookahead is needed, so there
> >isn't actually an ambiguity with LL(*). It would be silly to
> >left-factor, say:
> >
> >EVERY : 'every';
> >EACH : 'each';
> >EVENT : 'event';
> >
> >
At 00:02 2/04/2009, Sam Barnett-Cormack wrote:
>However, k=*, it'll do whatever lookahead is needed, so there
>isn't actually an ambiguity with LL(*). It would be silly to
>left-factor, say:
>
>EVERY : 'every';
>EACH : 'each';
>EVENT : 'event';
>
>Because it just makes it unreadable. ANTL
Devang Thakkar schrieb:
> Nothing happens when I press Ctrl-Break.
Start AW from the command prompt and press Crtl-Break (or Ctrl-C) in the
command prompt window once AW has frozen.
Johannes
>
> 2009/3/31 Terence Parr mailto:pa...@cs.usfca.edu>>
>
> Hi, can u print the stack trace when AW
Gavin Lambert wrote:
> At 09:45 1/04/2009, Ola Bini wrote:
> >> Looks like your lexer rules are ambiguous (which probably
> isn't
> >> helped by the fact that you're also using literals in your
> >> parser rules).
> >> You should definitely consider correcting your rules so that
> >> the amb
At 09:45 1/04/2009, Ola Bini wrote:
>> Looks like your lexer rules are ambiguous (which probably
isn't
>> helped by the fact that you're also using literals in your
>> parser rules).
>> You should definitely consider correcting your rules so that
>> the ambiguity warnings go away; doing that
At 20:57 1/04/2009, Emanuele Gesuato wrote:
>However i tried your solution, but i've got:
> [antlr] ANTLR Parser Generator Version 2.7.6
(2005-12-22)
>1989-2005
> [antlr] ..util/parser/SQL.g:54:30: This subrule cannot be
>inverted.
> Only subrules of the form:
> [antlr]
Preamble/warning; I'm, yet again, doing disturbing and possibly
undefined things with the C target ;-)
The addition of the 'reuse' method on trees and the nilStack in the
arboretum helped memory usage quite a bit in my parser, but we were
still finding that an awful lot of memory was being tak
Bruce Bauman wrote:
> In the sometimes bizarre dialect of Pascal I am using (MetaWare), the
> following is allowed:
>
> Odd := Even := 0;
It's also worth noting that in many languages this isn't considered to
be strange. You just evaluate the assignment operator right-to-left; the
value of a
Nothing happens when I press Ctrl-Break.
2009/3/31 Terence Parr
> Hi, can u print the stack trace when AW is frozen (CTRL-break on Windows I
> think)?
> Ter
>
> On Mar 31, 2009, at 10:52 AM, Devang Thakkar wrote:
>
> Hi,
>>
>> I am new to Antlr and AntlrWorks.
>>
>> I found that AntlrWorks fre
Hi,
I would like to change the token names for error display.
I used have this:
value : simpleValue | '{' property '}';
where a token type for the curly braces was created by ANTLR (T_XXX),
but if it was missing then in the error message a '{' was generated
because for that token in the Java t
Take a look at 'filter' mode of ANTLR lexer. This will let you skip text
you are not interested in.
Posting a more specific example of what you need might help.
Peter Bertok wrote:
>
>
>
> I'm working on a trivial embedded "wiki" style content management
> system for a web project, and I'm tr
How about something like this?
r:(ID EQ)+ INTLIT SEMICOLON -> ^(ASSIGN ID INTLIT)+
;
So, for your example, this will create two subtrees with ASSIGN as root.
The tree generated will be ^(nil ^(ASSIGN Odd 0) ^(ASSIGN Even 0))
And then you can write string template in the tree walker
Sam Barnett-Cormack wrote:
> Ola Bini wrote:
>> Gavin Lambert wrote:
>>> At 02:44 1/04/2009, Ola Bini wrote:
I have a grammar that works well with several different Java 5 and
Java 6 environments on both Windows, Linux and MacOS X (including
SoyLatte). But I've just got a bug repor
I'm working on a trivial embedded "wiki" style content management system for a
web project, and I'm trying to design an ANTLR grammar for it, but I'm getting
stuck.
How does one write a grammar that can match a variety of rules, including
things like nested brackets and the like, but if it can
Gavin Lambert wrote:
> At 21:54 30/03/2009, Emanuele Gesuato wrote:
> >What if i want to maintain as inalterate as possibile the original
> >STRING ?
> >
> >STRING : "'"((JOLLY)?(PAROLE|INTEGER)(JOLLY)?)"'";
> >
> >Is it possible to change it to something similar to
> >
> >STRING : "'"((JO
Michael Bedward schrieb:
> OK, a with a bit more delving I found the problem was caused by the
> CommonTreeNodeStream stream being emptied after the first run of the
> tree walker, so calling reset didn't achieve much. This differs from
> ANTLR 3.1.1 behaviour but doesn't seem to be in the releas
Bruce Bauman wrote:
> In the sometimes bizarre dialect of Pascal I am using (MetaWare), the
> following is allowed:
>
> Odd := Even := 0;
>
> I need to split this into:
>
> Odd := 0;
> Even := 0;
>
> Can somebody point me in the right direction?
I have a feeling it might be easier to bre
Ola Bini wrote:
> Gavin Lambert wrote:
>> At 02:44 1/04/2009, Ola Bini wrote:
>>> I have a grammar that works well with several different Java 5 and
>>> Java 6 environments on both Windows, Linux and MacOS X (including
>>> SoyLatte). But I've just got a bug report that it blows up on
>>> OpenJDK
37 matches
Mail list logo