SearcharxivSearch

arXiv subjects

Andrey Breslav

Publications and source records attributed to Andrey Breslav.

6 recordsLinked to original sources

Extensible type checker for parser generation

Parser generators generate translators from language specifications. In many cases, such specifications contain semantic actions written in the same language as the generated code. Since these actions are subject to little static checking, they are usually a source of errors which are discovered only when generated code is compiled. In this paper we propose a parser generator front-end which statically checks semantic actions for typing errors and prevents such errors from appearing in generated code. The type checking procedure is extensible to support many implementation languages. An extension for Java is presented along with an extension for declarative type system descriptions.

cs.PL

Grammatical Aspects for Language Descriptions

For the purposes of tool development, computer languages are usually described using context-free grammars with annotations such as semantic actions or pretty-printing instructions. These descriptions are processed by generators which automatically build software, e.g., parsers, pretty-printers and editing support. In many cases the annotations make grammars unreadable, and when generating code for several tools supporting the same language, one usually needs to duplicate the grammar in order to provide different annotations for different generators. We present an approach to describing languages which improves readability of grammars and reduces the duplication. To achieve this we use Aspect-Oriented Programming principles. This approach has been implemented in an open-source tool named Grammatic. We show how it can be used to generate pretty-printers and syntax highlighters.

cs.PL

Creating Textual Language Dialects Using Aspect-like Techniques

Here we present a work aimed on efficiently creating textual language dialects and supporting tools for them (e.g. compiler front-ends, IDE support, pretty-printers, etc.). A dialect is a language which may be described with a (relatively small) set of changes to some other language (a parent language). For example we can consider SQL dialects used in DB-management systems. We propose to use aspects for grammars to define different features of the anguage and to transform grammars. A dialect is created by defining a syntactical spect which modifies the parent language. This technique is not dependent on any particular language design, AST structure or parsing technology and provides a uniform way for creating dialects, which extend or restrict languages.

cs.PL

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 Apsect-Oriented Programming to grammars and uses templates for grammar reuse. We illustrate usage of Grammatic by describing a case study: bringing separation of concerns to ANTLR parser generator, which is achieved without a common time- and memory-consuming technique of building an AST to separate semantic actions from a grammar definition.

cs.PL

Grammatic -- a tool for grammar definition reuse and modularity

Grammatic is a tool for grammar definition and manipulation aimed to improve modularity and reuse of grammars and related development artifacts. It is independent from parsing technology and any other details of target system implementation. Grammatic provides a way for annotating grammars with arbitrary metadata (like associativity attributes, semantic actions or anything else). It might be used as a front-end for external tools like parser generators to make their input grammars modular and reusable. This paper describes main principles behind Grammatic and gives an overview of languages it provides and their ability to separate concerns and define reusable modules. Also it presents sketches of possible use cases for the tool.

cs.PL

DSL development based on target meta-models. Using AST transformations for automating semantic analysis in a textual DSL framework

This paper describes an approach to creating textual syntax for Do- main-Specific Languages (DSL). We consider target meta-model to be the main artifact and hence to be developed first. The key idea is to represent analysis of textual syntax as a sequence of transformations. This is made by explicit opera- tions on abstract syntax trees (ATS), for which a simple language is proposed. Text-to-model transformation is divided into two parts: text-to-AST (developed by openArchitectureWare [1]) and AST-to-model (proposed by this paper). Our approach simplifies semantic analysis and helps to generate as much as possi- ble.

cs.PL