Re: [Flex-help] error - input line too long
flex is a tool for generating scanners
Brought to you by:
wlestes
From: ruertar <ru...@gm...> - 2008-06-18 15:52:56
|
Shashirekha HL wrote: > hi, > I'm using flex for my project on Information extraction for which i have to > write several rules. If I or the rules like r1|r2|r3|r4......rn, after some > limit, if I use flex, I get the error message " input line too long". I think this indicates a problem with your flex scanner input file. If you look at the flex source code (not flex output), you'll find a macro called "MAXLINE" defined in flexdef.h. MAXLINE seems to be used to set the length of a few important buffers, particularly nmstr and nmdef. I think nmstr and nmdef store the name and value of definitions. If your scanner looks something like: %{ #include <stdio.h> %} DIGIT [0-9a-f] %% At some point nmstr will contain "DIGIT" and nmdef will contain "[0-9a-f]". It looks like those "input line too long" errors are being emitted when either nmstr or nmdef need to be longer than MAXLINE (2048). Just from a brief read, I think you have a definition that has a name or value longer than 2048 characters. I think the solution would be to shorten your definition. If you have a lot concatenated rules, maybe you can split them up into smaller chunks? I'm not positive about this. I only read the source code briefly. I guess it would be nice if flex output more descriptive errors for this situation. Can you reply with your scanner file? > I also changed the entries in the following lines > #define YY_TRAILING_MASK 0x2000 > #define YY_TRAILING_HEAD_MASK 0x4000 to > > #define YY_TRAILING_MASK 0x20000000 > #define YY_TRAILING_HEAD_MASK 0x40000000 > but the error " input line too long" continues. > I don't think altering YY_TRAILING_MASK and YY_TRAILING_MASK_HEAD is what you need to do to fix this. -ayan |