FMSE
Formal
Methods in
Software Engineering
Publications Automating Abstract Syntax Tree con ... Anonymous  Login
Automating Abstract Syntax Tree construction for Context Free Grammars
Daniel Ionut Vicol   Andrei Arusoaie  
IEEE,   2012  
Abstract:

In most of the compilers or programming languages tools, parsers are used for transforming human readable code into Parse Trees or Abstract Syntax Trees (AST). A popular method to create parsers is to use a parser generator. Advanced parser generators (e.g. ANTLR, SDF) are able to generate directly ASTs if the grammar is annotated with AST generation rules. These annotations are typically done manually, by adding to each grammar rule a constructor and associating an AST component to each constructor. This might be inconvenient for people with little experience in writing grammars or for those who already have a grammar for their language.

 

In this paper, we present a generic method for inferring such AST generation rules and a tool which automatically generates the annotated grammar. Assuming you have a grammar for a language, some input programs and their corresponding ASTs, the tool will infer the rules for constructing the AST. If the input programs cover the whole range of the language syntax constructs then the parser corresponding to the generated annotated grammar is able to parse and transform into an AST any program of the given language.

Project(s):    K
Grant(s):    DAK
NEWS
New publication : Model checking recursive programs interacting via ... - 01 feb 2015

Almost all modern imperative programming languages include operations for dynamically manipulating the heap, for example by allocating and deallocating objects, and by updating reference fields. In the presence of recursive ... (more)


New publication : K-Java: A Complete Semantics of Java - 10 sep 2014

This paper presents K-Java, a complete executable formal semantics of Java 1.4.
K-Java was extensively tested with a test suite developed alongside the project, following the Test Driven Development methodology.
more)


New publication : K-Java: A Complete Semantics of Java - 09 jul 2014

This paper presents K-Java, a complete executable formal semantics of Java 1.4.
K-Java was extensively tested with a test suite developed alongside the project, following the Test Driven Development methodology.
more)


New publication : Engineering Hoare Logic-based Program Verification in ... - 30 oct 2013

We propose a language-independent symbolic execution framework for languages endowed with a formal operational semantics based on term rewriting. Starting from a given definition of a language, a new language ... (more)


New talk: PAS 2013 - 20 oct 2013

Dorel lucanu will give a talk at PAS 2013.

(more)

     Archive

@FMSE 2010-2011