[antlr-interest] 2 questions

Harsh Deshmane hdeshmane at montalvosystems.com
Fri Sep 16 17:06:06 PDT 2005


Hi Alexey,

thanks for your suggestion. I used it to finish (at least a little) of my 
grammar file( a very basic netlist parser).

When I tried to compile in C++, I found the compiler complaining of
undefined function "getColumn() "
I have checked that the function exists and is defined in Token.hpp
and that Token.o is archived into libantlr.a.

I tried to explicitly call antlr::Token::getColumn(), but it's a virtual 
function and const, so it requires an object to be called.
IF LLKParser is not inheriting this function, how is it to be called ?

What else can I do to debug this problem ?

Oh, I also followed Ric's instructions on compiling libantlr.a and
ran the example calc program. It works fine.

thanks,
-harsh

SpiceParser.cpp: In member function `void SpiceParser::subckt()':
SpiceParser.cpp:122: `getColumn' undeclared (first use this function)
SpiceParser.cpp:122: (Each undeclared identifier is reported only once for 
each
   function it appears in.)



On Wednesday 14 September 2005 00:11, Alexey Demakov wrote:
> b. You can check current column position in lexer rule:
>
> START_LINE_TOKEN : { getColumn() == 1 }? "M43blah" ;
>
> Regards,
> Alexey
>
> -----
> Alexey Demakov
> TreeDL: Tree Description Language: http://treedl.sourceforge.net
> RedVerst Group: http://www.unitesk.com
>
> ----- Original Message -----
> From: "Harsh Deshmane" <hdeshmane at montalvosystems.com>
> To: <antlr-interest at antlr.org>
> Sent: Wednesday, September 14, 2005 2:11 AM
> Subject: [antlr-interest] 2 questions
>
> > Hi,
> >
> > I have two questions:
> > a. How do you search the archives of the mailing list ?
> > b. for the grammar, I need to specifically capture patterns that start
> > from the first character of the line, how do I do that ?
> >
> > for example,
> >
> > M43blah  xx yy zz
> >
> > Here, the letter "M" in the first location is important.
> > Similarly for other key"letters"
> > In regular expressions, it would be "^M" that I am looking for..
> >
> > thanks for any help.
> > -harsh


More information about the antlr-interest mailing list