【发布时间】:2012-03-06 00:45:31
【问题描述】:
我正在使用 flex(词法分析器)进行一些词法分析。
我需要的是:
如果没有匹配的规则,则返回一个值以指示发生了这样的事情。
这类似于许多编程语言中switch 控制流结构中的default 语法。
有没有办法做这样的事情?
编辑 1: 参考来自the official doc
If no match is found, then the default rule is executed:
the next character in the input is considered matched and copied to the standard output.
但是如何更改默认规则?
【问题讨论】:
标签: flex-lexer