westes / flex

The Fast Lexical Analyzer - scanner generator for lexing in C and C++
Other
3.6k stars 538 forks source link

flex: input rules are too complicated (>= 32000 NFA states)" #572

Open nIxedoahz opened 1 year ago

nIxedoahz commented 1 year ago

flex version 2.6.4

Error reported as follows

flex: input rules are too complicated (>= 32000 NFA states)"

How do I solve this problem without generating cpp files

Mightyjo commented 1 year ago

That's a fun error. Can you share your input file?

nIxedoahz commented 1 year ago

That's a fun error. Can you share your input file?

define MAXIMUM_MNS 31999

If I modify this macro to:

define MAXIMUM_MNS 319999

Will it cause any problems

Mightyjo commented 1 year ago

It's a performance parameter for the Flex generation process. Increasing it might let Flex exhaust your system memory or make it take a very long time to produce your scanner.

It's hard to predict whether the generated scanner would be noticably slow or unusually large.

Did you try it? If so, what happened?