I was trying to get a simple program to work with flex and C++. I can't figure out what's wrong though. With C it works, and I can execute yyflex() with no problems and the analyzer gets executed. With C++ on the other hand...
Take a look:
Code
Execution
Take a look:
Code
Code:
%option noyywrap yylineno c++ %{ #include <iostream> %} %% "<"[A-Za-z]*">" { std::cout << YYText(); } %% int main () { yylex(); return 0; }
Code:
$ flex test.l $ gcc -o test lex.yy.cc test.l: In function 'int main()': test.l:10: error: 'yylex' was not declared in this scope
Comment