[Flex-devel] Questions about functionality
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Joe K. <kr...@ni...> - 2008-10-14 15:46:10
|
What part of the generated code is supposed to be visible to user code from section 1? My understanding is that section 1 is meant for including extra headers, and inserting cpp #defines to modify cpp-based options. However, it apparently does not come early enough in the generated code, because somebody added the %top{} feature. My first guess is just to avoid moving any code to the other side of the current section 1 code insertion, to avoid breaking things. But, there should be some specific rules. In any case, the %top{} feature is useful because it gets written to the public header. Why does the yylineno macro point to the buffer stack bs_lineno only in the reentrant scanner? Also, why not support yycolumn for the non-reentrant scanner? Does anybody think that M4 macros should be accessible in user code? My version of the skeleton disables all m4 processing of user code. This fixes at least one bug in the bug tracker, but breaks some of the test scanners. To work around this, my skeleton also generates cpp macros to replace some of the M4 macros. This allows code with M4 macros to work, but avoids possible side-effects of m4 processing. Should these be enabled only for internal testing, or are some users writing scanners that use these? My idea is to add an option flag, but state that it is mainly intended for internal testing. Joe Krahn |