ANTLRWorks: an ANTLR grammar development environment
نویسندگان
چکیده
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 nondeterminism 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 nondeterminism visualizer based upon syntax diagrams and a time-traveling debugger that pays special attention to parser decision-making by visualizing lookahead usage and speculative parsing during backtracking.
منابع مشابه
Creating modular and reusable DSL textual syntax definitions with Grammatic/ANTLR
In this paper we present Grammatic – a tool for textual syntax definition. Grammatic serves as a front-end for parser generators (and other tools) and brings modularity and reuse to their development artifacts. It adapts techniques for separation of concerns from ApsectOriented Programming to grammars and uses templates for grammar reuse. We illustrate usage of Grammatic by describing a case st...
متن کاملAGile, a structured editor, analyzer, metric evaluator, and transformer for Attribute Grammars
As edit, analyze, measure or transform attribute grammars by hand is an exhaustive task, it would be great if it could be automatized, specially for those who work in Language Engineering. However, currently there are no editors oriented to grammar development that cover all our needs. In this paper we describe the architecture and the development stages of AGile, a structured editor, analyzer,...
متن کاملSimpl: a Toolkit for Rapid DSL Implementation
This paper describes the Simpl toolkit for implementing domain-specific languages (DSLs). Simpl aims to be a comprehensive toolkit that covers most of the aspects of developing a DSL. DSL implementations created with Simpl can be embedded into a larger system because no assumptions about architecture of the system are made. Simpl is based on existing tools and adds to them a grammar description...
متن کاملA systematic approach to the implementation of attribute grammars with conventional compiler construction tools
This article describes structure-preserving coding patterns to code arbitrary non-circular attribute grammars as syntax-directed translation schemes for bottom-up and top-down parser generation tools. In these translation schemes, semantic actions are written in terms of a small repertory of primitive attribution operations. By providing alternative implementations for these attribution operati...
متن کاملAster: Automatic Abstract Syntax
Modern parser generators typically require two components: an abstract syntax data structure and a concrete syntax grammar specification. Usually the abstract syntax and the concrete syntax are closely related but are specified independently because it is difficult to distinguish what parts of the concrete syntax are associated with the abstract syntax. There are a few add-ons to parser generat...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Softw., Pract. Exper.
دوره 38 شماره
صفحات -
تاریخ انتشار 2008