[il-antlr-interest: 25401] [antlr-interest] how to specify cardinality in templates

2009-08-22 Thread Marwan Ajraoui
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

[il-antlr-interest: 25382] Re: [antlr-interest] Couldn't catch the exception object at the last token in the rule

2009-08-21 Thread Marwan Ajraoui
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

[il-antlr-interest: 25381] Re: [antlr-interest] Couldn't catch the exception object at the last token in the rule

2009-08-21 Thread 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 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

[il-antlr-interest: 25301] [antlr-interest] Urgent: where i have to locate the mygramar.Tokens to generate Tree Gramar?

2009-08-18 Thread Marwan Ajraoui
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

[il-antlr-interest: 25299] [antlr-interest] Problems generating a tree gramar. It doesn't take in consideration the file.tokens.

2009-08-18 Thread Marwan Ajraoui
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

[il-antlr-interest: 25277] Re: [antlr-interest] Couldn't disable RecognitionException

2009-08-17 Thread Marwan Ajraoui
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

[il-antlr-interest: 25276] Re: [antlr-interest] Couldn't disable RecognitionException

2009-08-17 Thread Marwan Ajraoui
@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

[il-antlr-interest: 25275] [antlr-interest] How to specify NameX.tokens to AntlrWorks for generating a tree gramar

2009-08-16 Thread Marwan Ajraoui
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/

[il-antlr-interest: 25249] Re: [antlr-interest] Lexer rules

2009-08-15 Thread Marwan Ajraoui
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

[il-antlr-interest: 25246] [antlr-interest] Lexer rules

2009-08-15 Thread Marwan Ajraoui
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)*;

[il-antlr-interest: 25223] [antlr-interest] I get stuked; I don't know what to try. Fwd: Antlr Behavior! Why notifying sintactic errors in My tree gramar.

2009-08-14 Thread Marwan Ajraoui
-- 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

[il-antlr-interest: 25221] [antlr-interest] Antlr Behavior! Why notifying sintactic errors in My tree gramar where I'm cheking for Semantic errors ONLY.

2009-08-14 Thread Marwan Ajraoui
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

[il-antlr-interest: 25217] [antlr-interest] Why I'm getting syntax errors while I'm cheking for semantic errors?

2009-08-13 Thread Marwan Ajraoui
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

[il-antlr-interest: 25216] Re: [antlr-interest] There is any documetation I can check; Fwd: How should I extend Commo nTreeNodeStream?

2009-08-13 Thread Marwan Ajraoui
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

[il-antlr-interest: 25209] [antlr-interest] There is any documetation I can check; Fwd: How should I extend CommonTre eNodeStream?

2009-08-13 Thread Marwan Ajraoui
-- 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

[il-antlr-interest: 25208] [antlr-interest] Getting cast exceptions in generated code for customized tree

2009-08-13 Thread Marwan Ajraoui
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

[il-antlr-interest: 25196] [antlr-interest] How should I extend CommonTreeNodeStream? Do I need to change my adaptor or something else?

2009-08-13 Thread Marwan Ajraoui
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

[il-antlr-interest: 25007] Re: [antlr-interest] How to extend the CommonTree without getting a classcastexcpetion in the generated code?

2009-08-03 Thread Marwan Ajraoui
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

[il-antlr-interest: 25002] [antlr-interest] How to extend the CommonTree without getting a classcastexcpetion in the generated code?

2009-08-03 Thread Marwan Ajraoui
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

[il-antlr-interest: 24991] [antlr-interest] Extending a CommonTree

2009-08-03 Thread Marwan Ajraoui
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

[il-antlr-interest: 24988] Re: [antlr-interest] use of tree matching rules in tree grammar

2009-08-03 Thread Marwan Ajraoui
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

[il-antlr-interest: 24986] [antlr-interest] How to extend the CommonTree without getting a classcastexcpetion in the generated code?

2009-08-03 Thread Marwan Ajraoui
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

[il-antlr-interest: 23711] Re: [antlr-interest] Control Flow Graph

2009-05-14 Thread Marwan Ajraoui
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

[il-antlr-interest: 23676] Re: [antlr-interest] cannot find tokens file /file.tokens

2009-05-12 Thread Marwan Ajraoui
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

[il-antlr-interest: 23653] [antlr-interest] cannot find tokens file /file.tokens

2009-05-11 Thread Marwan Ajraoui
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

[il-antlr-interest: 23612] Re: [antlr-interest] Recursive not supposed behaivor when finding EOF

2009-05-08 Thread Marwan Ajraoui
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

[il-antlr-interest: 23610] Re: [antlr-interest] Recursive not supposed behaivor when finding EOF

2009-05-08 Thread Marwan Ajraoui
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

[il-antlr-interest: 23609] Re: [antlr-interest] Recursive not supposed behaivor when finding EOF

2009-05-08 Thread Marwan Ajraoui
, 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; >&

[il-antlr-interest: 23606] [antlr-interest] Recursive not supposed behaivor when finding EOF

2009-05-08 Thread Marwan Ajraoui
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

[il-antlr-interest: 23530] [antlr-interest] Problems with scoping (ID)*

2009-05-05 Thread Marwan Ajraoui
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

[il-antlr-interest: 23507] Re: [antlr-interest] Problems defining a simple Integer Match

2009-05-04 Thread Marwan Ajraoui
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

[il-antlr-interest: 23506] Re: [antlr-interest] Problems defining a simple Integer Match

2009-05-04 Thread Marwan Ajraoui
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

[il-antlr-interest: 23500] [antlr-interest] Problems defining a simple Integer Match

2009-05-04 Thread Marwan Ajraoui
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