User Profile

Collapse

Profile Sidebar

Collapse
madmaxptz
madmaxptz
Last Activity: Apr 28 '07, 11:00 AM
Joined: Mar 24 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • madmaxptz
    replied to flex and C++
    in C
    The problem was that C++ needed a FlexLexer object, and then execute the yylex() function through it.

    Like this:
    Code:
    int main() {
            FlexLexer* lexer = new yyFlexLexer();
            while (lexer->yylex() != 0)
                    ;
            return 0;
    }

    Solved, thanks.
    See more | Go to post

    Leave a comment:


  • madmaxptz
    started a topic flex and C++
    in C

    flex and C++

    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
    Code:
    %option noyywrap yylineno c++
    %{
            #include <iostream>
    %}
    %%
    "<"[A-Za-z]*">" { std::cout << YYText();
    ...
    See more | Go to post
No activity results to display
Show More
Working...