[il-antlr-interest: 30338] Re: [antlr-interest] very simple doubt about EXPR grammar

2010-10-14 Thread John B. Brodie
On Thu, 2010-10-14 at 21:18 -0300, Leonardo K. Shikida wrote: > here are some screenshots of what I am doing with ANTLR Works. > > not ok: http://img833.imageshack.us/img833/7586/noviable.png > > ok: http://img194.imageshack.us/img194/7260/viable.png > > so strange it only happens to the MINUS s

[il-antlr-interest: 30337] Re: [antlr-interest] very simple doubt about EXPR grammar

2010-10-14 Thread Leonardo K. Shikida
Hi John here are some screenshots of what I am doing with ANTLR Works. not ok: http://img833.imageshack.us/img833/7586/noviable.png ok: http://img194.imageshack.us/img194/7260/viable.png so strange it only happens to the MINUS sign. thanks Leo On Thu, Oct 14, 2010 at 5:17 PM, John B. Bro

[il-antlr-interest: 30336] Re: [antlr-interest] very simple doubt about EXPR grammar

2010-10-14 Thread John B. Brodie
Greetings! On Thu, 2010-10-14 at 09:31 -0300, Leonardo K. Shikida wrote: > Hi Kevin > > You´re right. So I´ve changed the grammar to include a stopword (semicolon). > > Still the same problem. > > 1-1+1; generates a NoViableAltException very strange... > > while > > 1+1-1; does not > > This

[il-antlr-interest: 30335] [antlr-interest] Building ANTLR

2010-10-14 Thread Jim Washburn
I'm able to build ANTLR from its source using git clone http://github.com/antlr/antlr.git and mvn -Dmaven.test.skip=true It looks to me like the above URL is the latest and greatest, "top of tree" code. That's because each time I have tried the above, I see a few small (and different ) compi

[il-antlr-interest: 30332] Re: [antlr-interest] How to get tokens to come out as (char *) types

2010-10-14 Thread Jim Idle
Don't do this. You will create lots of ANTLR strings that you don't need. Instead, when you want to use the text of the token, use the pointers in the token (start and end not start and length) and the knowledge of the input encoding and create the Cstring directly. The $text is just a convenience

[il-antlr-interest: 30330] Re: [antlr-interest] Building ANTLR C RUNTIME problem

2010-10-14 Thread Jim Idle
Also - do you have gmake installed and is that what your make is pointing to? Most other makes are broken. Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Amr Muhammad > Sent: Thursday, October 14, 2010 8:42 AM >

[il-antlr-interest: 30329] Re: [antlr-interest] Building ANTLR C RUNTIME problem

2010-10-14 Thread Jim Idle
Are you building from the tarball = you cannot build directly from perforce without the autoreconf stuff? You may need to update your autoconf programs and make sure you have libtool installed. Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- >

[il-antlr-interest: 30328] [antlr-interest] Building ANTLR C RUNTIME problem

2010-10-14 Thread Amr Muhammad
Hello, I want to build ANTLR C RUNTIME, but I am facing some problems, appreciate If you could help me with them: I am following the instructions described here http://www.antlr.org/api/C/index.html under (Building with Configure) i do the following: configure --enable-debuginfo and i get the

[il-antlr-interest: 30326] Re: [antlr-interest] C++0x Parser with ANTLR as a Tree Grammar

2010-10-14 Thread Jim Idle
This will work for all languages, but you have to make multiple passes until everything is resolved with something like C++. Perhaps using different tree walkers. Jim > -Original Message- > From: antlr-interest-boun...@antlr.org [mailto:antlr-interest- > boun...@antlr.org] On Behalf Of Ch

[il-antlr-interest: 30325] Re: [antlr-interest] antlr-c and llvm

2010-10-14 Thread Jim Idle
You are doing this the wrong way around. You want as little code as possible in your tree walker, just just want a set of API calls that your tree walker can make, where it passes pointers to trees and/or tokens. The API code is then I n a separate C file, and it is that C file that makes the LLVM

[il-antlr-interest: 30324] [antlr-interest] Grammar natural language

2010-10-14 Thread Dagi.Troegner
Hi everyone, I am looking for a simple grammar for natural language. In a first version just short simple sentences would be satisfying. Has anyone tried to formulated such a grammar already? Thanks a lot, Dagi Dagi Troegner Deutsch

[il-antlr-interest: 30323] Re: [antlr-interest] very simple doubt about EXPR grammar

2010-10-14 Thread Leonardo K. Shikida
Hi Kevin You´re right. So I´ve changed the grammar to include a stopword (semicolon). Still the same problem. 1-1+1; generates a NoViableAltException while 1+1-1; does not This is very strange because according to the rule expr : e=multExpr ( '+' multExpr | '-' mult

[il-antlr-interest: 30322] [antlr-interest] C++0x Parser with ANTLR as a Tree Grammar

2010-10-14 Thread Christopher Guntli
Hello   For a term project at the “University of Applied Science in Rapperswil” (Switzerland – www.hsr.ch) I am refactoring a C++0x parser written with ANTLR. The Parser uses lot of “inline” java logic to create the symbol table. As I read in your book “Language Implementation Patterns” there is a