LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   [Flex & Bison] How to check which state Flex is in? (https://www.linuxquestions.org/questions/programming-9/%5Bflex-and-bison%5D-how-to-check-which-state-flex-is-in-884356/)

courteous 06-03-2011 11:46 AM

[Flex & Bison] How to check which state Flex is in?
 
Is it possible to have different 'actions' in Flex, based on its state? That is,
Code:

if (Flex is in INITIAL state)
    "do something"
else
    "print macro statements in file"

This is for adding the .macro ability to my lame assembler. I'll admit it is an ugly (and expensive) hack, but it'll work ... I think. :)

Any advice on making the .macro function in Flex & Bison are very welcome.


All times are GMT -5. The time now is 05:11 AM.