我必须写有这些规则lex程序: Identifiers: String of alphanumeric (and _), starting with an alphabetic character Literals: Integers and strings Comments: Start with ! character, go to until the end of the line 这是我与
上终止并解析错误我的词法分析器应该在分类期间区分括号并保留一叠已打开的括号。为此,我在我的FSL文件中指定一个辅助功能是这样的: let updateBracketStack sign = // whenever a bracket is parsed, update the stack accordingly
match sign with
| '[' -> push sig