Dear Jim, I like your sense of humour! You'll probably be annoyed that I
already took the time read the book before I checked my email for your
message because I didn't think anyone would reply. I wasn't asking anybody
to read the manual, just if someone knew it off-hand. It would have saved me
ti
7;t find it "bunched together" as such.
Many thanks,
N
2009/10/26 Naveen Chawla
> Sorry if I sound rushed, I'm doing so many other things as well.
>
> Regards, N
>
> 2009/10/26 Naveen Chawla
>
> I can't open the "tpantlr-code" file in that archiv
Sorry if I sound rushed, I'm doing so many other things as well.
Regards, N
2009/10/26 Naveen Chawla
> I can't open the "tpantlr-code" file in that archive, for some reason. Can
> somebody give me, for example "a: 'hello'; ", just that single symb
he archive.
>
>
>
> The book has a very good explanation too.
>
>
>
> Cheers, Indhu
>
>
>
>
>
> *From:* antlr-interest-boun...@antlr.org [mailto:
> antlr-interest-boun...@antlr.org] *On Behalf Of *Naveen Chawla
> *Sent:* Saturday, October 24, 2009 9:11 AM
No, where?
Many thanks, N
2009/10/23 Terence Parr
> have you looked at the (free) code for both books?
> Ter
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send ema
I'd like to use all the features of ANTLR all the way up to StringTemplate
etc. for e.g. a translation, can someone give me the very simplest example
they possibly can, for a beginner, of a grammar, to an AST (very, very
simple) to using StringTemplate and then a translated output (with maybe a
"Tr
by an object (or two) but then
followed by a verbPhrase, discount the fact that there may be a complement
for that verb, otherwise act normally as though there might". It doesn't
handle two *objects* properly but I can easily do that now.
My entire English structure grammar is done
Yes, I alluded to that in another thread, "How to make a syntactic predicate
exit a rule completely". I am a beginner in this area, but I think that what
you said is true of syntactic predicates as well. I think it would make
ANTLR more powerful, if this feature existed (of not matching a rule if a
Afterwards, in the tree walk, determine whether the various
> combinations of clauses are correct, issue good errors here if not;
>
> 3) Generate code (or whatever it is you are doing) in the knowledge
> that it is all good from here.
>
>
>
> Jim
>
>
>
Ok, so even if all syntactic predicates have failed in a particular
rule, that rule is still included as "matched" in that analysis! Is this
true or are my tests wrong? This is not what I hoped. I was hoping that upon
complete failure of all syntactic predicates in a rule, the rule becomes
disregar
Thanks Indhu! This might help me a lot now.
2009/10/16 Indhu Bharathi
> Sustem.out.println will print in the output tab.
>
>
>
> *From:* antlr-interest-boun...@antlr.org [mailto:
> antlr-interest-boun...@antlr.org] *On Behalf Of *Naveen Chawla
> *Sent:* Friday, October 1
ark();} a {bFoundYet=false; i=input.index();} b?
{if(input.index()>i){bFoundYet=true;input.rewind(mark);} }
{bFoundYet==false}?=> ; //"mark" and "bFound" are my own variables,
already declared
Obviously something is wrong here and there may be a much, much simpler
System.out.println("a string") doesn't seem to output anything, and
Window.alert("a string") doesn't work.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email t
is only a hack for the specific problem you
> posted. Maybe your original problem can be solved in a more elegant way.
> Cases that require hacks of this kind are very rare and arises only while
> parsing some very obscure languages.
>
>
>
> Cheers, Indhu
>
>
>
>
at problem by turning off greedy. Grep for ‘greedy’ in the book or wiki.
>
>
>
> Cheers, Indhu
>
>
>
>
>
> *From:* antlr-interest-boun...@antlr.org [mailto:
> antlr-interest-boun...@antlr.org] *On Behalf Of *Naveen Chawla
> *Sent:* Wednesday, October 14, 2009 3:50
== A && input.LA(2) != B}?=>
>
>
>
> However, if you need that kind of syntactic predicate, then I suggest you
> may be approaching your problem incorrectly.
>
>
>
> Jim
>
>
>
> *From:* antlr-interest-boun...@antlr.org [mailto:
> antlr-interest-boun...@a
Ok, I've solved my particular problem using token lookaheads, but I was
wondering if there is a way of doing non-terminal symbol lookaheads in
semantic predicates?
2009/10/6 Naveen Chawla
> grammar x;
>
> x: a b;
>
> a: 'i' a? | c? 'j'; //
grammar x;
x: a b;
a: 'i' a? | c? 'j'; // Question, how would I write the semantic
predicates: if this "a" is followed by 'v1' choose the first alternative, if
not choose the second alternative
c: 'i';
b: 'v1' | 'v2';
--~--~-~--~~~---~--~---
you can safely
ignore it".
Thanks.
2009/10/3 Naveen Chawla
> To be clear, I want prepPhr to always belong to the last occuring 'Ving'
> (nounPhrase) before it (i.e. drinking-while-driving)
>
> 2009/10/2 Naveen Chawla
>
> Hi,
>>
>> I'm a little
be marked in red and you can check
> the “Syntax diagram” tab to graphically see the ambiguity.
>
>
>
>
>
> *From:* antlr-interest-boun...@antlr.org [mailto:
> antlr-interest-boun...@antlr.org] *On Behalf Of *Naveen Chawla
> *Sent:* Monday, October 05, 2009 7:44 PM
>
I wish "Decision can match input such as ... using multiple alternatives"
would show the whole phrase that raises the ambiguity, and not just the
token.
Is there an easy way to find this out?
Would it be easy for it to be introduced into ANTLR, or do I always have to
see only the token every time
If I do
(a ~b)=> a
meaning "take this alternative if you encounter an a when not followed by b"
I get a syntax error: unexpected token b
Is it the right syntax to use '~'?
N
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
To be clear, I want prepPhr to always belong to the last occuring 'Ving'
(nounPhrase) before it (i.e. drinking-while-driving)
2009/10/2 Naveen Chawla
> Hi,
>
> I'm a little bit stumped. You might find this easy. I'm trying to develop
> an English parser and have
Hi,
I'm a little bit stumped. You might find this easy. I'm trying to develop an
English parser and have come across a real ambiguity in English, on
which, for the time being, I just want to enforce simple right
associativity:
e.g. Recommending drinking while driving is dangerous.
(Is it referri
Thanks!
2009/10/1 Gavin Lambert
> At 01:24 2/10/2009, Naveen Chawla wrote:
>
>> Thanks so much! Yes, I tried complement: object object? coincidentally
>> just before I read your message and it worked. Good news is that in the real
>> grammar they ARE actually equivalent
o work on ANTLRWorks) Many
many thanks, N
2009/10/1 Gavin Lambert
> At 23:13 1/10/2009, Naveen Chawla wrote:
>
>> complement: indirectObject? object;
>>
>> indirectObject : nounPhrase;
>>
>> object : nounPhrase;
>>
>>
I am trying to write an English grammar with ANTLR and have simplified a
particular problem to a particular subset for your convenience. (I'm using
ANTLRWorks 1.3)
grammar predicate;
predicate : 'verb' complement?;
complement: indirectObject? object;
indirectObject : nou
27 matches
Mail list logo