help-flex
[Top][All Lists]
Advanced

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

[Question] Generating C++ code with member variables from Flex


From: Sebastian Wain
Subject: [Question] Generating C++ code with member variables from Flex
Date: Fri, 5 Oct 2001 20:32:38 -0400

Hello, first thanks for Flex and for the documentation within.

I wrote an IRC Protocol Parser on Flex based on the RFC2812 (to be formal...)
Since I am doing a project on C++ (an IRC Search Engine) I am generating code
in C++, but my problem came because I need to do actions like (for example):

%%
\n      {count++;}

%%

But, I didn't want a global count variable, what I need here is to add the 
count member
variable to the class generated by Flex, and access it in the action.

Obviously we can do it changing the code generated by Flex, but I think it's 
not a
clean solution.

There is any method to include member variables in the class and access it 
within the
actions?


Thank You
Sebastian Wain


















reply via email to

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