Pergunta

I am including two diferent lex parsers in my C code so to include the second one defined a Prefix on it:

%option prefix="prep"

When I integrated this one in the global proyect It compiles without errors but on execution, If I try to call prepparse (formerly yyparse) I get this error:

undefined symbol: prepparse

I have tried including an external reference (not quite sure if this is correct):

extern int prepparse(void);

And defining it in the Lex header:

#define yyparse prepparse

But I still get the same error.

Any idea of what I am doing wrong?

Foi útil?

Solução

I think I got it. I have found I omited one information that has proben important. As I only wanted to alter some tokens and not defining a full language (it is only preparsing) I dind't define a Yacc file, so I was not actually a parser but a Lexer what I had to call. So the command is not preparse but preplex.

I stil don't have it working but I guess it is another different issue.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top