JJ Brunekreef’s scientific contributions

What is this page?


This page lists works of an author who doesn't have a ResearchGate profile or hasn't added the works to their profile yet. It is automatically generated from public (personal) data to further our legitimate goal of comprehensive and accurate scientific recordkeeping. If you are this author and want this page removed, please let us know.

Publications (7)


The Unparser
  • Chapter

May 2012

·

16 Reads

·

·

A Serebrenik

·

JJ Brunekreef

Code generators are metaprograms translating a regular tree to a sentence of a context-free language. The metalanguage used to implement the code generator should be, on the one side, expressive enough to be of practical value, and, on the other side, restricted enough to enforce the separation between the view and the model, according to the model-viewcontroller architecture (MVC). In the MVC architecture, templates are commonly used to implement the view of the internal data of an application (model).


Syntax-Safe Templates

May 2012

·

13 Reads

Writing templates, and code generators in general, is a complex and error prone task. This complexity mainly results from mixing multiple languages in a template, executed at different stages, and the incompleteness of the object code. Manual verification of incomplete object code is hard to do and computers cannot execute incomplete code.



The Metalanguage

May 2012

·

10 Reads

This chapter introduces an unparser-complete metalanguage for templates. The syntax and operational semantics of the constructs are given. The constructs of this metalanguage are based on the concepts of the theoretical framework of Chapter 3. As a result, the metalanguage is strong enough to specify unparsers, and still enforces a separation of model and view.


Case Studies

May 2012

·

7 Reads

Three case studies are presented in this chapter to show the use of the unparser-complete metalanguage and the usability of the syntax-safe template evaluator in a practical setting. The syntax-safe template evaluator Repleo is used for implementing these case studies. Two case studies show a reimplementation of an existing code generator. The reimplemented code generators use a separated model transformation stage, resulting in less code and better maintainable code than the original implementations. The use of separated model transformation stage is also enforced by the unparser-complete metalanguage of Repleo. The maintainability is achieved by less code clones in the code generator specification and less entanglement of metacode and object code. The third case study shows the benefits of syntax-safe templates in the context of dynamic web page generation. Syntax-safe templates provide a solution against cross-site scripting attacks.


Code Generation with Templates

January 2012

·

5,855 Reads

·

10 Citations

Templates are used to generate all kinds of text, including computer code. The last decade, the use of templates gained a lot of popularity due to the increase of dynamic web applications. Templates are a tool for programmers, and implementations of template engines are most times based on practical experience rather than based on a theoretical background. This book reveals the mathematical background of templates and shows interesting findings for improving the practical use of templates. First, a framework to determine the necessary computational power for the template metalanguage is presented. The template metalanguage does not need to be Turing-complete to be useful. A non-Turing-complete metalanguage enforces separation of concerns between the view and model. Second, syntactical correctness of all languages of the templates and generated code is ensured. This includes the syntactical correctness of the template metalanguage and the output language. Third, case studies show that the achieved goals are applicable in practice. It is even shown that syntactical correctness helps to prevent cross-site scripting attacks in web applications. The target audience of this book is twofold. The first group exists of researcher interested in the mathematical background of templates. The second group exists of users of templates. This includes designers of template engines on one side and programmers and web designers using templates on the other side


Repleo: Syntax-Safe Template Evaluation

January 2012

·

11 Reads

Parsing a template alone is not sufficient to achieve syntax-safe code generation. Via the introduction of the substitution placeholder and the free choice of identifiers for subtemplates, correctness of the parse tree of a template does not imply that the generated code will be syntactically correct. For example, a subtemplate call placeholder with identifier s is applied for nonterminal n1, while the root nonterminal of the subtemplate with the identifier s is n2 and thus not equal to n1. Although the substitution placeholder breaks static verification of syntax-safety, it is a design choice to leave it in the metalanguage, as it is one of the “natural” constructs in a template metalanguage. Most (industrial) template evaluators offer the substitution placeholder.

Citations (1)


... Code generation allows you to produce program code that is only strongly typed, and yet can be easily reconfigured codebase when the source model is changed 2 . Principally, code generators are metaprograms translating a regular tree to a sentence of a context-free language [3]. When the code generator translates the abstract syntax tree into a context-free language, it uses a model, which is the definition language of the agent, and view(result) in order for realizing the operation. ...

Reference:

GasMASk Annotation-based Code Generator as an Embedded Domain-Specific Language in Collaborative Multi-Agent Systems
Code Generation with Templates
  • Citing Article
  • January 2012