Hi,
I am working on a small textual DSL which is kind of a small subset of Java in
the sense it has only relational, conditional, arithmetic operations which are
very much like those in Java.
I have just learnt the basics of ANTLR (skimmed thru the definitive guide. It's
brilliant!!!) and wrote
I am playing with the RandomPhrase feature in antlr to generate random
phrases based on a grammar. Infact I took the Expr grammar on antlr
website to try out this feature. Firstly I had to bump up the heap size
to more than 512mb to get any output from the program. After that I did
get a few expre
At 04:58 22/07/2009, LuÃs Reis wrote:
>Hello, I had a grammar written in Antlr 3 and I
>am getting EarlyExitExceptions.
>This grammar attempts to match things like:
>
>"[1..3]", "[ 1 .. 3]", "[ 1 .. x ]", "[x..1]", etc.
>
>However, when provided "[1..3]", it exits with
>an EarlyExitException.
EARN MONEY $1000-25000 PER MONTH
TAKE SIMPLE ONLINE SURVEYS
CREATE FREE ACCOUNT OTHER DETAILS
LOG ON TO
** **
**
http://www.AWSurveys.com/HomeMain.cfm?RefID=rubyraj
**
That's correct. Unless I reverted at some point, the C# port of ANTLR
generates code for the Java target the same way (it has a very slightly
altered template). The Java version of the tool allows but ignores the
public, protected, and private rule modifiers. All I did was implement
their support.
You are acumuating the tokens, which is fine but in the template you
need
Or create the template manually and set the formal parameter as you go.
$st = %identifierList();
Etc...
Jim
On Jul 21, 2009, at 5:33 AM, Vincent Dupuis
wrote:
> Hi,
>
> I need help on how to rewrite a rule to a fi
ST calls toString on the token list.
}>
is probably more what you want
T
On Jul 21, 2009, at 8:33 AM, Vincent Dupuis wrote:
> Hi,
>
> I need help on how to rewrite a rule to a fill a template with a
> list of tokens.
>
> The rule:
>
> identList
> : i+=IDENT (',' i+=IDENT)*
> -> iden
Hello, I had a grammar written in Antlr 3 and I am getting
EarlyExitExceptions.
This grammar attempts to match things like:
"[1..3]", "[ 1 .. 3]", "[ 1 .. x ]", "[x..1]", etc.
However, when provided "[1..3]", it exits with an EarlyExitException.
line 1:3 required (...)+ loop did not match anythi
Hi,
I need help on how to rewrite a rule to a fill a template with a list of tokens.
The rule:
identList
: i+=IDENT (',' i+=IDENT)*
-> identifierList(identifiers={$i})
;
returns:
[...@17,102:106='ident1',<4>,10:1...@19,109:112='ident2',<4>,10:24]
when using in a template group.
Dmitiry Nagirnyak wrote:
> Hi Nick,
>
> All these things are options.
> But it seems there's no way to dynamically choose rules in ANTLR. Right?
Well, gated semantic predicates can be used to do that.
I'm not sure that really helps here, though, or would be any simpler than
Nick or Stephen's solu
You are right Ben, thanks
--
Elnur Cabarov
--~--~-~--~~~---~--~~
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
To unsubscribe from this
Yes, it helped, thank you,
though I seem that generated code must be maximum similar between target
languages, especially between so alike Java and C#
On Tue, Jul 21, 2009 at 12:42 AM, Gavin Lambert wrote:
> At 01:31 21/07/2009, Elnur Cabarov wrote:
>
>> I use Antlr executable by Sam Harwell, bu
Hi Nick,
All these things are options.
But it seems there's no way to dynamycally choose rules in ANTLR. Right?
Like I posted on 15 Jul.
Anyway, thanks everybody for the help.
Cheers.
2009/7/21 Nick Vlassopoulos
> Hi Dmitiry,
>
> Maybe you're looking for something like the following then?
>
>
If you execute:
java -cp antlr-3.1.2.jar org.antlr.Tool MyGrammar.g3
everything works fine. but if you execute:
java -cp antlr-3.1.3.jar org.antlr.Tool MyGrammar.g3
nothing happens, no Java files are produced, no error
messages are printed. Though it does complain
if the grammar contains error
14 matches
Mail list logo