Benoît Sigoure

TWEAST: A simple and effective technique to implement concrete-syntax AST rewriting using partial parsing

By Akim Demaille, Roland Levillain, Benoît Sigoure

2008-10-11

In Proceedings of the 24th annual ACM symposium on applied computing (SAC’09)

Abstract

ASTs are commonly used to represent an input/output program in compilers and language processing tools. Many of the tasks of these tools consist in generating and rewriting ASTs. Such an approach can become tedious and hard to maintain for complex operations, namely program transformation, optimization, instrumentation, etc. On the other hand, concrete syntax provides a natural and simpler representation of programs, but it is not usually available as a direct feature of the aforementioned tools. We propose a simple technique to implement AST generation and rewriting in general purpose languages using concrete syntax. Our approach relies on extensions made in the scanner and the parser and the use of objects supporting partial parsing called Text With Embedded Abstract Syntax Trees (TWEASTS). A compiler for a simple language (Tiger) written in serves as an example, featuring transformations in concrete syntax: syntactic desugaring, optimization, code instrumentation such as bounds-checking, etc. Extensions of this technique to provide a full-fledged concrete-syntax rewriting framework are presented as well.

Continue reading

Semantics driven disambiguation: A comparison of different approaches

By Akim Demaille, Renaud Durlin, Nicolas Pierron, Benoît Sigoure

2008-02-08

In Proceedings of the 8th workshop on language descriptions, tools and applications (LDTA’08)

Abstract

Context-sensitive languages such as or can be parsed using a context-free but ambiguous grammar, which requires another stage, disambiguation, in order to select the single parse tree that complies with the language’s semantical rules. Naturally, large and complex languages induce large and complex disambiguation stages. If, in addition, the parser should be extensible, for instance to enable the embedding of domain specific languages, the disambiguation techniques should feature traditional software-engineering qualities: modularity, extensibility, scalability and expressiveness. We evaluate three approaches to write disambiguation filters for sdf grammars: algebraic equations with asf, rewrite-rules with programmable traversals for , and attribute grammars with , our system. To this end we introduce , a highly ambiguous language. Its “standard” grammar exhibits ambiguities inspired by those found in the and standard grammars. To evaluate modularity, the grammar is layered: it starts with a small core language, and several layers add new features, new production rules, and new ambiguities.

Continue reading

Modeling of sensor networks using XRM

By Akim Demaille, Sylvain Peyronnet, Benoît Sigoure

2006-09-14

In Proceedings of the 2nd international symposium on leveraging applications of formal methods, verification and validation (ISoLA’06)

Abstract

Sensor networks are composed of small electronic devices that embed processors, sensors, batteries, memory and communication capabilities. One of the main goal in the design of such systems is the handling of the inherent complexity of the nodes, strengthened by the huge number of nodes in the network. For these reasons, it becomes very difficult to model and verify such systems. In this paper, we investigate the main characteristics of sensor nodes, discuss about the use of a language derived from Reactive Modules for their modeling and propose a language (and a tool set) that ease the modeling of this kind of systems.

Continue reading