解析器生成器 LLnextgen
LLnextgen 部分實現了 LLgen 擴展-LL(1) 解析器生成器,是 Amsterdam Compiler Kit 的一部分。使用類 EBNF 的語法描述以及使用 C 作為輸入的聯合語義行為,并生成 C 代碼。生成的代碼是嚴格的 ANSI C,可使用各種流行的 C 編譯器進行編譯。
它提供的一些特性包括:
-
Tracing of conflicts – LLgen can only indicate where a conflict is detected, but not where it is caused. As the cause may be in a seemingly unrelated rule, conflicts can be very hard to find. LLnextgen can trace the cause of conflicts, making it much easier to resolve them.
-
Symbol tables – A symbol table can be auto-generated if the needed information is supplied.
-
Common code generation – Generation of code for reporting errors and wrapping the lexical analyser. This code is required by LLnextgen and LLgen, and is similar for all parsers created with LLnextgen/LLgen. The default code can also be used as a starting point for creating one's own code.
-
Return values – Return values for non-terminals.