Hi comunity;
Would like to know how do u specify in a template the possible
repetition of some part of it.
for example in that the instelseif and cond_elseif could apper 0..n times:
instif(cond,instif,instelseif,cond_elseif,instesle) ::= <<
if(){
}
else if(){
}
else{
}>>
Many thx
--
Maro
h.
cheers,
2009/8/21 Marwan Ajraoui :
> r : ID '#' {s = $ID.text; System.out.println("found "+s);} ;
>
> Tow alternatives
>
> 1. take out '#' from ur file.g
>
> or
>
> 2. Put it in ur input file. so it look like: b #
>
>
> U sho
r : ID '#' {s = $ID.text; System.out.println("found "+s);} ;
Tow alternatives
1. take out '#' from ur file.g
or
2. Put it in ur input file. so it look like: b #
U should read about how it works. Jim did send u a link.
cheers,
2009/8/19 Ha Luong :
> Dear all,
>
> I'd like to catch the e
Many thx,
--
Marouane
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Having Mygramar.Tokens I want to generate a tree gramar, but when i
genertated it does generate the same tokens with others integer values
as IDs.
Is that normal? Or there is something I'm missing. I think that the
integer IDs for a tokens should at least have the same value. I'm
having a missMat
Add to your rulecatch System.exit(1); That wiill look like:
@rulecatch {
catch (RecognitionException e) {
//throw e;
System.exit(1)
}
2009/8/16 Ha Luong :
> Dear all,
>
> I'd like to catch the RecognitionException object and exit the Recognizer
> upon First Error. I tried to use Bail.g
@rulecatch {
catch (RecognitionException e) {
//throw e;
}
2009/8/16 Ha Luong :
> Dear all,
>
> I'd like to catch the RecognitionException object and exit the Recognizer
> upon First Error. I tried to use Bail.g in antlr code examples, and disable
> "throw e" in it. The error doesn't pri
Hi people;
In case you want to generate a NameX tree grammar; How to specify
NameX.tokens to AntlrWorks so it takes all the tokens defined in a
lexer.
Thx,
--
Marouane
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/
s;
Cheers.
2009/8/15 Jim Idle :
> Sam Barnett-Cormack wrote:
>
> Marwan Ajraoui wrote:
>
>
> Hi everybody;
>
> Having this lexer rules, parsing the input doesn't recognize 'integer'
> as a type, only recognize types vector of integer as a token
Hi everybody;
Having this lexer rules, parsing the input doesn't recognize 'integer'
as a type, only recognize types vector of integer as a token like
integer[] or integet[][][].
CORCHE_CIERE:']';
CORCHE_ABRE: '[';
fragment ENTERO_T: 'integer';
ENTERO_V: ENTERO_T(CORCHE_ABRE CORCHE_CIERE)*;
-- Forwarded message --
From: Marwan Ajraoui
Date: 2009/8/14
Subject: Antlr Behavior! Why notifying sintactic errors in My tree
gramar where I'm cheking for Semantic errors ONLY.
To: antlr-inter...@antlr.org
Hi comunity;
When I'm runing the tree grammar I defined I
Hi comunity;
When I'm runing the tree grammar I defined I'm getting errors like
Error: mismatched input '[]' expecting FN_ID
So the it seems that it doesn't recognize ([])*. I 've already checked
the entry sintactically, so why antlr get confused?
What could be the problem, here is a part of m
Hi comunity;
When I'm runing the tree grammar I defined I'm getting errors like
Error: mismatched input '[]' expecting FN_ID
So the it seems that it doesn't recognize ([])*. I 've already checked
the entry sintactically, so why antlr get confused?
What could be the problem, here is a part of m
lost with so many options of use of this framework and considerably
poor documentation in proportion. That's the common problem of
opensource projects :-(
Cheers,
2009/8/13 Marwan Ajraoui :
> -- Forwarded message --
> From: Marwan Ajraoui
> Date: 2009/8/13
> Subj
-- Forwarded message --
From: Marwan Ajraoui
Date: 2009/8/13
Subject: How should I extend CommonTreeNodeStream? Do I need to change
my adaptor or something else?
To: antlr-inter...@antlr.org
Hi there;
I did define a customized node, extending a commonTree, defined an
adaptor
Hi there;
I did define a customized node, extending a commonTree, defined an
adaptor extending a CommonTreeAdaptor, for my semantic analysis.
I did extend as well CommonErrorNode;
And now myAdaptor look like:
public class BTLTreeAdaptor extends CommonTreeAdaptor{
@Override
publi
Hi there;
I did define a customized node, extending a commonTree, defined an
adaptor extending a CommonTreeAdaptor, for my semantic analysis.
I did extend as well CommonErrorNode;
And now myAdaptor look like:
public class BTLTreeAdaptor extends CommonTreeAdaptor{
@Override
pub
I think that altering code generation so catch-clauses get replace
with the action specified is the best aproach in my case:
@rulecatch {
catch (RecognitionException e) {
...
throw e;
}
}
Cheers,
Marouane
2009/8/3 Marwan Ajraoui :
> Hi there;
>
> I did define a custom
Hi there;
I did define a customized node, extending a commonTree, defined an
adaptor extending a CommonTreeAdaptor, for my semantic analysis.
Nevertheless, I'm getting a classCastException, when the parser find
the first sintax error.
The reason is that it can not cast CommonErrorNode to my cus
Hi there;
I did define a customized node, extending a commonTree, defined an
adaptor extending a CommonTreeAdaptor, for my semantic analysis.
Nevertheless, I'm getting a classCastException, when the parser find
the first sintax error.
The reason is that it can not cast CommonErrorNode to my cus
Divide and conquer, one thing is the fucionality of a syntax and
recognization rules and other diferent is the semantic.
Cheers,
Marouane
2009/8/3 Jeroen van Schagen :
> Hello,
>
> Currently I'm working on my first tree grammar after reading the definitive
> ANTLR reference. Personally I love
Hi there;
I did define a customized node, extending a commonTree, defined an
adaptor extending a CommonTreeAdaptor, for my semantic analysis.
Nevertheless, I'm getting a classCastException, when the parser find
the first sintax error.
The reason is that it can not cast CommonErrorNode to my cus
Hi,
Have look at this link:
http://www.temporal-wave.com/index.php?option=com_psrrun&view=psrrun&Itemid=56
ANTLR can build, a Tree graph for you, then you will have to add the
functionalities required to determine a control flow...
Salud,
Marwan
2009/5/14 Fernando Costa :
> Hi, I'm a newbie
Thanks a lot for ur help;
I'm using eclipse I did run a configuration of org.antlr.Tool passing
as an argument ${file_prompt} and "-lib dir" , didn't
work.
I ' ve also tried to put the token in the same directory then Tool, in
vain. So I've debug source code till i found where it does set the
na
Hi there;
I'm getting this error: cannot find tokens file
/file.tokens. I 've got the file .tokens in the same
directory of the my ".g". Where does Antlr look for the file token. Do
I need to set up enviremont variable ANTLR_home? Because I simply run
org.antlr.Tool passing the file as an argumen
StringTree());
}
} catch (RecognitionException e1) {
// TODO Auto-generated catch block
e1.printStackTrace
}
cheers,
Marouane
2009/5/8 Marwan Ajraoui :
> Thanks for your interest on the problem I 'm gett
rammar, i ' m getting the mentioned
before error message.
cheers and thanks,
Marouane
2009/5/8 Indhu Bharathi :
> Looks like you are parsing with empty input. What is the input you gave to
> the parser?
>
> Cheers, Indhu
>
> Marwan Ajraoui wrote:
>>
>> Hi th
, I get the mentioned error.
cheers and thanks again,
Marouane
2009/5/8 Michael :
> Am Friday 08 May 2009 11:58:00 schrieb Marwan Ajraoui:
>> Hi there;
>>
>> I'm getting a strange error form a parser. I have defined a grammar,
>> wich contains these rules;
>&
Hi there;
I'm getting a strange error form a parser. I have defined a grammar,
wich contains these rules;
decl_codigo : decl_libreria decl_program
decl_libreria : TAG_START_OPEN 'function_library' ':' FN_ID TAG_CLOSE
decl_funciones TAG_END_OPEN 'function_library' TAG_CLOSE;
decl_program : TA
Hi there;
I'm trying to get a scope of variables correspondant to method
declaration. but i'm geting this exception:
Exception in thread "main" java.util.EmptyStackException
at java.util.Stack.peek(Unknown Source)
at BTLParser.decl_var(BTLParser.java:462)
at BTLParser.ins
MANY THX; The problem is solved thanks to the information you gave me.
Kind regards,
Marouane
2009/5/4 Jim Idle :
> Marwan Ajraoui wrote:
>> Hi There;
>>
>> I'm currently defining a grammar for a based tag language using ANTLR;
>> The problem I'm facing is
MANY THX; The problem was solved.
Kind regards,
Marouane
2009/5/4 Michael Strelnikov :
> Try to add "fragment" prefix before "DIGITO"
>
> On Mon, May 4, 2009 at 10:49 PM, Marwan Ajraoui
> wrote:
>> Hi There;
>>
>> I'm currently defining
Hi There;
I'm currently defining a grammar for a based tag language using ANTLR;
The problem I'm facing is that a single digit doesn't match my defined
rule INTEGER, here is the definition I put (as i saw in The Definitive
guide of ANTLR):
DIGITO: '0'..'9' ;
INT : DIGITO + ;
This rule should ma
33 matches
Mail list logo