help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

About passing parameters to yylex (fwd)


From: Jesus M. Diaz Hernandez
Subject: About passing parameters to yylex (fwd)
Date: Wed, 19 Dec 2001 10:49:06 -0500 (EST)

ok, i apologize myself about this off topic c++ question... flex works ok,
it was -as always- a problem of my c++ code. 

Sorry again

>1.- i declare a new prototype for my lexical function and i set the
>%option yyclass= to the class i'm defining:


>%{
>#include "Parser.h"

>#undef YY_DECL
>#define YY_DECL int Lexer::yylex (YYSTYPE* yylval)
>
>%}
>
>2.- in Parser.h,  i define the new lexer class:
>...
>class Lexer : public yyFlexLexer {
>public:
> Lexer(istream* arg_yyin = 0, ostream* arg_yyout = 0 );
>
> int yylex(YYSTYPE* yylval);
>};

>3.- in a .C file i wrote the implementation of the constructor:
>(i wrote it on the .y file)
>
>Lexer::Lexer (istream* arg_yyin = 0, ostream* arg_yyout = 0)
> : yyFlexLexer(arg_yyin,arg_yyout) {};
>
>then, i get a link error: 
>
>parser/sforza.tab.o: In function `Lexer::Lexer(istream *, ostream *)':
>/home/jesus/wdir/sforza/sforza.y:1038: undefined reference to `Lexer
>virtual table'
>
>That confuses me...if somone can help, i will apreciate it ;)

-- 
 Jesus Miguel Diaz Hdez
 __________________________________

 Grupo de Redes
 Facultad de Matematica y Cibernetica
 Universidad de la Habana, Cuba

e-mail:
   address@hidden








reply via email to

[Prev in Thread] Current Thread [Next in Thread]