Hi, How to get line number, which says token of AST node belong to that line. with regards, Hitesh. __________________________________ Do you Yahoo!? The New...
... In java this should work in C++ I just now see that something wasn't ported over from java mode. If the exception is generated by the match method of the...
Hi, did anyone try to use ANTLR for the current XPath 2.0 grammar? Did it work? Or has it to be transformed to an LL(k) grammar first? If the later is true: Is...
9528
jagad
jagad@...
Oct 1, 2003 1:20 pm
Hi All, I have simple parser like this one; //***** Parser ***** class MyParser extends Parser; goal : exprList SEMI EOF; exprList : expr (COMMA expr);...
Perhaps you are never sending EOF. Is the input a file or from the command line? Try it from a file. Monty ... From: jagad [mailto:jagad@...] Sent:...
9530
jagad
jagad@...
Oct 1, 2003 1:33 pm
The declaration: exprList : expr (COMMA expr); should be exprList : expr (COMMA expr)*; and my problem still exist, anybody could give me the ligth? TIA ...
9531
jagad
jagad@...
Oct 1, 2003 1:41 pm
Hi Monty, Thanks for your fast response. BTW, the parser still stuck even I use the file as input. When I try with input: (1+2),(1+3); NUM_INT term PLUS ...
Run antlr.Tool with -traceParser and then run your parser again and see what it is doing. Take a look at the generated source code, it's pretty easy to read...
9533
jagad
jagad@...
Oct 1, 2003 1:54 pm
I use -parserTrace and try input: (1+2),(1+3); ... ( ... NUM_INT < factor; LA(1)==+ term < term; LA(1)==+ ... PLUS < addOp; LA(1)==2 ... NUM_INT < factor;...
... Hmmm you are calling the goal rule I hope? And not MyParser.expr() ? Or did you cut out the traces for goal and exprList ? Cheers, Ric -- ... Before they...
9535
jagad
jagad@...
Oct 1, 2003 2:14 pm
Hi Ric, Yes, I call MyParser.expr() and No, I don't cut out, the whole result it's just like I sent. Here my snippet: #include "parser/MyParserLexer.hpp" ...
See that parser.expr()? That's where you are calling the expr rule at the top level. Sounds like you really want to be calling parser.goal(). Good catch,...
9537
jagad
jagad@...
Oct 1, 2003 2:19 pm
Gotcha! :) I use "expr" at my xxx.g file! Thanks Monty, I'll fixed it and see how it goes Best Regards jagad...
9538
jagad
jagad@...
Oct 1, 2003 2:23 pm
Hi Monty and Ric, Thanks, now I realize that I should call goal() :) The problem is gone :) everything is works. Best Kindest Regards jagad...
9539
jagad
jagad@...
Oct 1, 2003 4:51 pm
Hi All, I have lexer with conflicting declaration like this: MOD : "MOD" IDENT : ('a'..'z39; | 'A'..'Z39;) ('a'..'z39; | 'A'..'Z39; | '0'..'939;)* How to solve the...
Hi, Iam looking for parsing which can parse an input java source code.I mean the parser should read the source code and identify the variable names and types...
Look in the documentation about literals. Monty ... From: jagad [mailto:jagad@...] Sent: Wednesday, October 01, 2003 10:02 AM To: ANTLR Milis Subject:...
9542
jagad
jagad@...
Oct 1, 2003 5:53 pm
Hi All, I've try with : tokens{ MOD = "MOD"; } IDENT : ('a'..'z39; | 'A'..'Z39;) ('a'..'z39; | 'A'..'Z39;|'0'..39;9')* it seems okay. Then I try with another...
9543
jagad
jagad@...
Oct 1, 2003 6:08 pm
Hi Again Monty, Yes, it documented in Literal section. My declaration should be: options{ k=3} <--- this is the key :) tokens{ MOD = "MOD"; } IDENT :...
ANTLR resolves this for you automatically by putting all string literals in the parser and lexer definitions (such as "MOD" in this case) in to a special...
See the cross referencing headstart in the file sharing area. Terence ... -- Professor Comp. Sci., University of San Francisco Creator, ANTLR Parser Generator,...
Hi Terence, I did look into that already but can you please give me some tips on how to run it and use it to achieve my task.I mean read a java file parse it...
Hi Suma, I assume you can "Tool" a grammar using antlr. I assume you understand the role of the Main.java file in "running" the grammar. If you don't ...
Hello there. I downloaded Ric's modified ANTLR 2.7.2, dated 2003-09-11, and am trying to compile the cpp runtime to a dll with MSVC 7.0. I followed the ...
I'm sorry, this was resolved as soon as I changed my projects compilation to use a Multithreaded DLL runtime. That left me with other problems, now, the "if...
... Hi Hitesh! The key is this: in ANTLR, AST nodes are completely different from tokens. ASTs are (normally) instances of antlr.CommonAST, while tokens are...
Allright, I think I've found the source of that assert-failure. In my lexer, I have a rule for a keyword: STADVAER : "stašvęr"; The problem here seems to be...
... wrote: ... int, ... is ... tries to ... expected ... it ... This looks more like a signed versus unsigned character problem. As a signed "char", 0xf0 is...
I'm new to antlr. And trying to learn antlr and prepare the grammar for TL1, a language used in North America for all Telecom equipment. Hence when I get it,...
ANTLR C# runtime support, I have a bug/enhancement to report in ANTLR C# runtime class antlr272/antlr/CharScanner.cs I have developed a custom markup...