ANTLRWorks: an ANTLR grammar development environment

  • Authors:
  • Jean Bovet;Terence Parr

  • Affiliations:
  • BEA Systems, Inc., 475 Sansome Street, San Francisco, CA, U.S.A.;Computer Science Department, University of San Francisco, San Francisco, CA, U.S.A.

  • Venue:
  • Software—Practice & Experience
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

Programmers tend to avoid using language tools, resorting to ad hoc methods, because tools can be hard to use, their parsing strategies can be difficult to understand and debug, and their generated parsers can be opaque black-boxes. In particular, there are two very common difficulties encountered by grammar developers: understanding why a grammar fragment results in a parser non-determinism and determining why a generated parser incorrectly interprets an input sentence. This paper describes ANTLRWorks, a complete development environment for ANTLR grammars that attempts to resolve these difficulties and, in general, make grammar development more accessible to the average programmer. The main components are a grammar editor with refactoring and navigation features, a grammar interpreter, and a domain-specific grammar debugger. ANTLRWorks' primary contributions are a parser non-determinism visualizer based on syntax diagrams and a time-traveling debugger that pays special attention to parser decision-making by visualizing lookahead usage and speculative parsing during backtracking. Copyright © 2008 John Wiley & Sons, Ltd.