help-flex
[Top][All Lists]
Advanced

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

Problem compiling flex generated class with gcc 3.3 / flex 2.5.31


From: Felix Ritter
Subject: Problem compiling flex generated class with gcc 3.3 / flex 2.5.31
Date: Sun, 06 Jun 2004 17:12:59 +0200

Hi List,

today I tried to create a c++ - lexer class using this lex file:

---------- BEGIN OF FILE test1.l ----------------
%{
%}
%option yyclass="test1" outfile="test1.cpp" c++ 8bit warn noyywrap

%%

HELLO { return 1; }

%%
---------- END OF FILE test1.l ------------------


I created test1.cpp using

flex -I test1.l

Flex reported no erros.
But if I try to compile the class using

g++ -c test1.cpp

I get this list of error messages:

test1.cpp:499: error: syntax error before `::' token
test1.cpp:502: error: register name not specified for `char*yy_cp'
test1.cpp:502: error: register name not specified for `char*yy_bp'
test1.cpp:503: error: register name not specified for `int yy_act'
test1.cpp:510: error: syntax error before `if'
test1.cpp:529: error: `yy_buffer_stack_top' was not declared in this scope
test1.cpp:529: error: ISO C++ forbids declaration of `yy_buffer_stack' with no
   type
test1.cpp:530: error: `yyin' was not declared in this scope
test1.cpp:530: error: `yy_create_buffer' was not declared in this scope
test1.cpp:530: error: assignment (not initialization) in declaration
test1.cpp:531: error: syntax error before `}' token
test1.cpp:533: error: ISO C++ forbids declaration of `yy_load_buffer_state'
   with no type
test1.cpp:534: error: syntax error before `}' token
test1.cpp:541: error: ISO C++ forbids declaration of `yy_cp' with no type
test1.cpp:541: error: conflicting types for `int*yy_cp'
test1.cpp:502: error: previous declaration as `char*yy_cp'
test1.cpp:541: error: `yy_hold_char' was not declared in this scope
test1.cpp:546: error: ISO C++ forbids declaration of `yy_bp' with no type
test1.cpp:546: error: conflicting types for `int yy_bp'
test1.cpp:502: error: previous declaration as `char*yy_bp'
test1.cpp:548: error: ISO C++ forbids declaration of `yy_current_state' with no
   type
test1.cpp:548: error: `yy_start' was not declared in this scope
test1.cpp:549: error: syntax error before `:' token
test1.cpp:556: error: ISO C++ forbids declaration of `yy_last_accepting_cpos'
   with no type
test1.cpp:556: error: invalid conversion from `int*' to `int'
test1.cpp:557: error: syntax error before `}' token
test1.cpp:564: error: ISO C++ forbids declaration of `yy_current_state' with no
   type
test1.cpp:564: error: redefinition of `int yy_current_state'
test1.cpp:548: error: `int yy_current_state' previously defined here
test1.cpp:564: error: `yy_c' was not declared in this scope
test1.cpp:565: error: syntax error before `++' token
test1.cpp:569: error: syntax error before `:' token
test1.cpp:574: error: ISO C++ forbids declaration of `yy_current_state' with no
   type
test1.cpp:574: error: redefinition of `int yy_current_state'
test1.cpp:564: error: `int yy_current_state' previously defined here
test1.cpp:574: error: `yy_last_accepting_state' was not declared in this scope
test1.cpp:575: error: ISO C++ forbids declaration of `yy_act' with no type
test1.cpp:575: error: redefinition of `int yy_act'
test1.cpp:503: error: `int yy_act' previously declared here
test1.cpp:576: error: syntax error before `}' token
test1.cpp:578: error: ISO C++ forbids declaration of `yytext' with no type
test1.cpp:578: error: ISO C++ forbids declaration of `yyleng' with no type
test1.cpp:578: error: ISO C++ forbids declaration of `yy_hold_char' with no
   type
test1.cpp:578: error: ISO C++ forbids declaration of `yy_cp' with no type
test1.cpp:578: error: redefinition of `int*yy_cp'
test1.cpp:541: error: `int*yy_cp' previously defined here
test1.cpp:578: error: ISO C++ forbids declaration of `yy_c_buf_p' with no type
test1.cpp:578: error: invalid conversion from `int*' to `int'
test1.cpp:580: error: syntax error before `:' token
test1.cpp:587: error: ISO C++ forbids declaration of `yy_cp' with no type
test1.cpp:587: error: conflicting types for `int yy_cp'
test1.cpp:578: error: previous declaration as `int*yy_cp'
test1.cpp:588: error: ISO C++ forbids declaration of `yy_current_state' with no
   type
test1.cpp:588: error: redefinition of `int yy_current_state'
test1.cpp:574: error: `int yy_current_state' previously defined here
test1.cpp:588: error: `yy_last_accepting_state' was not declared in this scope
test1.cpp:589: error: syntax error before `goto'
test1.cpp:611: error: ISO C++ forbids declaration of `yy_cp' with no type
test1.cpp:611: error: conflicting types for `int*yy_cp'
test1.cpp:587: error: previous declaration as `int yy_cp'
test1.cpp:614: error: syntax error before `if'
test1.cpp:626: error: `yy_buffer_stack_top' was not declared in this scope
test1.cpp:626: error: syntax error before `->' token
test1.cpp:627: error: `yy_buffer_stack_top' was not declared in this scope
test1.cpp:627: error: syntax error before `->' token
test1.cpp:641: error: ISO C++ forbids declaration of `yy_c_buf_p' with no type
test1.cpp:641: error: redefinition of `int yy_c_buf_p'
test1.cpp:578: error: `int yy_c_buf_p' previously declared here
test1.cpp:641: error: `yy_amount_of_matched_text' was not declared in this
   scope
test1.cpp:643: error: ISO C++ forbids declaration of `yy_current_state' with no
   type
test1.cpp:643: error: redefinition of `int yy_current_state'
test1.cpp:588: error: `int yy_current_state' previously defined here
test1.cpp:643: error: `yy_get_previous_state' was not declared in this scope
test1.cpp:654: error: ISO C++ forbids declaration of `yy_next_state' with no
   type
test1.cpp:654: error: `yy_try_NUL_trans' was not declared in this scope
test1.cpp:656: error: ISO C++ forbids declaration of `yy_bp' with no type
test1.cpp:656: error: redefinition of `int yy_bp'
test1.cpp:546: error: `int yy_bp' previously defined here
test1.cpp:658: error: syntax error before `if'
test1.cpp:662: error: ISO C++ forbids declaration of `yy_current_state' with no
   type
test1.cpp:662: error: redefinition of `int yy_current_state'
test1.cpp:643: error: `int yy_current_state' previously defined here
test1.cpp:663: error: syntax error before `goto'
test1.cpp:692: error: ISO C++ forbids declaration of `yy_act' with no type
test1.cpp:692: error: redefinition of `int yy_act'
test1.cpp:575: error: `int yy_act' previously declared here
test1.cpp:692: error: `yy_start' was not declared in this scope
test1.cpp:693: error: syntax error before `goto'
test1.cpp:708: error: ISO C++ forbids declaration of `yy_current_state' with no
   type
test1.cpp:708: error: redefinition of `int yy_current_state'
test1.cpp:662: error: `int yy_current_state' previously declared here
test1.cpp:708: error: `yy_get_previous_state' was not declared in this scope
test1.cpp:710: error: ISO C++ forbids declaration of `yy_cp' with no type
test1.cpp:710: error: conflicting types for `int yy_cp'
test1.cpp:611: error: previous declaration as `int*yy_cp'
test1.cpp:711: error: ISO C++ forbids declaration of `yy_bp' with no type
test1.cpp:711: error: redefinition of `int yy_bp'
test1.cpp:656: error: `int yy_bp' previously declared here
test1.cpp:712: error: syntax error before `goto'
test1.cpp:718: error: ISO C++ forbids declaration of `yy_current_state' with no
   type
test1.cpp:718: error: redefinition of `int yy_current_state'
test1.cpp:708: error: `int yy_current_state' previously defined here
test1.cpp:718: error: `yy_get_previous_state' was not declared in this scope
test1.cpp:720: error: ISO C++ forbids declaration of `yy_cp' with no type
test1.cpp:720: error: redefinition of `int yy_cp'
test1.cpp:710: error: `int yy_cp' previously defined here
test1.cpp:721: error: ISO C++ forbids declaration of `yy_bp' with no type
test1.cpp:721: error: redefinition of `int yy_bp'
test1.cpp:711: error: `int yy_bp' previously declared here
test1.cpp:722: error: syntax error before `goto'
address@hidden:~/ngsgssql> flex -I test1.l
address@hidden:~/ngsgssql> g++ -c test1.cpp -s
test1.cpp:499: error: syntax error before `::' token
test1.cpp:502: error: register name not specified for `char*yy_cp'
test1.cpp:502: error: register name not specified for `char*yy_bp'
test1.cpp:503: error: register name not specified for `int yy_act'
test1.cpp:510: error: syntax error before `if'
test1.cpp:529: error: `yy_buffer_stack_top' was not declared in this scope
test1.cpp:529: error: ISO C++ forbids declaration of `yy_buffer_stack' with no
   type
test1.cpp:530: error: `yyin' was not declared in this scope
test1.cpp:530: error: `yy_create_buffer' was not declared in this scope
test1.cpp:530: error: assignment (not initialization) in declaration
test1.cpp:531: error: syntax error before `}' token
test1.cpp:533: error: ISO C++ forbids declaration of `yy_load_buffer_state'
   with no type
test1.cpp:534: error: syntax error before `}' token
test1.cpp:541: error: ISO C++ forbids declaration of `yy_cp' with no type
test1.cpp:541: error: conflicting types for `int*yy_cp'
test1.cpp:502: error: previous declaration as `char*yy_cp'
test1.cpp:541: error: `yy_hold_char' was not declared in this scope
test1.cpp:546: error: ISO C++ forbids declaration of `yy_bp' with no type
test1.cpp:546: error: conflicting types for `int yy_bp'
test1.cpp:502: error: previous declaration as `char*yy_bp'
test1.cpp:548: error: ISO C++ forbids declaration of `yy_current_state' with no
   type
test1.cpp:548: error: `yy_start' was not declared in this scope
test1.cpp:549: error: syntax error before `:' token
test1.cpp:556: error: ISO C++ forbids declaration of `yy_last_accepting_cpos'
   with no type
test1.cpp:556: error: invalid conversion from `int*' to `int'
test1.cpp:557: error: syntax error before `}' token
test1.cpp:564: error: ISO C++ forbids declaration of `yy_current_state' with no
   type
test1.cpp:564: error: redefinition of `int yy_current_state'
test1.cpp:548: error: `int yy_current_state' previously defined here
test1.cpp:564: error: `yy_c' was not declared in this scope
test1.cpp:565: error: syntax error before `++' token
test1.cpp:569: error: syntax error before `:' token
test1.cpp:574: error: ISO C++ forbids declaration of `yy_current_state' with no
   type
test1.cpp:574: error: redefinition of `int yy_current_state'
test1.cpp:564: error: `int yy_current_state' previously defined here
test1.cpp:574: error: `yy_last_accepting_state' was not declared in this scope
test1.cpp:575: error: ISO C++ forbids declaration of `yy_act' with no type
test1.cpp:575: error: redefinition of `int yy_act'
test1.cpp:503: error: `int yy_act' previously declared here
test1.cpp:576: error: syntax error before `}' token
test1.cpp:578: error: ISO C++ forbids declaration of `yytext' with no type
test1.cpp:578: error: ISO C++ forbids declaration of `yyleng' with no type
test1.cpp:578: error: ISO C++ forbids declaration of `yy_hold_char' with no
   type
test1.cpp:578: error: ISO C++ forbids declaration of `yy_cp' with no type
test1.cpp:578: error: redefinition of `int*yy_cp'
test1.cpp:541: error: `int*yy_cp' previously defined here
test1.cpp:578: error: ISO C++ forbids declaration of `yy_c_buf_p' with no type
test1.cpp:578: error: invalid conversion from `int*' to `int'
test1.cpp:580: error: syntax error before `:' token
test1.cpp:587: error: ISO C++ forbids declaration of `yy_cp' with no type
test1.cpp:587: error: conflicting types for `int yy_cp'
test1.cpp:578: error: previous declaration as `int*yy_cp'
test1.cpp:588: error: ISO C++ forbids declaration of `yy_current_state' with no
   type
test1.cpp:588: error: redefinition of `int yy_current_state'
test1.cpp:574: error: `int yy_current_state' previously defined here
test1.cpp:588: error: `yy_last_accepting_state' was not declared in this scope
test1.cpp:589: error: syntax error before `goto'
test1.cpp:611: error: ISO C++ forbids declaration of `yy_cp' with no type
test1.cpp:611: error: conflicting types for `int*yy_cp'
test1.cpp:587: error: previous declaration as `int yy_cp'
test1.cpp:614: error: syntax error before `if'
test1.cpp:626: error: `yy_buffer_stack_top' was not declared in this scope
test1.cpp:626: error: syntax error before `->' token
test1.cpp:627: error: `yy_buffer_stack_top' was not declared in this scope
test1.cpp:627: error: syntax error before `->' token
test1.cpp:641: error: ISO C++ forbids declaration of `yy_c_buf_p' with no type
test1.cpp:641: error: redefinition of `int yy_c_buf_p'
test1.cpp:578: error: `int yy_c_buf_p' previously declared here
test1.cpp:641: error: `yy_amount_of_matched_text' was not declared in this
   scope
test1.cpp:643: error: ISO C++ forbids declaration of `yy_current_state' with no
   type
test1.cpp:643: error: redefinition of `int yy_current_state'
test1.cpp:588: error: `int yy_current_state' previously defined here
test1.cpp:643: error: `yy_get_previous_state' was not declared in this scope
test1.cpp:654: error: ISO C++ forbids declaration of `yy_next_state' with no
   type
test1.cpp:654: error: `yy_try_NUL_trans' was not declared in this scope
test1.cpp:656: error: ISO C++ forbids declaration of `yy_bp' with no type
test1.cpp:656: error: redefinition of `int yy_bp'
test1.cpp:546: error: `int yy_bp' previously defined here
test1.cpp:658: error: syntax error before `if'
test1.cpp:662: error: ISO C++ forbids declaration of `yy_current_state' with no
   type
test1.cpp:662: error: redefinition of `int yy_current_state'
test1.cpp:643: error: `int yy_current_state' previously defined here
test1.cpp:663: error: syntax error before `goto'
test1.cpp:692: error: ISO C++ forbids declaration of `yy_act' with no type
test1.cpp:692: error: redefinition of `int yy_act'
test1.cpp:575: error: `int yy_act' previously declared here
test1.cpp:692: error: `yy_start' was not declared in this scope
test1.cpp:693: error: syntax error before `goto'
test1.cpp:708: error: ISO C++ forbids declaration of `yy_current_state' with no
   type
test1.cpp:708: error: redefinition of `int yy_current_state'
test1.cpp:662: error: `int yy_current_state' previously declared here
test1.cpp:708: error: `yy_get_previous_state' was not declared in this scope
test1.cpp:710: error: ISO C++ forbids declaration of `yy_cp' with no type
test1.cpp:710: error: conflicting types for `int yy_cp'
test1.cpp:611: error: previous declaration as `int*yy_cp'
test1.cpp:711: error: ISO C++ forbids declaration of `yy_bp' with no type
test1.cpp:711: error: redefinition of `int yy_bp'
test1.cpp:656: error: `int yy_bp' previously declared here
test1.cpp:712: error: syntax error before `goto'
test1.cpp:718: error: ISO C++ forbids declaration of `yy_current_state' with no
   type
test1.cpp:718: error: redefinition of `int yy_current_state'
test1.cpp:708: error: `int yy_current_state' previously defined here
test1.cpp:718: error: `yy_get_previous_state' was not declared in this scope
test1.cpp:720: error: ISO C++ forbids declaration of `yy_cp' with no type
test1.cpp:720: error: redefinition of `int yy_cp'
test1.cpp:710: error: `int yy_cp' previously defined here
test1.cpp:721: error: ISO C++ forbids declaration of `yy_bp' with no type
test1.cpp:721: error: redefinition of `int yy_bp'
test1.cpp:711: error: `int yy_bp' previously declared here
test1.cpp:722: error: syntax error before `goto'

Does anybody have an idea?
I use gcc 3.3.3 on a Suse Linux 9.1 system with kernel 2.6!
The flex version is 2.5.31.

Thanks for any help!!
Felix

__________________________________________________________________
Zeigen Sie Emotionen mit der WEB.DE Bild-SMS! Das Bild ist gratis,
Sie bezahlen nur den Versand. http://freemail.web.de/?mc=021196





reply via email to

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