Artigo Revisado por pares

Lexical state analyzer for JavaCC grammars

2015; Wiley; Volume: 46; Issue: 6 Linguagem: Inglês

10.1002/spe.2322

ISSN

1097-024X

Autores

Kartik Gupta, V. Krishna Nandivada,

Tópico(s)

Logic, programming, and type systems

Resumo

Summary Lexical states in JavaCC provide a powerful mechanism to scan regular expressions in a context sensitive manner. But 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. We then extend the traditional context sensitive and a context insensitive analysis to identify errors and warnings in context‐free grammars. We have implemented these analyses as a standalone tool ( LSA ), the first of its kind, to identify errors and warnings in JavaCC grammars. The LSA tool outputs a graph that depicts the grammar and the error transitions. Importantly, it can also generate 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. Copyright © 2015 John Wiley & Sons, Ltd.

Referência(s)
Altmetric
PlumX