词法状态分析器
Lexical State Analyzer
摘要:
词法状态提供了一种强大的机制,以上下文敏感的方式扫描正则表达式。同时,词汇状态也使我们很难对语法的正确性进行推理。我们首先将相关的正确性问题分为两类:错误和警告,然后提出了一个上下文敏感和上下文不敏感的分析,以确定上下文无关语法(CFG)中的错误和警告。我们还提出了这些分析的比较研究。我们还实现了一个独立的工具(LSA),它可以识别JavaCC语法中的错误和警告。LSA工具输出一个描述语法和错误转换的图形。它还可以生成可用于建立错误的反例字符串。我们已经使用LSA分析了大量的开源JavaCC语法文件,效果良好。
英文摘要:
Lexical states provide a powerful mechanism to scan regular expressions in a context sensitive manner. At the same time, lexical states also make it hard to reason about the correctness of the grammar. We first categorize the related correctness issues into two classes: errors and warnings, and then present a context sensitive and a context insensitive analysis to identify errors and warnings in context-free-grammars (CFGs). We also present a comparative study of these analyses. A standalone tool (LSA) has also been implemented by us that can identify errors and warnings in JavaCC grammars. The LSA tool outputs a graph that depicts the grammar and the error transitions. It can also generates counter example strings that can be used to establish the errors. We have used LSA to analyze a host of open-source JavaCC grammar files to good effect.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。