[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A.3 M4 Dependency
The macro processor m4
(8)
must be installed wherever flex is installed.
flex
invokes ‘m4’, found by searching the directories in the
PATH
environment variable. Any code you place in section 1 or in the
actions will be sent through m4. Please follow these rules to protect your
code from unwanted m4
processing.
- Do not use symbols that begin with, ‘m4_’, such as, ‘m4_define’,
or ‘m4_include’, since those are reserved for
m4
macro names. If for some reason you need m4_ as a prefix, use a preprocessor #define to get your symbol past m4 unmangled. - Do not use the strings ‘[[’ or ‘]]’ anywhere in your code. The
former is not valid in C, except within comments and strings, but the latter is valid in
code such as
x[y[z]]
. The solution is simple. To get the literal string"]]"
, use"]""]"
. To get the array notationx[y[z]]
, usex[y[z] ]
. Flex will attempt to detect these sequences in user code, and escape them. However, it’s best to avoid this complexity where possible, by removing such sequences from your code.
m4
is only required at the time you run flex
. The generated
scanner is ordinary C or C++, and does not require m4
.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on November 4, 2011 using texi2html 5.0.