<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">

<channel>
	<title>Planet Stratego</title>
	<link>http://planet.stratego.org/</link>
	<language>en</language>
	<description>Planet Stratego - http://planet.stratego.org/</description>

<item>
	<title>Martin Bravenboer: Dubious Conferences: How do they threat people?</title>
	<guid>tag:blogger.com,1999:blog-6943366.post-7955536333739439693</guid>
	<link>http://mbravenboer.blogspot.com/2008/06/dubious-conferences-how-do-they-threat.html</link>
	<description>&lt;p&gt;
I just got a call for papers for the &lt;a href=&quot;http://www.ieccs.net&quot;&gt;International e-Conference on Computer Science&lt;/a&gt; 2008 (IeCCS 2008). The IeCCS conference organizers and committee members are one of a kind! The submission deadline for papers is the 20th of June. Notification of acceptance is 25th of June. That's 5 days for reviewing. The camera ready deadline is 27th of June. That's 2 days for revising your paper. You've got to love the efficiency of these people! The 2007 edition of this conference has a program of 11 pages of accepted papers. When I review papers, I rarely get more than 2 done per day. If the IeCCS committee want to accept a similar number of papers this year, then they'd better make sure to get enough coffee (or tea, as advised in my Ph.D. thesis).
&lt;/p&gt;

&lt;p&gt;
Now, if you are a computer science researcher such emails are hardly surprising. I delete several of them every week. Everybody is aware of conferences with questionable reviewing practices (see the &lt;a href=&quot;http://pdos.csail.mit.edu/scigen/&quot;&gt;SCIgen paper generator&lt;/a&gt;). What surprised me about the IeCCS call for papers is that there is actually a researcher on the committee who I vaguely know from when I was a student. So, I searched the web a bit to see how obvious the evidence is that the reviewing practices of IeCCS are questionable. Interestingly, I could find only one reference that mentions IeCCS as a conference where you'd better not submit to. It's an interesting &lt;a href=&quot;http://pike.psu.edu/presentations/oracle.pdf &quot;&gt;presentation&lt;/a&gt; of somebody at the PSU.
&lt;/p&gt;

&lt;p&gt;
It seems that lists of conferences with a dubious reputation (also known as fake conferences) are impossible to keep up. I've seen a few lists in the past, but they've all disappeared. What interests me is why those lists are taken down. The most well known list, by Arlindo Oliveira, was &lt;a href=&quot;http://www.inesc-id.pt/~aml/trash.html&quot;&gt;taken down&lt;/a&gt; after receiving threats by conference organizers. I've never quite understood that: how serious can such a threat be? Maybe they'll publish a random paper with my name? They'll put me on the program committee next year?
&lt;/p&gt;

&lt;p&gt;
So well, here we go. Let's see what happens.
&lt;/p&gt;

&lt;p&gt;
Notice: IeCCS is not fake. It is very real!
&lt;/p&gt;</description>
	<pubDate>Tue, 03 Jun 2008 07:14:55 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: The Nix Build Farm: A Declarative Approach to Continuous Integration</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/83-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/83-The-Nix-Build-Farm-A-Declarative-Approach-to-Continuous-Integration.html</link>
	<description>The paper &quot;The Nix Build Farm: A Declarative Approach to Continuous Integration&quot; by Eelco Dolstra  and Eelco Visser
has been accepted for presentation at the
&lt;a href=&quot;http://smallwiki.unibe.ch/wasdett2008/&quot;&gt;International Workshop on Advanced Software Development Tools and Techniques&lt;/a&gt;
co-located with &lt;a href=&quot;http://2008.ecoop.org/&quot;&gt;ECOOP 2008&lt;/a&gt; in 

&lt;p&gt;&lt;/p&gt;

The paper is the first to come out of the 3TU CEDICT &lt;a href=&quot;http://blog.eelcovisser.net/index.php?/archives/36-Bootfarm.html&quot;&gt;buildfarm project&lt;/a&gt; (which badly needs a webpage).

&lt;p&gt;&lt;/p&gt;

Abstract:
There are many tools to support continuous integration (the process of
automatically and continuously building a project from a version
management repository).  However, they do not have good support for
variability in the build environment: dependencies such as compilers,
libraries or testing tools must typically be installed manually on all
machines on which automated builds are performed.  The &lt;em&gt;Nix
  package manager&lt;/em&gt; solves this problem: it has a purely functional
language for describing package build actions and their dependencies,
allowing the build environment for projects to be produced
automatically and deterministically.  We have used Nix to build a
continuous integration tool, the &lt;em&gt;Nix build farm&lt;/em&gt;, that is in use
to continuously build and release a large set of projects.</description>
	<pubDate>Mon, 26 May 2008 20:44:43 +0000</pubDate>
</item>
<item>
	<title>Karl Trygve Kalleberg: Create-a-Project: Creating Stratego/XT projects the simple way</title>
	<guid>http://journal.boblycat.org/3063 at http://journal.boblycat.org</guid>
	<link>http://journal.boblycat.org/node/3063</link>
	<description>&lt;p&gt;This last week, I spent some free cycles hacking together a small project instantiation tool for Stratego/XT. It makes setting up a fresh Stratego project really simple by automatically populating the project space with a default directory layout, build system files and some minimal program and syntax samples. &lt;/p&gt;
&lt;p&gt;To create a project &lt;tt&gt;p0&lt;/tt&gt;, all you have to do is:&lt;/p&gt;
&lt;pre&gt;
$ crap --new-project p0
&lt;/pre&gt;&lt;p&gt;
This creates all the files necessary for a complete GNU Autotools-based build system, including a sample Stratego program (&lt;tt&gt;src/xmpl.str&lt;/tt&gt;):&lt;/p&gt;
&lt;pre&gt;
p0/
   Makefile.am
   README.Developer
   README
   AUTHORS
   bootstrap
   p0.spec.in
   NEWS
   p0.pc.in
   configure.ac
   ChangeLog
   xmpl/
        Makefile.am
   syn/
       Makefile.am
   tests/
         Makefile.am
   src/
       Makefile.am
       xmpl.str
&lt;/pre&gt;&lt;p&gt;
Once this is done, you can configure and compile the project,&lt;/p&gt;
&lt;pre&gt;
$ ./bootstrap
$ ./configure
$ make all
&lt;/pre&gt;&lt;p&gt;
install it,&lt;/p&gt;
&lt;pre&gt;
$ make install
&lt;/pre&gt;&lt;p&gt;
and even run the example transformation program:&lt;/p&gt;
&lt;pre&gt;
$ echo &quot;foo&quot; | /usr/local/bin/xmpl
&quot;Hello, World!&quot;
&lt;/pre&gt;&lt;p&gt;
The example program expects an input on &lt;tt&gt;stdin&lt;/tt&gt; [or in a file specified by the &lt;tt&gt;-i&lt;/tt&gt; switch], and will always produce the output string &lt;tt&gt;&quot;Hello, World!&quot;&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;tt&gt;crap&lt;/tt&gt; tool is part of the &lt;a href=&quot;http://releases.strategoxt.org/strategoxt-utils/strategoxt-utils-unstable/&quot;&gt;strategoxt-utils&lt;/a&gt; package. You can also download a &lt;a href=&quot;http://releases.spoofax.org/tools/&quot;&gt;stand-alone snapshot of &lt;tt&gt;crap&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;More comprehensive &lt;a href=&quot;http://strategoxt.org/Stratego/SimpleProjectCreation&quot;&gt; documentation&lt;/a&gt; is available in the wiki.  The tool is still very rough, so any &lt;a href=&quot;https://mail.cs.uu.nl/mailman/listinfo/stratego&quot;&gt;suggestions&lt;/a&gt; for improvements and &lt;a&gt;bug reports&lt;/a&gt; are very welcome. &lt;/p&gt;</description>
	<pubDate>Sat, 24 May 2008 14:40:31 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: OOPSLA'08 tutorial: Building Domain-Specific Languages for the Web</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/78-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/78-OOPSLA08-tutorial-Building-Domain-Specific-Languages-for-the-Web.html</link>
	<description>&lt;a href=&quot;http://www.oopsla.org/oopsla2008/&quot; border=&quot;0&quot;&gt;&lt;img src=&quot;http://www.oopsla.org/oopsla2008/templates/oopsla2008-2/images/header-oopsla2008_logo_only_colour.png&quot; align=&quot;right&quot; /&gt;&lt;/a&gt;

Just got word that my proposal for an &lt;a href=&quot;http://www.oopsla.org/oopsla2008/&quot;&gt;OOPSLA&lt;/a&gt; 
&lt;a href=&quot;http://www.oopsla.org/oopsla2008/cfp/cfp-tutorials.html&quot;&gt;tutorial&lt;/a&gt; has been accepted.
So make sure to register for it if you are planning to attend the conference.

&lt;p&gt;&lt;/p&gt;

Abstract: Implementing web applications in an object-oriented language such as
Java using state-of-the-art frameworks produces robust software, but
involves a lot of boilerplate code.  Domain-specific languages (DSLs)
increase the productivity of software engineers by replacing such
low-level boilerplate code by high-level models, from which code can
be generated.  This tutorial shows how to find domain-specific
abstractions based on patterns in existing (reference) programs and
build domain-specific languages to capture these abstraction using
several DSLs for 
&lt;a href=&quot;http://blog.eelcovisser.net/index.php?/archives/77-WebDSL-A-Case-Study-in-Domain-Specific-Language-Engineering.html&quot;&gt;DSL engineering&lt;/a&gt;: 
&lt;a href=&quot;http://syntax-definition.org&quot;&gt;SDF&lt;/a&gt; 
for syntax definition and
&lt;a href=&quot;http://strategoxt.org&quot;&gt;Stratego/XT&lt;/a&gt; 
for code generation. The approach is illustrated using the
design and implementation of 
&lt;a href=&quot;http://webdsl.org&quot;&gt;WebDSL&lt;/a&gt;, 
a domain-specific language for
web applications, which provides abstractions for data models, page
definitions, 
&lt;a href=&quot;http://blog.eelcovisser.net/index.php?/archives/74-Declarative-Access-Control-for-WebDSL.html&quot;&gt;access control&lt;/a&gt;, 
workflow, and styling.  The tutorial will
show how 
&lt;a href=&quot;http://blog.eelcovisser.net/index.php?/archives/72-Code-Generation-by-Model-Transformation.html&quot;&gt;code generation by model transformation&lt;/a&gt; 
is an important technique for separation of concerns in DSL implementations
for designing a DSL as a tower of abstractions, rather than as a
monolithic language.</description>
	<pubDate>Tue, 13 May 2008 19:28:20 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: WebDSL: A Case Study in Domain-Specific Language Engineering</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/77-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/77-WebDSL-A-Case-Study-in-Domain-Specific-Language-Engineering.html</link>
	<description>About &lt;a href=&quot;http://blog.eelcovisser.net/index.php?/archives/45-Domain-Specific-Language-Engineering.html&quot;&gt;fifteen months ago&lt;/a&gt; I announced 
my ``Domain-Specific Language Engineering'' project that would result in a tutorial for the &lt;a href=&quot;http://www.di.uminho.pt/GTTSE2007&quot;&gt;GTTSE'07 summerschool&lt;/a&gt;. &quot;This tutorial gives an overview of all aspects of DSL engineering: domain analysis, language design, syntax definition, code generation, deployment, and evolution, discussing research challenges on the way. The concepts are illustrated with DSLs for web applications built using several DSLs for DSL engineering: SDF for syntax definition, Stratego/XT for code generation, and Nix for software deployment.&quot; A rather bold statement, since at time I didn't have a DSL, yet. But  I did manage to design and implement a first version of &lt;a href=&quot;http://webdsl.org&quot;&gt;WebDSL&lt;/a&gt; before the summerschool in July 2007. I also wrote a paper for the participants proceedings. That version discussed the design process from analyzing programming patterns in Seam/JSF/Java to the design and implementation of the DSL using SDF and Stratego. (I never got around to the deployment part; Sander van der Burg has by now developed &lt;a href=&quot;http://nixos.org&quot;&gt;Nix&lt;/a&gt; expressions for building and deploying a WebDSL application on a web server.) 

&lt;p&gt;&lt;/p&gt;

Now I have finished the 
&lt;a href=&quot;http://swerl.tudelft.nl/twiki/pub/Main/TechnicalReports/TUD-SERG-2008-023.pdf&quot;&gt;
final version of the paper
&lt;/a&gt;
for the proceedings to be published by Springer. 
The discussion of the WebDSL design and implementation has been much improved.
But more importantly, the paper has two introductory sections about the 'domain-specific language engineering' process
and three discussion sections evaluating WebDSL as a web engineering solution,  discussing related DSL engineering approaches,
and research challenges for language engineering.
The resulting paper counts 85 pages (LNCS format) and 109 references. 
And still, it is only scratching the surface.

&lt;p&gt;&lt;/p&gt;

There is so much more to say about DSL design and implementation.
The last couple of months I have been teaching a course on 
&lt;a href=&quot;http://webdsl.org/webdslorg/page/ProgramTransformationAndGeneration&quot;&gt;program transformation and generation&lt;/a&gt;
in which we have explored paradigms for expressing analysis and transformation. 
During this time I have been contemplating how to structure the course entitled &quot;&lt;a href=&quot;http://swerl.tudelft.nl/bin/view/EelcoVisser/MDSD&quot;&gt;model-driven software development&lt;/a&gt;&quot; 
that I'll be teaching next year to a much larger group of master's students.
I haven't resolved the issue yet.
But my project for the next 10 months will be to write a comprehensive set of lecture notes (let's call it a book) on 
&quot;&lt;a href=&quot;http://swerl.tudelft.nl/bin/view/EelcoVisser/DomainSpecificLanguageEngineering&quot;&gt;domain-specific language engineering&lt;/a&gt;&quot;
covering methods and techniques for designing and implementing 
&lt;a href=&quot;http://blogs.msdn.com/ralflammel/archive/2008/03/27/about-the-fundamental-notion-of-software-languages.aspx&quot;&gt;software languages&lt;/a&gt;,
in particular,  of course domain-specific languages. In all likelihood, languages for the web will again play a central role as examples.

&lt;p&gt;&lt;/p&gt;

E. Visser. 
&lt;a href=&quot;http://swerl.tudelft.nl/twiki/pub/Main/TechnicalReports/TUD-SERG-2008-023.pdf&quot;&gt;
WebDSL: A Case Study in Domain-Specific Language Engineering.&lt;/a&gt;
In R. Laemmel, J. Saraiva, and J. Visser, editors,
&lt;a href=&quot;http://www.di.uminho.pt/GTTSE2007&quot;&gt;Generative and Transformational Techniques in Software Engineering
(GTTSE 2007)&lt;/a&gt;, Lecture Notes in Computer Science. Springer,
2008. Tutorial for International Summer School GTTSE 2007.
[&lt;a href=&quot;http://swerl.tudelft.nl/twiki/pub/Main/TechnicalReports/TUD-SERG-2008-023.pdf&quot;&gt;pdf&lt;/a&gt;]

&lt;p&gt;&lt;/p&gt;

Abstract:
The goal of domain-specific languages (DSLs) is to increase the
productivity of software engineers by abstracting from low-level
boilerplate code.  Introduction of DSLs in the software development
process requires a smooth workflow for the production of DSLs
themselves. This requires technology for designing and implementing
DSLs, but also a methodology for using that technology. That is, a
collection of guidelines, design patterns, and reusable DSL components
that show developers how to tackle common language design and
implementation issues.  This paper presents a case study in
domain-specific language engineering. It reports on a project in which
the author designed and built WebDSL, a DSL for web applications with
a rich data model, using several DSLs for DSL engineering: SDF for
syntax definition and Stratego/XT for code generation. The paper
follows the stages in the development of the DSL. The contributions of
the paper are three-fold.  (1) A tutorial in the application of the
specific SDF and Stratego/XT technology for building DSLs.  (2) A
description of an incremental DSL development process.  (3) A
domain-specific language for web-applications with rich data models.
The paper concludes with a survey of related approaches.</description>
	<pubDate>Sun, 11 May 2008 14:18:00 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: Stratego: 10 years</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/76-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/76-Stratego-10-years.html</link>
	<description>&lt;pre&gt;
-------------------------------------------------------------------------
Dear author,

We are pleased to inform you that your paper entitled

     &lt;a href=&quot;http://doi.acm.org/10.1145/289423.289425&quot;&gt;Building Program Optimizers with Rewriting [Strategies]&lt;/a&gt;

has been accepted for presentation at ICFP'98. In a next message, you
will receive reviews from the Program Committee that we hope you can
use to improve the final draft, which is due on July 14th. We will
also be sending you an ACM Copyright Release form, which must be
signed and returned by the same deadline.

Congratulations, and thank you for your submittal to ICFP'98.

  Paul Hudak
  Christian Queinnec
  co-Chairs, ICFP'98 Program Committee
-------------------------------------------------------------------------
&lt;/pre&gt;

The text of an email from June 21, 1998 that announced the acceptance at ICFP'98 of the first paper on &lt;a href=&quot;http://strategoxt.org&quot;&gt;Stratego&lt;/a&gt; written with Zino Benaissa and &lt;a href=&quot;http://web.cecs.pdx.edu/~apt/&quot;&gt;Andrew Tolmach&lt;/a&gt;.
The implementation of the language for the paper marked the first version of the language and compiler. 
The idea of traversal strategies had been done before embedded in ASF+SDF.
Just before the conference in September I managed to bootstrap the compiler.
The language did not have a name in that paper yet. 
And the reviews were not very enthusiastic.</description>
	<pubDate>Thu, 08 May 2008 18:54:23 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: Declarative Access Control for WebDSL</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/74-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/74-Declarative-Access-Control-for-WebDSL.html</link>
	<description>The paper &quot;&lt;a href=&quot;http://swerl.tudelft.nl/twiki/pub/Main/TechnicalReports/TUD-SERG-2008-021.pdf&quot;&gt;Declarative Access Control for WebDSL: Combining Language Integration and Separation of Concerns&lt;/a&gt;&quot; by Danny Groenewegen and &lt;a href=&quot;http://www.eelcovisser.net/&quot;&gt;Eelco Visser&lt;/a&gt; has been accepted for presentation at the &lt;a href=&quot;http://icwe2008.webengineering.org/&quot;&gt;International Conference on Web Engineering (ICWE'08)&lt;/a&gt;, which will be held in July 2008 in Yorktown Heights, New York. [&lt;a href=&quot;http://swerl.tudelft.nl/twiki/pub/Main/TechnicalReports/TUD-SERG-2008-021.pdf&quot;&gt;pdf&lt;/a&gt;]

&lt;p&gt;&lt;/p&gt;

I'm especially proud of this acceptance as it is (1) based on the Master's thesis work of Danny Groenewegen, 
and (2) the first paper about WebDSL to be accepted in the web engineering research community. (And also the first attempt; the other two papers featuring WebDSL appear in transformation venues.)

&lt;p&gt;&lt;/p&gt;

Abstract: 
In this paper, we present the extension of WebDSL, a domain-specific
language for web application development, with abstractions for
declarative definition of access control.  The extension supports the
definition of a wide range of access control policies concisely and
transparently as a separate concern.  In addition to regulating the
access to pages and actions, access control rules are used to infer
navigation options not accessible to the current user, preventing the
presentation of inaccessible links.  The extension is an illustration
of a general approach to the design of domain-specific languages for
different technical domains to support separation of concerns in
application development, while preserving linguistic integration. This
approach is realized by means of a transformational semantics that
weaves separately defined aspects into an integrated implementation.</description>
	<pubDate>Fri, 04 Apr 2008 20:27:50 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: Code Generation by Model Transformation</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/72-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/72-Code-Generation-by-Model-Transformation.html</link>
	<description>The paper &quot;&lt;a href=&quot;http://swerl.tudelft.nl/twiki/pub/Main/TechnicalReports/TUD-SERG-2008-012.pdf&quot;&gt;Code Generation by Model Transformation&lt;/a&gt;&quot; by &lt;a href=&quot;http://www.zefhemel.com/&quot;&gt;Zef Hemel&lt;/a&gt;, &lt;a href=&quot;http://www.lclnet.nl/&quot;&gt;Lennart Kats&lt;/a&gt;, and &lt;a href=&quot;http://www.eelcovisser.net&quot;&gt;Eelco Visser&lt;/a&gt; was accepted for presentation at the &lt;a href=&quot;http://www.model-transformation.org/ICMT2008/&quot;&gt;International Conference on Model Transformation (ICMT'08)&lt;/a&gt;. 

&lt;p&gt;&lt;/p&gt;

&lt;a href=&quot;http://www.flickr.com/photos/eelcovisser/2307242274/&quot; title=&quot;elated by Eelco Visser, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2109/2307242274_21f8402298_m.jpg&quot; width=&quot;240&quot; height=&quot;160&quot; alt=&quot;elated&quot; align=&quot;right&quot; /&gt;&lt;/a&gt;

Abstract: The realization of model-driven software development requires
effective techniques for implementing code generators.  In this paper,
we present a case study of code generation by model transformation
with Stratego, a high-level transformation language based on the
paradigm of rewrite rules with programmable strategies that integrates
model-to-model, model-to-code, and code-to-code transformations.  The
use of concrete object syntax guarantees syntactic correctness of code
patterns, and supports the subsequent transformation of generated
code.  The composability of strategies supports two dimensions of
transformation modularity.  Vertical modularity is achieved by
designing a generator as a pipeline of model-to-model transformations
that gradually transforms a high-level input model to an
implementation.  Horizontal modularity is achieved by supporting the
definition of plugins which implement all aspects of a language
feature.  We discuss the application of these techniques in the
implementation of WebDSL, a domain-specific language for dynamic web
applications with a rich data model.</description>
	<pubDate>Wed, 19 Mar 2008 11:14:57 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: Attribute Grammars in Stratego II</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/73-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/73-Attribute-Grammars-in-Stratego-II.html</link>
	<description>Today we had a follow up on last weeks discussion about an attribute grammar extension of Stratego. By now, Nicolas Pierron has created a proper extension of Stratego with attribute equations and made a translation to basic Stratego in combination with the Transformers run-time extension for attribute evaluation support. Next up is the port of the copy rules generator that makes writing attribute equations much less verbose. In the meantime Lennart Kats is working on a JastAdd style implementation and Tony Sloane on a Eli-style (static scheduling) implementation. With these implementations in place we will be able to do some proper exploration of the combination of attribute evaluation and rewriting (strategies). I can't wait to make an implementation of the WebDSL typechecker using the attribute extension. To be continued.</description>
	<pubDate>Tue, 18 Mar 2008 11:21:00 +0000</pubDate>
</item>
<item>
	<title>Karl Trygve Kalleberg: Proper navigation support for Spoofax</title>
	<guid>http://journal.boblycat.org/2942 at http://journal.boblycat.org</guid>
	<link>http://journal.boblycat.org/node/2942</link>
	<description>&lt;p&gt;I finally figured out how to add proper navigation history support to &lt;a href=&quot;http://spoofax.org&quot;&gt;Spoofax&lt;/a&gt; today. This one has been bugging me for quite some time. I remember spending far too much time diving through the documentation with the hopes of figuring out how this should be done properly. No luck.&lt;/p&gt;
&lt;p&gt;Today I had a flash of inspiration, so I dug into the JDT code base. That code seemed to solve the same problem in a very complicated way, so I didn't want to copy their approach outright. Stymied, I started tracing exactly what happens with the navigation history when positions are placed into it. After a bit of fiddling around, I figured out that when I move the cursor, I should mark the position both &lt;i&gt;before&lt;/i&gt; and &lt;i&gt;after&lt;/i&gt; the cursor/focus moves to get the behaviour of JDT (which I tried to emulate). I've always only tried saving the editor location state either before I changed it, or afterwards. I also tried all kinds of alternative calls on the &lt;tt&gt;EditorPart&lt;/tt&gt; hierarchy in vain. I now use &lt;tt&gt;ITextEditor.setHighlightRange()&lt;/tt&gt; which appears to do the job, provided I call &lt;tt&gt;markInNavigatorHistory()&lt;/tt&gt; &quot;properly&quot;.&lt;/p&gt;
&lt;p&gt;Anyway, the lesson is simple: if you call &lt;tt&gt;AbstractTextEditor.markInNavigationHistory()&lt;/tt&gt;, remember to do it twice -- once before you change the editor/focus and once afterwards.&lt;/p&gt;</description>
	<pubDate>Fri, 14 Mar 2008 16:46:03 +0000</pubDate>
</item>
<item>
	<title>Karl Trygve Kalleberg: Porting Eclipse IMP from Eclipse 3.2 to 3.3</title>
	<guid>http://journal.boblycat.org/2940 at http://journal.boblycat.org</guid>
	<link>http://journal.boblycat.org/node/2940</link>
	<description>&lt;p&gt;&lt;p&gt;It's official: I'm the bootstrapper. My hacking life in the last few weeks have hardly been anything but bootsrapping. I've already said a few things about the &lt;a href=&quot;http://journal.boblycat.org/node/2937&quot;&gt;Stratego compiler hacking&lt;/a&gt;. Since it takes ~3-4 hours for a full build of the Stratego compiler in the &lt;a href=&quot;http://buildfarm.st.ewi.tudelft.nl/releases/strategoxt/&quot;&gt;Delft buildfarm&lt;/a&gt;, I've had a couple of other projects to dive into in parallell. One of these has been the porting of &lt;a href=&quot;http://www.eclipse.org/imp/&quot;&gt;Eclipse IMP&lt;/a&gt; from Eclipse 3.2 to 3.3. &lt;/p&gt;
&lt;p&gt;In short, IMP is an IDE generator based on Eclipse. It provides set of plugins and wizards that makes the development of programming language environments (a lot) easier. The basic workflow when building an IDE for you favourite language with IMP is, (1) provide a grammar defined using the LPG grammar language, (2) use the IMP-provided wizards inside Eclipse to generate things like syntax highlighting support, outline support, code folding support, templates, text hovers, etc, then (3) fill in the skeletons provided by the generator. My personal view (subject to change without warning) of the generated code is that it's a guide to which parts of the Eclipse framework you need to extend in order to provide a given piece of functionality. Sort of a little helpful gnome pointing you in the right direction. In some cases, the generated code will actually do all you want, but more often than not, you will want to go beyond it.&lt;/p&gt;
&lt;p&gt;That was the backgrounder on IMP. A major drawback of the current IMP releases is that they will only work on 3.2. Oh, and, of course, that IMP requires IMP to build IMP. Getting this beast ported to 3.3 wasn't as straightforward as I'd hoped. It took a few iterations. The first was getting it to build properly without any problems on my plain 3.2 installation. That took me several days. All kinds of subtle bugs surfaced, presumably because I have a different set of development habits than the IMPers. &lt;/p&gt;
&lt;p&gt;Once those were patched and fixed upstream, I managed to bootstrap my first version on 3.2. An ensuing battle with race conditions in the startup code of various plug-ins followed. I hate static initializers, but apparently not everybody does. In a multi-plugin architecture where the order to plugin loading is not guaranteed, I cannot see how you can safely assume the order of static initializers across plugins, but those questions are not for me to ponder. I ripped them out, and  replaced them with lazy initializers as far as possible, and that worked wonders. With that hurdle out of the way, it was all down hill: a couple of internal JFace and JDT classes had changed locations and APIs between 3.2 and 3.3, but it was quick enough to rewrite the offending code (another reason why depending on internal APIs is a bitch, though I realize that the features in question could not have been provided without doing so).&lt;/p&gt;
&lt;p&gt;It's a huge disappointment to realize that &lt;a href=&quot;https://bugs.eclipse.org/bugs/show_bug.cgi?id=221887&quot;&gt;my patches&lt;/a&gt; are only a couple of  hundreds of lines. I felt like I had to rewrite the world, at places... Anyway, here's hoping to its inclusion in one of the pending releases. I've updated our &lt;a href=&quot;http://blog.eelcovisser.net/index.php?/archives/65-Generating-Editors-for-Embedded-Languages.html&quot;&gt;sdf2imp&lt;/a&gt; tool to use the 3.3-based IMP, so we're already seeing a return on my investment:)&lt;/p&gt;
&lt;br class=&quot;giImageBlock-clear-both&quot; /&gt;&lt;/p&gt;</description>
	<pubDate>Thu, 13 Mar 2008 16:33:24 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: Attribute Grammars in Stratego</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/71-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/71-Attribute-Grammars-in-Stratego.html</link>
	<description>This morning I gave my very first lecture on attribute grammars, featuring Knuth's binary numbers AG (ripped from the &lt;a href=&quot;http://jastadd.org&quot;&gt;jastadd.org&lt;/a&gt; site), and my own implementation of WebDSL data models in JastAdd. In the &lt;a href=&quot;http://www.st.ewi.tudelft.nl/~eelco/ptg/06-rags.pdf&quot;&gt;slides&lt;/a&gt; I explored the implementation of model of JastAdd by including the code it generates. While I had not added any JastAdd code since last week, the presentation further improved my understanding what is going in JastAdd. At the same time, I'm realizing I do not fully understand the design space we are considering, and the distinction between notational and essential differences between the various approaches.

&lt;p&gt;&lt;/p&gt;

In the afternoon,  
Nicolas Pierron, a student from the Transformers group at Epita who is doing an internship in Delft, showed the code of his implementation of WebDSL typechecking in the Transformers SDF attribute grammar extension, which is implemented by generating Stratego code with some native code  hacks. The hacks basically implement thunks of deferred attribute evaluations for nodes in the tree with pointers to dependent attribute value thunks. Attributes are then evaluated on demand, and thus no static scheduling is done. This approach is essentially the same as that of the encoding of attribute grammars in a lazy functional language such as Haskell (a hobby of my former colleagues in Utrecht). If we would just add heap-bound closures to Stratego, implementing this pattern would become that much easier. 

The Transformers AG code operates on ATerms without sharing.  Again, I'm not sure about the implications of this design choice. Are the Stratego libraries at all usable without maximal sharing? I guess I should ask Nicolas tomorrow.

To be continued.</description>
	<pubDate>Tue, 11 Mar 2008 21:41:11 +0000</pubDate>
</item>
<item>
	<title>Karl Trygve Kalleberg: Stack tracing improvements</title>
	<guid>http://journal.boblycat.org/2937 at http://journal.boblycat.org</guid>
	<link>http://journal.boblycat.org/node/2937</link>
	<description>&lt;p&gt;A limitation of my previous stack tracing patches was that &lt;tt&gt;io-wrap&lt;/tt&gt; and &lt;tt&gt;io-stream-wrap&lt;/tt&gt; did not properly report traces on failure. The reason for this is easy to spot if we look at how the error is handled (this is where execution flow ends up when you call &lt;tt&gt;io-wrap&lt;/tt&gt;):&lt;/p&gt;
&lt;pre&gt;
  option-wrap(opts, usage, about, announce, s) =
    parse-options(opts, usage, about)
    ; announce
    ; (s; report-success + report-failure)

  report-failure =
      report-run-time
    ; &amp;lt;fprintnl&amp;gt; (stderr(), [ (), &quot;: rewriting failed&quot;])
    ; &amp;lt;exit&amp;gt; 1

&lt;/pre&gt;&lt;p&gt;
As you can imagine, even though the program now happily prints a stack trace when the main strategy exits with a failure, it will not be printed when &lt;tt&gt;exit&lt;/tt&gt; is called.&lt;/p&gt;
&lt;p&gt;I've introduced a couple of stack introspection functions for dealing with this: &lt;tt&gt;stacktrace-get-current-frame-name&lt;/tt&gt; returns the name of the current frame  s, &lt;tt&gt;stacktrace-get-all-frame-names&lt;/tt&gt; returns a list of all frame names and,  &lt;tt&gt;stacktrace-get-current-frame-index&lt;/tt&gt; returns integer that holds the current depth of the stack. These are actually implemented by primitives in the Stratego Standard Library (SSL).&lt;/p&gt;
&lt;p&gt;A caveat of these strategies is that calling them will of course alter the stack. Even in the wonderful world of computing, we're not entirely free of Heisenbergian effects, apparently. However, there's a simple workaround: call the primitives directly, since this bypasses the way the compiler registers the stack frames. &lt;/p&gt;
&lt;p&gt;With this trick in hand, I rewrote the two above strategies to include proper stack tracing for &lt;tt&gt;io-wrap&lt;/tt&gt;:&lt;/p&gt;
&lt;pre&gt;
  option-wrap(opts, usage, about, announce, s) =
    parse-options(opts, usage, about)
    ; announce
    ; (s; report-success + prim(&quot;SSL_stacktrace_get_all_frame_names&quot;) ; report-failure)

  report-failure =
      ?stacktrace
    ; report-run-time
    ; &amp;lt;fprintnl&amp;gt; (stderr(), [ &amp;lt;whoami&amp;gt; (), &quot;: rewriting failed, trace:&quot;])
    ; &amp;lt;reverse ; map(&amp;lt;fprintnl&amp;gt; (stderr(), [&quot;\t&quot;, &amp;lt;id&amp;gt;]))&amp;gt; stacktrace
    ; &amp;lt;exit&amp;gt; 1
&lt;/pre&gt;&lt;p&gt;
Applying the modified &lt;tt&gt;io-wrap&lt;/tt&gt; on the following sample program&lt;/p&gt;
&lt;pre&gt; 
  main = io-wrap(my-wrap(foo))

  my-wrap(s) = s

  foo = debug(!&quot;foo&quot;) ; bar

  bar = debug(!&quot;bar&quot;) ; fap ; zap

  fap = debug(!&quot;fap&quot;) ; id

  zap = debug(!&quot;zap&quot;) ; debug ; fail
&lt;/pre&gt;&lt;p&gt;
gives&lt;/p&gt;
&lt;pre&gt;
./prog: rewriting failed, trace:
        main_0_0
        io_wrap_1_0
        option_wrap_5_0
        lifted144
        input_1_0
        lifted145
        output_1_0
        lifted0
        my_wrap_1_0
        foo_0_0
        bar_0_0
        zap_0_0
&lt;/pre&gt;&lt;p&gt;
Due to the compiler lifting inner strategies into freshly named, top-level strategies, the trace will contain some &lt;tt&gt;lifted*&lt;/tt&gt; entries. Also, should you call strategies or rules which are compiled with older versions of the compiler, there will be &quot;dark spots&quot; in your trace. It won't be truncated -- only the frames due to the old library will be hidden.&lt;/p&gt;</description>
	<pubDate>Tue, 11 Mar 2008 13:05:40 +0000</pubDate>
</item>
<item>
	<title>Karl Trygve Kalleberg: Would you like a stack trace with your "rewriting failed"?</title>
	<guid>http://journal.boblycat.org/2934 at http://journal.boblycat.org</guid>
	<link>http://journal.boblycat.org/node/2934</link>
	<description>&lt;p&gt;Prompted by &lt;a href=&quot;http://journal.boblycat.org/node/2913&quot;&gt;my visit to EPITA&lt;/a&gt;,  I hacked together some very basic support for stack traces in Stratego that might come in handy when a Stratego program fails.&lt;/p&gt;
&lt;p&gt;Here's a simple Stratego program, called &lt;tt&gt;prog&lt;/tt&gt; (which, if you look at it closely, will always fail):&lt;/p&gt;
&lt;pre&gt;
  main = foo

  foo = bar

  bar = fap ; zap

  fap = id

  zap = fail
&lt;/pre&gt;&lt;p&gt;
On the latest and greatest version of the compiler (&lt;a href=&quot;http://buildfarm.st.ewi.tudelft.nl/releases/strategoxt/strategoxt-0.17M3pre17522/&quot;&gt;build 17522&lt;/a&gt; and later), you will get the following trace when this program is executed:&lt;/p&gt;
&lt;pre&gt;
prog: rewriting failed, trace:
        main_0_0
        foo_0_0
        bar_0_0
        zap_0_0 
&lt;/pre&gt;&lt;p&gt;
There are a number of caveats with the tracing that I will try to get rid of, and, when there are only very hard problems left, explain myself out of, in a couple of future posts. &lt;/p&gt;</description>
	<pubDate>Mon, 10 Mar 2008 16:49:24 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: WebDSL in JastAdd</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/69-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/69-WebDSL-in-JastAdd.html</link>
	<description>Earlier this week I was visiting the Programming Tools Group of 
&lt;a href=&quot;http://progtools.comlab.ox.ac.uk/members/oege&quot;&gt;Oege de Moor&lt;/a&gt; in Oxford.
The visit was associated with the refactoring project in which I am an official collaborator.
The project aims at studying the high-level description of refactorings.
The starting point is to combine the strengths of program analysis with attribute grammars
and program transformation with (strategic) rewriting based approaches. 
They are experimenting with the &lt;a href=&quot;http://www.jastadd.org&quot;&gt;JastAdd&lt;/a&gt;-based Java compiler. 
For me the project is interesting as we are considering to integrate attribute grammars in Stratego.
To start exploring this topic I've started writing an implementation of &lt;a href=&quot;http://www.webdsl.org&quot;&gt;WebDSL&lt;/a&gt; in JastAdd together
with &lt;a href=&quot;http://progtools.comlab.ox.ac.uk/members/torbjorn&quot;&gt;Torbjörn Ekman&lt;/a&gt;, 
the main developer op JastAdd, who is a postdoc in Oxford.
We got to implement a basic version of the data model sub-language complete with modules
and code generation (using the &lt;a href=&quot;htttp://www.stringtemplate.org&quot;&gt;StringTemplate&lt;/a&gt; library of Terence Parr). 
I'm planning to
finish the implementation of the data model and use that as the basis for my lecture on JastAdd
in the program transformation course. (And then hand the implementation to the students who
can then add the implementation of (a subset of) the UI language.)
We had further discussions about the relation of between JastAdd and Stratego; although quite
different at first sight,  there are interesting similarities (that I hadn't realised before). More to
follow about that in the future.</description>
	<pubDate>Thu, 28 Feb 2008 17:00:19 +0000</pubDate>
</item>
<item>
	<title>Karl Trygve Kalleberg: Visit to EPITA</title>
	<guid>http://journal.boblycat.org/2913 at http://journal.boblycat.org</guid>
	<link>http://journal.boblycat.org/node/2913</link>
	<description>&lt;p&gt;&lt;p&gt;I visited &lt;a href=&quot;http://www.lrde.epita.fr/cgi-bin/twiki/view/Main/AkimDemaille&quot;&gt;Akim Demaille&lt;/a&gt; and his posse at &lt;a href=&quot;http://www.epita.fr&quot;&gt;EPITA&lt;/a&gt; today, and apparently there still is such as thing as free lunch (although, in my excitement over the good food, I kinda promised to help out with fixing some Stratego issues they are experiencing, so it was not entirely without entanglements).&lt;/p&gt;
&lt;p&gt;I got to sit in on one of the bi-weekly status updates for the &lt;a href=&quot;http://www.lrde.epita.fr/&quot;&gt;LRDE&lt;/a&gt;. The room numbered a little under 30 people, including students and faculty. They were kind enough to hold the meeting in English so that I could follow it.  I found it surprising and very encouraging to have everybody report their progress (and, in a very few instances, lack thereof) in front of the entire lab. I've been missing this in many of the institutions I've been working at. It certainly increases the level of team feeling, and also makes it easier to uncover opportunities for collaboration between the various groups. For example, they all shared a lot of common infrastructure, including setups for newsgroups, a build farm, svn repos, etc. &lt;/p&gt;
&lt;p&gt;I met two of the guys from the &quot;previous&quot; Transformers generation, Florian and Maxime. Florian was putting the finishing touches on a visualization tool for ambiguities in Transformers' attributed parse trees. It looked pretty sweet. Maxime was hacking a translator from a DSL for their &lt;a href=&quot;http://www.lrde.epita.fr/cgi-bin/twiki/view/Olena/WebHome&quot;&gt;Olena&lt;/a&gt; image processing library.&lt;/p&gt;
&lt;p&gt;I also got to meet the new generation of Transformer students. I expect that I'll interact a lot more with them in the coming months, as they come to grips with Stratego.&lt;/p&gt;
&lt;br class=&quot;giImageBlock-clear-both&quot; /&gt;&lt;/p&gt;</description>
	<pubDate>Wed, 27 Feb 2008 17:55:33 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: WebDSL at Code Generation 2008</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/68-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/68-WebDSL-at-Code-Generation-2008.html</link>
	<description>My proposal for a tutorial on 'WebDSL: A Case Study in Domain-Specific Language Engineering' has been accepted by the organizers of &lt;a href=&quot;http://www.codegeneration.net/conference/&quot;&gt;Code Generation 2008&lt;/a&gt;.  This conference emerged from the &lt;a href=&quot;http://www.codegeneration.net/&quot;&gt;codegeneration.net&lt;/a&gt; site, which collects information about code generation techniques and tools.
As opposed to the conferences I usually visit, this one attracts quite a crowd from industry, I understand.
Last year's event was quite a success, according to attendees I talked to, so I'm looking forward to event in general,  
and the opportunity to present Stratego/XT, SDF, and WebDSL to industry, in particular. Now think how to squeeze that into 75 min;)</description>
	<pubDate>Thu, 21 Feb 2008 21:27:09 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: Pull Deployment of Services</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/64-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/64-Pull-Deployment-of-Services.html</link>
	<description>The &lt;a href=&quot;http://www.jacquard.nl&quot;&gt;NWO/EZ Jacquard Software Engineering Program&lt;/a&gt; has granted the project
&lt;a href=&quot;http://swerl.tudelft.nl/bin/view/Main/PDS&quot;&gt;Pull Deployment of Services&lt;/a&gt;
for an amount of 368K Euro which should pay for a PhD student (4 years) and a postdoc (3 years).
In the project for which I am principal investigator, we collaborate 
with Merijn de Jonge from Philips Research and the buildfarm project at TU Delft in which software
deployment expert Eelco Dolstra is postdoc. Here's the text from the proposal summary:

&lt;p&gt;

	Hospitals are complex organizations, requiring the
	coordination of specialists and support staff operating
	complex medical equipment, involving large data sets, to take
	care of the health of large numbers of patients.
	The information technology infrastructure of hospitals is
	heterogeneous and may consist of thousands of electronic
	devices, ranging from workstations to medical equipment such
	as MRI scanners. These devices are connected by wired and
	wireless networks with complex topologies with different
	security and privacy policies applicable to different nodes.
	Software deployment in such a heterogeneous environment is
	inherently difficult.
	In order to make health-care professionals more effective and
	deployment and maintenance more tractable, the hospital
	information technology infrastructure is changing from a
	device-oriented to a service-oriented environment, in which
	the access to services is decoupled from the physical access
	to particular devices.

&lt;p&gt;

	In this project, we propose a pull model for service deployment
	in which the components comprising a service are distributed
	over nodes in the network, depending on the network topology,
	properties of the application, and quality of service
	requirements.
	The goal of this project is to expand the state-of-the-art in
	software deployment to support pull deployment of services.
	In order to realize this goal we will conduct research in (1)
	modeling of services and network architectures, (2) technology
	for distributed deployment, and (3) tools for testing
	implementations of distributed services.
	We will build on our previous research in software deployment
	(Nix) and model-based software development (Stratego/XT).
	The project will be conducted in close collaboration with
	Philips as industrial partner and will consist of a series of
	experiments building prototype systems which implement service
	distribution scenarios of increasing complexity.&lt;/p&gt;&lt;/p&gt;</description>
	<pubDate>Wed, 13 Feb 2008 10:37:32 +0000</pubDate>
</item>
<item>
	<title>Karl Trygve Kalleberg: FOSDEM 2008</title>
	<guid>http://journal.boblycat.org/2874 at http://journal.boblycat.org</guid>
	<link>http://journal.boblycat.org/node/2874</link>
	<description>&lt;p&gt;&lt;p&gt;&lt;img src=&quot;http://www.fosdem.org/promo/going-to&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I'm going to &lt;a href=&quot;http://fosdem.org&quot;&gt;FOSDEM&lt;/a&gt; again this year. A bunch of old friends will be coming, so the opportunity is too good to pass up. Also, since I'll be in Paris at the time around FOSDEM, travel is both fast and reasonably cheap. (Three cheers for high speed trains.)&lt;/p&gt;
&lt;p&gt;If you're interested in meeting me there, don't hesitate to fire off an e-mail. There's no Gentoo room this year, so I'll be hanging around elsewhere. I'm bound to drop by the &lt;a href=&quot;http://www.fosdem.org/2008/schedule/devroom/freejava&quot;&gt;Free Java devroom&lt;/a&gt;, for sure:) Another gang I'm anxious to meet again are the &lt;a href=&quot;http://nix.cs.uu.nl&quot;&gt;Nix&lt;/a&gt; people.&lt;/p&gt;
&lt;br class=&quot;giImageBlock-clear-both&quot; /&gt;&lt;/p&gt;</description>
	<pubDate>Sun, 10 Feb 2008 13:27:13 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: Program Transformation &amp; Generation</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/66-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/66-Program-Transformation-Generation.html</link>
	<description>Today I started teaching a new master's course on &lt;a href=&quot;http://www.webdsl.org/webdslorg/page/ProgramTransformationAndGeneration&quot;&gt;Program Transformation &amp;amp; Generation&lt;/a&gt; at Delft University. The course studies techniques principles, techniques, applications of program transformation and generation. Using &lt;a href=&quot;http://www.webdsl.org/webdslorg/page/WebDSL&quot;&gt;WebDSL&lt;/a&gt; as case study, several paradigms for implementing domain-specific languages will be studied, including term rewriting (Stratego), attribute grammars (Eli, JastAdd), and graph transformation. This is a departure from earlier courses I taught at Utrecht University about same subject. There I would spend a full quarter teaching on just Stratego/XT, which I felt was necessary to prepare master's students for a master project in this area. With the current state of documentation of Stratego/XT, it appears that such a in depth course is no longer necessary. At least, that is the experience with several (PhD) students who recently started developing Stratego applications succesfully without any prior training.</description>
	<pubDate>Tue, 05 Feb 2008 20:30:00 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: Generating Editors for Embedded Languages</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/65-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/65-Generating-Editors-for-Embedded-Languages.html</link>
	<description>The paper &lt;em&gt;Generating Editors for Embedded Languages. Integrating SGLR into IMP&lt;/em&gt; by Lennart Kats, Karl Trygve Kalleberg, and Eelco Visser has been accepted by &lt;a href=&quot;http://ldta2008.inf.elte.hu/&quot;&gt;Language Descriptions, Tools, and Applications (LDTA'08)&lt;/a&gt; to be held in Budapest, Hungary in April 2008 as part of ETAPS'08. The paper reports on the succesful integration of the SGLR parser in the IMP framework for building language-specific Eclipse plugins. Through this integration the capability of SDF/SGLR to support language embedings is extended to the IDE. This project is a first step towards generation of full fledged IDEs from SDF/Stratego language definitions. From the abstract:

&lt;p&gt;

Integrated Development Environments (IDEs) increase productivity by
providing a rich user interface and rapid feedback for a specific
language. Creating an editor for a specific language is not a trivial
undertaking, and is a cumbersome task even when working with an
extensible framework such as Eclipse.  The IMP framework relieves the
IDE developer from a significant portion of the required work by
providing various abstractions for this.  For embedded % domain-specific
languages, such as embedded regular expressions, SQL queries, or code
generation templates, its LALR parser generator falls short, however.
Scannerless parsing with SGLR enables concise, modular definition of
such languages.  In this paper, we present an integration of SGLR into
IMP, demonstrating that a scannerless parser can be successfully
integrated into an IDE. Given an SDF syntax definition, the
\textsc{sdf2imp} tool automatically generates an editor plugin based
on the IMP API, complete with syntax checking, syntax highlighting,
outline view, and code folding.  Using declarative domain-specific
languages, these services can be customized, and using the IMP
metatooling framework it can be extended with other features.&lt;/p&gt;</description>
	<pubDate>Mon, 04 Feb 2008 14:15:00 +0000</pubDate>
</item>
<item>
	<title>Karl Trygve Kalleberg: New dissertation page and other Stratego updates</title>
	<guid>http://journal.boblycat.org/2855 at http://journal.boblycat.org</guid>
	<link>http://journal.boblycat.org/node/2855</link>
	<description>&lt;p&gt;&lt;p&gt;&lt;a href=&quot;http://martin.bravenboer.name/&quot;&gt;Martin&lt;/a&gt; recently got his &lt;a href=&quot;http://mbravenboer.blogspot.com/2008/01/phd-thesis-exercises-in-free-syntax.html&quot;&gt;PhD &lt;/a&gt;. It's very well deserved. I've seen first hand how serious and focused he's been for the last 4+ years. &lt;/p&gt;
&lt;p&gt;Inspired by his didactical skills, I decided to rearrange my own &lt;a href=&quot;http://www.ii.uib.no/~karltk/thesis/index.html&quot;&gt;dissertation page&lt;/a&gt; so that the individual chapters of my dissertation are easily downloadable.&lt;/p&gt;
&lt;p&gt;Since I don't expect anybody to have neither the time nor the inclination to read the entire thesis from start to finish, Martin's idea of making it available as a split download makes a lot of sense. &lt;/p&gt;
&lt;p&gt;Having done this, I got inspired to continue with spring (winter?) cleaning on a lot of other pieces of my PhD work. &lt;/p&gt;
&lt;p&gt;I've set up an Ant Ivy &lt;a href=&quot;http://www.ii.uib.no/~karltk/spoofax/ivy-repo/&quot;&gt;repository for Spoofax&lt;/a&gt;. This means that you are now able to check out the various Spoofax subprojects from the &lt;a href=&quot;https://svn.cs.uu.nl:12443/repos/StrategoXT/spoofax/trunk/spoofax/&quot;&gt;source code repository&lt;/a&gt; and expect each subproject to compile separately, since all its dependencies will be fetched from my Ivy repo. Some of the  subprojects require Eclipse. For those, you must run a script, fetch.sh, which will pick out the necessary jars from your Eclipse installation. It would best to have this repo hosted along with the rest of Stratego/XT, since it's definitely part of the Stratego/XT umbrella, but the new infrastructure in Delft is still being set up, I've been told.&lt;/p&gt;
&lt;p&gt;Trying my hand as a webmonkey, I've decided to upload new &lt;a href=&quot;http://www.spoofax.org&quot;&gt;Spoofax  pages&lt;/a&gt; with a revamped design. &lt;/p&gt;
&lt;p&gt;With those things out of the way, I'm now working on a reflection API for Stratego/J so that we may easily instantiate Java objects and call methods on them from Stratego scripts. This is needed for another project I'm cooking. However, I keep running into the lack of a fully interactive Stratego interpreter on the JVM, and that's a very itchy spot just now...;)&lt;/p&gt;
&lt;br class=&quot;giImageBlock-clear-both&quot; /&gt;&lt;/p&gt;</description>
	<pubDate>Mon, 28 Jan 2008 20:23:48 +0000</pubDate>
</item>
<item>
	<title>Martin Bravenboer: Ph.D. Thesis: Exercises in Free Syntax</title>
	<guid>tag:blogger.com,1999:blog-6943366.post-1613880718242304738</guid>
	<link>http://mbravenboer.blogspot.com/2008/01/phd-thesis-exercises-in-free-syntax.html</link>
	<description>&lt;p&gt;
It has been awfully quiet here, I'm sorry about that. There are a few reasons for that. The first one is that I assembled my PhD thesis from my publications. This took quite some time and energy, but the result is great! My dissertation &lt;a href=&quot;http://martin.bravenboer.name/thesis.html&quot;&gt;Exercises Free Syntax&lt;/a&gt; is available online. If you are interested in having dead tree version, just let me know!
&lt;/p&gt;

&lt;p&gt;
I will defend my thesis tomorrow, January 21 (see the Dutch &lt;a href=&quot;http://applicaties.csc.uu.nl/uupona/bekijkpromotie.cfm?npromotieid=1972&quot;&gt;announcement&lt;/a&gt;). It's weird to realize that tomorrow is the accumulation of 4 years of working intensely!
&lt;/p&gt;

&lt;p&gt;
For the library I created an English abstract. To give you an idea what the thesis is about, let me quote it here:
&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;
In modern software development the use of multiple software languages
to constitute a single application is ubiquitous. Despite the
omnipresent use of combinations of languages, the principles and
techniques for using languages together are ad-hoc, unfriendly to
programmers, and result in a poor level of integration. We work
towards a principled and generic solution to language extension by
studying the applicability of modular syntax definition, scannerless
parsing, generalized parsing algorithms, and program transformations.
&lt;/p&gt;

&lt;p&gt;
We describe MetaBorg, a method for providing concrete syntax for
domain abstractions to application programmers. Since object-oriented
languages are designed for extensibility and reuse, the language
constructs are often sufficient for expressing domain abstractions at
the semantic level. However, they do not provide the right
abstractions at the syntactic level. The MetaBorg method consists of
embedding domain-specific languages in a general purpose host language
and assimilating the embedded domain code into the surrounding host
code.  Instead of extending the implementation of the host language,
the assimilation phase implements domain abstractions in terms of
existing APIs leaving the host language undisturbed.
&lt;/p&gt;

&lt;p&gt;
We present a solution to injection vulnerabilities. Software written
in one language often needs to construct sentences in another
language, such as SQL queries, XML output, or shell command
invocations.  This is almost always done using unhygienic string
manipulation.  A client can then supply specially crafted input that
causes the constructed sentence to be interpreted in an unintended
way, leading to an injection attack. We describe a more natural style
of programming that yields code that is impervious to injections by
construction.  Our approach embeds the grammars of the guest languages
into that of the host language and automatically generates code that
maps the embedded language to constructs in the host language that
reconstruct the embedded sentences, adding escaping functions where
appropriate.
&lt;/p&gt;

&lt;p&gt;
We study AspectJ as a typical example of a language conglomerate,
i.e. a language composed of a number of separate languages with
different syntactic styles. We show that the combination of the
lexical syntax leads to considerable complexity in the lexical states
to be processed. We show how scannerless parsing elegantly addresses
this. We present the design of a modular, extensible, and formal
definition of the lexical and context-free aspects of the AspectJ
syntax. We introduce grammar mixins, which allows the declarative
definition of keyword policies and combination of extensions.
&lt;/p&gt;

&lt;p&gt;
We introduce separate compilation of grammars to enable deployment of
languages as plugins to a compiler. Current extensible compilers focus
on source-level extensibility, which requires users to compile the
compiler with a specific configuration of extensions. A compound
parser needs to be generated for every combination. We introduce an
algorithm for parse table composition to support separate compilation
of grammars to parse table components. Parse table components can be
composed (linked) efficiently at runtime, i.e. just before
parsing. For realistic language combination scenarios involving
grammars for real languages, our parse table composition algorithm is
an order of magnitude faster than computation of the parse table for
the combined grammars, making online language composition feasible.
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;
Also, they asked me for a Dutch, non-technical summary for news websites. For my Dutch readers:
&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;
We presenteren een verzameling van methoden en technieken om
programmeertalen te combineren. Onze methoden maken het bijvoorbeeld
mogelijk om in een programmeertaal die ontworpen is voor algemene
doeleinden een subtaal te gebruiken die beter aansluit bij het domain
van een bepaald onderdeel van een applicatie. Hierdoor kan een
programmeur op een duidelijkere en compactere wijze een aspect van de
software implementeren.
&lt;/p&gt;
&lt;p&gt;
Op basis van dezelfde technieken presenteren we een methode die
programmeurs beschermt tegen fouten die de oorzaak zijn van het meest
voorkomende beveiligingsprobleem, een zogenaamde injectie aanval. Door
op een iets andere wijze te programmeren, heeft de programmeur de
garantie dat de software niet gevoelig is voor dergelijke
aanvallen. In tegenstelling tot eerder voorgestelde oplossingen geeft
onze methode absolute garanties, is eenvoudiger voor de programmeur,
en kan gebruikt worden voor alle gevallen waarin injectie aanvallen
kunnen voorkomen (bijvoorbeeld niet specifiek voor de taal SQL).
&lt;/p&gt;
&lt;p&gt;
Tot slot maken onze technieken het mogelijk om de syntaxis van sommige
programmeertalen duidelijker en formeler te definieren. Sommige
moderne programmeertalen zijn eigenlijk een samensmelting van
verschillende subtalen (zogenaamde taalagglomeraten). Van dergelijke
talen was het tot nu toe onduidelijk hoe de syntaxis precies
geformuleerd kon worden, wat voor standaardisering en compatibiliteit
noodzakelijk is.
&lt;/p&gt;
&lt;/blockquote&gt;</description>
	<pubDate>Sun, 20 Jan 2008 12:08:00 +0000</pubDate>
</item>
<item>
	<title>Karl Trygve Kalleberg: Summer Job Hunting</title>
	<guid>http://journal.boblycat.org/2816 at http://journal.boblycat.org</guid>
	<link>http://journal.boblycat.org/node/2816</link>
	<description>&lt;p&gt;&lt;p&gt;With my comp.sci PhD finished, printed and published, I'm now back to being a full-time medical student. It's really rewarding and fun -- being an introvert geek, I've learned a lot about how I relate to other people by being shoved into a room with a patient who expects me to talk to him/her about the most intimate details of his/her situation. Alas, being a student doesn't pay at all.&lt;/p&gt;
&lt;p&gt;I've still some money left from earlier jobs, and I live quite comfortably, but prudence (and interest) requires me to look for a job this summer as well. If all pending exams go well, I'll get my temporary license at the end of the spring semester, which means I can apply for work as a hospital doctor during the summer. There's no denying that this would be quite a lot of fun, but I'm not all that hopeful -- the competition to get hospital jobs seems fierce, and I've not been a star performer when it comes to medicine, I'm sad to say (but hopefully things will pick up now that I can focus on it). &lt;/p&gt;
&lt;p&gt;For these reasons, I'll probably also be looking around for comp.sci jobs as a backup because I'm fairly good at it, it pays well, and it's usually a lot of fun. Also, it's easier to get jobs abroad, even in countries where you don't speak the native language fluenty:)&lt;/p&gt;
&lt;br class=&quot;giImageBlock-clear-both&quot; /&gt;&lt;/p&gt;</description>
	<pubDate>Mon, 24 Dec 2007 01:42:37 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: www.webdsl.org online</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/63-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/63-www.webdsl.org-online.html</link>
	<description>&lt;a href=&quot;http://www.flickr.com/photos/eelcovisser/2307244342/&quot; title=&quot;demo by Eelco Visser, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2335/2307244342_b41c99818b_m.jpg&quot; width=&quot;240&quot; height=&quot;192&quot; alt=&quot;demo&quot; align=&quot;right&quot; /&gt;&lt;/a&gt;

Since my last blog post I have been pretty busy teaching a course on programming languages, and developing a web application for the &lt;a href=&quot;http://www.webdsl.org&quot;&gt;webdsl.org&lt;/a&gt; site. It is now finally online. We presented the first release of WebDSL last Thursday using a presentation embedded in the webdsl.org site in the MoDSE Colloquium. As should be the case, the database crashed midway the presentation (probably due to a corruption of the filesystem of the virtual machine we were using), but after a short break and some frantic hacking we got the presentation back on track. By now the site is available outside the TU Delft firewall. The site includes a wiki (with page history), blogs, forums, news items, and an issue tracker. Proper user management should avoid the user registration spam disaster that we experienced with previous (T)wikis. The aim is to evolve the application into a full blown software project management and community site that should be usable by other projects as well. 
For starters, I am now working on migrating the &lt;a href=&quot;http://www.stratego-language.org&quot;&gt;Stratego/XT&lt;/a&gt; and &lt;a href=&quot;http://www.program-transformation.org&quot;&gt;Program Transformation&lt;/a&gt; wikis to (clones of) the webdsl.org application. While usable and useful, the application can be improved in numerous ways.</description>
	<pubDate>Sun, 23 Dec 2007 11:38:00 +0000</pubDate>
</item>
<item>
	<title>Karl Trygve Kalleberg: Stratego Java backend in progress</title>
	<guid>http://journal.boblycat.org/2797 at http://journal.boblycat.org</guid>
	<link>http://journal.boblycat.org/node/2797</link>
	<description>&lt;p&gt;It's been rather quiet on the northern front for quite some time. I've been mostly busy with diagnosing old ladies with chest pain of late, and trying to make heads and tails of the horrible electronic health record system at the hospital. Sheesh.&lt;/p&gt;
&lt;p&gt;Anyway, today I found time to do some compiler hacking. It feels great, as always! I resurrected the &lt;tt&gt;strc-java&lt;/tt&gt; project -- a Java backend for the Stratego compiler. After a couple of hours of fiddling around, I now have an extremely rudimentary runtime up and running, and the compiler can compile simple build expressions properly.&lt;/p&gt;
&lt;p&gt;Given the simple strategy&lt;/p&gt;
&lt;pre&gt;
main = !Foo(1,2)
&lt;/pre&gt;
&lt;p&gt;the following Java code is produced:&lt;/p&gt;
&lt;pre&gt;
public static class main_0_0 extends Strategy
{
    public final static main_0_0 instance = new main_0_0();
   public ATerm apply(ATerm term)
    {
      try
      {
        {
          ATerm[] b_0 = new ATerm[2];
          {
            ATerm c_0 = atermFactory.makeInt(1);
            b_0[0] = c_0;
          }
          {
            ATerm d_0 = atermFactory.makeInt(2);
            b_0[1] = d_0;
          }
          ATerm a_0 = atermFactory.makeAppl(atermFactory.makeAFun(&quot;Foo&quot;, 2, false), b_0);
          term = a_0;
        }
      }
      catch(Failure f)
      {
        return null;
      }
      return term;
    }
  }
&lt;/pre&gt;&lt;p&gt;
There are a number of unnecessary blocks in the above code fragment, but that's an artifact of the way I wrote the Java code templates. I'll see if I can't get rid of them eventually. &lt;/p&gt;
&lt;p&gt;I've spent some time hacking about in order to get closures working without too much overhead. I think the current scheme will work, but will require a bit of sophistication and context-awareness in the code generator. &lt;/p&gt;
&lt;p&gt;You can see the scheme in the example above. Every strategy is compiled to its own class, with an &lt;tt&gt;apply&lt;/tt&gt; method. The signature for this method is not fixed. Rather, the number of strategy and term arguments may vary. The last argument is always the current term. Every class has a singleton instance, called &lt;tt&gt;instance&lt;/tt&gt;. This is how we get the pointer. All context information that's required will have to be passed in, through the argument list. &lt;/p&gt;
&lt;p&gt;There are in principle two possible schemes for passing in arguments. The first is to do as Stratego/J (the Stratego interpreter for Java): use two arrays, e.g. &lt;tt&gt;ATerm apply(Strategy[] svars, ATerm[] tvars, ATerm currentTerm)&lt;/tt&gt;. This costs two calls to &lt;tt&gt;new&lt;/tt&gt; (in the general case) for every strategy invocation. Not very appealing. &lt;/p&gt;
&lt;p&gt;The other possibility is to sequence the strategy and term arguments in the argument list, e.g.:&lt;/p&gt;
&lt;pre&gt;
ATerm apply(Strategy s0, Strategy s1, ATerm t0, ATerm t0, ATerm currentTerm) 
&lt;/pre&gt;&lt;p&gt;
The problem here is that the arity of &lt;tt&gt;s.apply()&lt;/tt&gt; is not fixed. We really have: &lt;/p&gt;
&lt;pre&gt;
ATerm apply(Strategy&amp;lt;x0,y0&amp;gt; s0, Strategy&amp;lt;x1,y1&amp;gt; s1, ATerm t0, ATerm t0, ATerm currentTerm)
&lt;/pre&gt;&lt;p&gt;
where &lt;tt&gt;x&lt;/tt&gt; and &lt;tt&gt;y&lt;/tt&gt; are the strategy and term arities, respectively. If we were generating C++ code, we could just use integers here. In Java, we'll have to insert real types. I'm tempted to use enums, and manually define the types &lt;tt&gt;N0&lt;/tt&gt; through &lt;tt&gt;N31&lt;/tt&gt;. Nobody will ever invent a strategy with more than 32 strategy or term arguments, right?&lt;/p&gt;
&lt;p&gt;I'll keep mulling this one over a bit. Feel free to drop me a line if you see better solutions.&lt;/p&gt;</description>
	<pubDate>Sat, 08 Dec 2007 22:38:39 +0000</pubDate>
</item>
<item>
	<title>Eric Bouwers: So much interesting to read ...</title>
	<guid>tag:blogger.com,1999:blog-28873279.post-2858604162288034448</guid>
	<link>http://ericbouwers.blogspot.com/2007/10/so-much-interesting-to-read.html</link>
	<description>... and less time to do it! &lt;br /&gt;&lt;br /&gt;Since I started my full-time job I noticed that it is a lot harder to stay up to date with all the latest (online) developments. During the writing of my thesis I had a considerable amount of time which I could spend on reading blogs and news-items, and following mailing-lists. When you spend most of your day actually working you learn to prioritize which things you want to read :)&lt;br /&gt;&lt;br /&gt;One of the things I did managed to read, albeit a bit late, is &lt;a href=&quot;http://groups.google.com/group/mailing.www.php-dev/browse_thread/thread/9d605479bd75b71e/6c31ca7124cd2b3c&lt;br /&gt;&quot;&gt;&lt;br /&gt;&quot;&gt;&lt;br /&gt;&quot;&gt;&lt;br /&gt;&quot;&gt;this&lt;/a&gt; thread on the &lt;a href=&quot;http://news.php.net/group.php?group=php.internals&quot;&gt;PHP.internals&lt;/a&gt; list written by &lt;a href=&quot;http://en.wikipedia.org/wiki/Wietse_Venema&quot;&gt;Wietse Venema&lt;/a&gt;. It is a follow-up on &lt;a href=&quot;http://groups.google.ca/group/mailing.www.php-dev/browse_thread/thread/dfa503a483dcb925/65ffa930a404c320&lt;br /&gt;&quot;&gt;&lt;br /&gt;&quot;&gt;&lt;br /&gt;&quot;&gt;&lt;br /&gt;&quot;&gt;this&lt;/a&gt; thread in which a first proposal was made to integrate a perl-style taint-mode into the core of PHP. The results posted in the follow-up thread look promising. It is also interesting to see that he has gone from a black-and-white taint-mode, to a more leveled approach. Currently the proposal only contains a subset of the levels available in PHP-Sat, but I think that the most fundamental ones are definitely there. &lt;br /&gt;&lt;br /&gt;Even though Wietse is developing a prototype I think he will have a hard time getting this taint-mode into the actual core of PHP. Within both threads the general opinion seems to be that the idea is nice, but the developers of PHP seem to think of many situations in which it could fail. I hope to see more results of this idea soon!&lt;br /&gt;&lt;br /&gt;Going over some other interesting threads in the internals-list I found a reference to a tool called &lt;a href=&quot;http://www.icosaedro.it/phplint/index.html&quot;&gt;PHPLint&lt;/a&gt;. (Isn't is funny to see that there are all sorts of initiatives popping up that that try to make PHP more secure/stricter). I haven't have time to take a better look at this tool, but a first glance definitely showed potential. I'll try to examine this tool more thoroughly at the end of this week.  &lt;br /&gt;&lt;br /&gt;While there is less time to read on-line material, there is more time to read off-line stuff. Since I am using public transportation to get to work I have an extra hour a day to read actual books and publications. One of the books I have read in the past few weeks is a printed version of &lt;a href=&quot;http://producingoss.com/&quot;&gt;&quot;Producing  Open Source Software&quot; (ProducingOss)&lt;/a&gt; written by &lt;a href=&quot;http://www.red-bean.com/kfogel/&quot;&gt;Karl Fogel&lt;/a&gt;. My conclusion: absolutely worth reading!&lt;br /&gt;&lt;br /&gt;ProducingOss contains all sorts of tips, hints and best practices. Even if you are not involved in an open source project it is still useful to read. Almost everything in the book can also be applied to closed-source projects. Furthermore, it contains many pointers to other interesting literature. One of these pointers lead me to &lt;a href=&quot;http://www.catb.org/~esr/writings/cathedral-bazaar/&quot;&gt;The Cathedral and the Bazaar&lt;/a&gt;, my current read-while-traveling-to-and-from-work book. &lt;br /&gt;&lt;br /&gt;I intend to use several things from ProducingOSS within PHP-Sat. I will just have to think about how I can fit the project in my current schedule, but it will definitely be fitted in.</description>
	<pubDate>Tue, 23 Oct 2007 20:47:13 +0000</pubDate>
</item>
<item>
	<title>Eric Bouwers: A little migration helper</title>
	<guid>tag:blogger.com,1999:blog-28873279.post-9039427588745909379</guid>
	<link>http://ericbouwers.blogspot.com/2007/09/little-migration-helper.html</link>
	<description>You probably already heard about it, but support for PHP version 4 is partly dropped as of 31-12-2007. And after 08-08-2008 the support ends completely. &lt;br /&gt;&lt;br /&gt;Luckily, the PHP documentation team provides you with a &lt;a href=&quot;http://www.php.net/manual/en/migration5.php&quot;&gt;set&lt;/a&gt; &lt;a href=&quot;http://www.php.net/manual/en/migration51.php&quot;&gt;of&lt;/a&gt; &lt;a href=&quot;http://www.php.net/manual/en/migration52.php&quot;&gt;migration&lt;/a&gt; guides. Going through these guides can take some time, but it enables you to upgrade your code easily to be PHP5 compatible.&lt;br /&gt;&lt;br /&gt;To make your life even easier, the &lt;a href=&quot;http://www.program-transformation.org/PHP/PhpTools&quot;&gt;PHP-tools&lt;/a&gt; project is extended with the tool &lt;b&gt;test-migration&lt;/b&gt;. This tool performs some checks that are described by the migration guide to detect whether the code can be run under version 5 of PHP. These checks include: &lt;ul&gt;&lt;li&gt;Is there a function definition with the same name as a function newly defined in PHP5?&lt;/li&gt;&lt;li&gt;Is an object created without the class being defined first?&lt;/li&gt;&lt;li&gt;Where are the functions strrpos, strripos and ip2long used?&lt;/li&gt;&lt;li&gt;Is there any place in which there is reflection within PHP that uses changed behavior?&lt;/li&gt;&lt;/ul&gt; The first two checks are rather easy to understand, PHP5 will simply halt execution with an error when these issues are detected at runtime. Therefore, the warnings that are generated for these kind of patterns are shown with a 'serious'-level. &lt;br /&gt;On the other hand, the last two checks do not find constructions that can halt execution. They detect places in which certain constructions are used. These constructions where already available within PHP version 4, but their behavior changed in version 5. To easily find these constructions they are flagged by a 'minor'-warning. More details about the changed behavior can be found &lt;a href=&quot;http://www.php.net/manual/en/migration5.incompatible.php&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The first version of this tool is quit basic and performs only a few checks. If you would like to see more check included, don't hesitate to drop me an email or put them in the comments.</description>
	<pubDate>Sat, 01 Sep 2007 17:33:31 +0000</pubDate>
</item>
<item>
	<title>Karl Trygve Kalleberg: Post-Defense Redux</title>
	<guid>http://journal.boblycat.org/2582 at http://journal.boblycat.org</guid>
	<link>http://journal.boblycat.org/node/2582</link>
	<description>&lt;p&gt;&lt;p&gt;Finally! It's over! Never again! The defense mostly followed the specified procedure. I first had about 45 minutes to give a &lt;a href=&quot;http://www.ii.uib.no/~karltk/phd/presentations/uib07-disputas.pdf&quot;&gt;presentation&lt;/a&gt; of the results of the dissertation, then the first opponent, Neil Jones, gave a 15 minute summary putting my work into a larger context. &lt;/p&gt;
&lt;p&gt;After his summary, he proceeded to ask several high-level questions about various parts of the dissertation. One question I liked a lot was (paraphrased): &quot;are the axiom-based Java testing techniques you propose in your case study applicable to Stratego and would you actually use them?&quot;. All the tools and prototypes discussed in the thesis are written in Stratego, and are applied to Java, C and a toy language called TIL. However, few of the tools are actually available for Stratego itself. This is the classical story of the cobbler's children's shoes... I certainly think it would be worthwhile to do the work necessary to make some of the the tools available to Stratego as well. &lt;/p&gt;
&lt;p&gt;Peter Mosses followed with a series of detailed questions. Clearly, Peter had read the text and figures very carefully, because some of his questions were about rather subtle issues and ambiguities in my work. There were also a few (fortunately minor) mistakes that made some of the figures more difficult to comprehend than necessary. He also nailed me on a very embarrassing definite-instead-of-indefinite article mistake. Normally, these things do not matter very much, but in this particular sentence it sort of reversed one of my main arguments in the dissertation. Whoops;)&lt;/p&gt;
&lt;p&gt;After I'd answered their questions as best as I could, they retired to discuss whether my performance was good enough. This is mostly a formality in the current tradition, so I can't say I was very worried at that point. Once they came back, the dean proclaimed my successful completion of the degree, and we all rushed off for some (sadly delayed) champagne and cake. &lt;/p&gt;
&lt;p&gt;I even wore a suit, and here's a picture to prove it:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.ii.uib.no/~karltk/phd/pictures/karltk-defending-small.jpg&quot;&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.ii.uib.no/~karltk/phd/pictures/karltk-defending-small.jpg&quot; /&gt;&lt;br /&gt;
&lt;/a&gt; &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Much thanks to Uwe Wolter, who was the local member of the committe and therefore the grand orchestrator of all the formalities, the formal parts went smoothly. After the defense, the stressful part of the day started: I had to collect all people's menu choices for the evening, send my family and friends shopping for the evening's party, clean the apartment and of course smear huge swaths of marzipan cake all over my suit. Thanks to very good help from my brother, his girlfriend, Håvard (my roommate) and my mother, and Tilde, we managed to get ready just in time to arrive ten minutes late for the scheduled dinner. &lt;/p&gt;
&lt;p&gt;Magne and Peter:&lt;br /&gt;
&lt;a href=&quot;http://www.ii.uib.no/~karltk/phd/pictures/magne-and-peter.jpg&quot;&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.ii.uib.no/~karltk/phd/pictures/magne-and-peter-small.jpg&quot; /&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Neil and Uwe:&lt;br /&gt;
&lt;a href=&quot;http://www.ii.uib.no/~karltk/phd/pictures/neil-and-uwe.jpg&quot;&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.ii.uib.no/~karltk/phd/pictures/neil-and-uwe-small.jpg&quot; /&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Tilde:&lt;br /&gt;
&lt;a href=&quot;http://www.ii.uib.no/~karltk/phd/pictures/tilde.jpg&quot;&gt;&lt;br /&gt;
&lt;img src=&quot;http://www.ii.uib.no/~karltk/phd/pictures/tilde-small.jpg&quot; /&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Since Eelco took the pictures, he's not in any of them. Fortunately, Tilde has a few pictures of Eelco, and of the other people present. I'm still waiting for those and will upload a few once I get them (and get some green lights from the people depicted).&lt;/p&gt;
&lt;p&gt;After dinner, we all (committee, advisors, friends and family) drove back to my apartment and Tilde whipped up drinks to all. She even tricked one into me;) I was very pleased to see that my office neighbour and student advisor, Ida Holen, found the time to show up. Also, I had friends flying in from Oslo (okay, Holmestrand) and Trondheim for the event, namely Karl Thomas, Karina and Leif Olav. Thanks guys! Hope the drinks and food was worth it;) The usual Bergen posse showed up as well, including Stig, Fay, Knute, Glenn, Espen, Tommy x 2 and Paul Simon (if I forgot somebody, ping me).&lt;/p&gt;
&lt;br class=&quot;giImageBlock-clear-both&quot; /&gt;&lt;/p&gt;</description>
	<pubDate>Fri, 13 Jul 2007 03:23:24 +0000</pubDate>
</item>
<item>
	<title>Eric Bouwers: It is getting noticed</title>
	<guid>tag:blogger.com,1999:blog-28873279.post-995814220393041598</guid>
	<link>http://ericbouwers.blogspot.com/2007/06/it-is-getting-noticed.html</link>
	<description>Within the last two weeks I noticed that PHP-Front and PHP-Sat are being discovered by people that are looking for PHP-specific solutions. It is not that we are flooded with request, but I am still happy with every question :)&lt;br /&gt;&lt;br /&gt;The first &lt;a href=&quot;http://mail.cs.uu.nl/pipermail/psat-dev/2007q2/000023.html&quot;&gt;question&lt;/a&gt; was send to the &lt;a href=&quot;http://mail.cs.uu.nl/mailman/listinfo/psat-dev&quot;&gt;psat-dev&lt;/a&gt;-mailinglist and was about the &lt;a href=&quot;http://en.wikipedia.org/wiki/Cyclomatic_complexity&quot;&gt;Cyclomatic complexity&lt;/a&gt; of PHP code. I &lt;a href=&quot;http://mail.cs.uu.nl/pipermail/psat-dev/2007q2/000024.html&quot;&gt;replied&lt;/a&gt; that it would not get into PHP-Sat because it is not a bug-pattern. However, it would be a nice tool for the &lt;a href=&quot;http://www.php-sat.org/PhpTools&quot;&gt;PHP-Tools&lt;/a&gt; project. I made a similar tool for Java because of an &lt;a&gt;assignment&lt;/a&gt; in the past, so it is probably just a matter of renaming the Strategies to use the PHP-Front api. Unfortunately, I didn't get an answer about how the report should look like. If you have any ideas please let me know in the comments, or in the &lt;a href=&quot;https://bugs.cs.uu.nl/browse/PSAT-99&quot;&gt;issue&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;A second question was about the grammar of PHP-Front, or actually the license of this grammar. The people behind &lt;a href=&quot;http://www.txl.ca/&quot;&gt;TXL&lt;/a&gt; have derived a PHP-grammar for TXL from the SDF-grammar in PHP-Front. Since our license does not state anything about derived work without common source, we were asked for our permission to distribute this new grammar. Naturally, this permission was given very quickly and we were also allowed to take a peak at the source. I must say that I find it interesting, but I currently do not have time to look into it all. I imagine that the definitions of the grammars and TXL itself is similar to how things work in Stratego, but I have to look into that.&lt;br /&gt;&lt;br /&gt;The last &lt;a href=&quot;http://mail.cs.uu.nl/pipermail/psat-dev/2007q2/000025.html&quot;&gt;question&lt;/a&gt; in this series is about defined functions. Finding out which functions are defined in a project is easy when classes are ignored, a simple grep on the project will do. When a project also includes classes it becomes trickier to get all functions defined outside of a class. The question was whether PHP-Front could help with this issue, and the answer is of course yes!&lt;br /&gt;Within the reflection part of the library the list of defined functions and classes is already available. This makes it possible to write a tool to show all defined functions in just a few lines of code. Since it was also a nice tool for the &lt;a href=&quot;http://www.php-sat.org/PhpTools&quot;&gt;PHP-Tools&lt;/a&gt; project I added a tool for this last Friday.&lt;br /&gt;&lt;br /&gt;Another issue that was brought up by the last e-mail is the issue of our implementation language. Since Stratego is relatively unknown the project has a steep learning curve. On the other hand, if I had chosen a different implementation language it would have taken me way longer to implement the current features. And besides, this piece of code is not that hard to understand right?&lt;br /&gt;&lt;pre&gt;  defined-functions-main =&lt;br /&gt;    include-files-complex&lt;br /&gt;  ; get-php-environment&lt;br /&gt;  ; get-functions&lt;br /&gt;  ; if ?[]&lt;br /&gt;    then !&quot;No functions defined.&quot;&lt;br /&gt;    else  map(transform-to-message)&lt;br /&gt;        ; lines                    &lt;br /&gt;    end  &lt;/pre&gt;</description>
	<pubDate>Sun, 01 Jul 2007 16:51:04 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: Abstractions for Language Independent Transformations</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/57-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/57-Abstractions-for-Language-Independent-Transformations.html</link>
	<description>&lt;a href=&quot;http://www.flickr.com/photos/eelcovisser/664364650/&quot; title=&quot;Photo Sharing&quot;&gt;&lt;img src=&quot;http://farm2.static.flickr.com/1272/664364650_bcb458b763_m.jpg&quot; width=&quot;240&quot; height=&quot;160&quot; alt=&quot;abstractions for language independent transformations&quot; align=&quot;right&quot; /&gt;&lt;/a&gt;

Yesterday, &lt;a href=&quot;http://www.ii.uib.no/~karltk/&quot;&gt;Karl Trygve Kalleberg&lt;/a&gt; defended his PhD thesis at Bergen University.
The thesis treats the subject of abstractions for program transformation, with the aim of making available
transformation abstractions independent of the source language being transformed. The thesis introduces a number of extensions to the &lt;a href=&quot;http://www.strategoxt.org&quot;&gt;Stratego&lt;/a&gt; transformation language and reports on several case studies. I understand the thesis will be available soon.
(&lt;a href=&quot;http://www.flickr.com/photos/eelcovisser/sets/72157600555985303/&quot;&gt;More photos&lt;/a&gt;)</description>
	<pubDate>Thu, 28 Jun 2007 20:01:13 +0000</pubDate>
</item>
<item>
	<title>Eric Bouwers: Where you at?</title>
	<guid>tag:blogger.com,1999:blog-28873279.post-2915349027607626318</guid>
	<link>http://ericbouwers.blogspot.com/2007/06/where-you-at.html</link>
	<description>Now that the propagation of safety-types seems to go smoothly it was time to dive into another subject: accessing the location of terms. In this case, the location of a term is defined as the location of the text in the original file that was parsed to that term. Since the strategy to annotate the AST with position-info is available in the standard libraries nowadays, it should be easy to access these locations and finally solve &lt;a href=&quot;https://bugs.cs.uu.nl/browse/PSAT-91&quot;&gt;PSAT-91&lt;/a&gt; right? Lets find out!&lt;br /&gt;&lt;br /&gt;The first thing I did was to add a separate module to handle the low-level stuff of getting the location annotations. This module contains several getter-strategies that can retrieve, for example, the number of the start-line. The location info is captured in six different numbers: start-line, end-line, start-column, end-column, offset and length. A getter-strategy is available for all of them. Furthermore, the name of the file in which the term is defined can be retrieved. &lt;br /&gt;&lt;br /&gt;Although these getter-strategies are useful, they are not meant to be called directly. I figured that the most common use of these functions would be reporting the values in some kind of (formatted) message. In order to capture this kind of behavior the strategy &lt;i&gt;format-location-string(|message)&lt;/i&gt; is defined. This strategy takes a message with holes in the form of &lt;b&gt;[STARTLINE]&lt;/b&gt; as parameter and fills these holes with values from the current term. A rather useful strategy if I say so myself.&lt;br /&gt;&lt;br /&gt;To practice with this new piece of functionality I have added an extra option to the tool &lt;i&gt;input-vector&lt;/i&gt; of the &lt;a href=&quot;http://www.program-transformation.org/PHP/PhpTools&quot;&gt;php-tools&lt;/a&gt;-project. This option allows the user to choose between the normal list, or the same list with line-numbers printed for each access. More information about this option and how to add an option yourself can be found &lt;a href=&quot;http://www.program-transformation.org/PHP/TheExampleProject#Adding_an_option&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;After this was done I moved to php-sat to make the output more concise. It was actually pretty easy to implement. The algorithm is nothing more then get-terms-with-annotations, make-nice-output. I actually spend more time on creating a test-setup for calling php-sat through a shell-script then on generating the more concise format. The only problem was that the adding of position-info everywhere interfered with the dynamic-rules. A few well-places &lt;i&gt;rm-annotations&lt;/i&gt; where needed to fix this. Please let me know if you like the new output, or whether something should be added.&lt;br /&gt;&lt;br /&gt;The next applications of the location info is the tracking of where untainted data enters an application. When a function is called with a parameter &lt;b&gt;$foo&lt;/b&gt; which is tainted, it would be nice to show when it was tainted. I think this is not too difficult to add, but bugs always seem to lurk in 'I-think-it-is-easy-to-add'-features.&lt;br /&gt;&lt;br /&gt;A last remark about locations is a small problem without an actual solution. Eventually php-sat must support function-calls. The algorithm to analyze function-calls is not complicated, but how can bug-patterns within a function be reported? A message before each call to this function? Within the file in which the function is defined? And what about cases in which one call is flagged and the other one isn't? And can we also handle object-creation in the same way? I haven't figured out how to handle this, so if you have any ideas please let me know.</description>
	<pubDate>Sun, 24 Jun 2007 19:37:13 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: Domain-Specific Language Engineering (Mark I)</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/56-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/56-Domain-Specific-Language-Engineering-Mark-I.html</link>
	<description>There it is. The first version of the 'Domain-Specific Language Engineering' paper. It is still somewhat rough around the edges and can use
more meta-level reflection. Therefore, this is 'Mark I'. I expect at least another version, and maybe two before the final one. Comments on any
aspect of the work would be greatly appreciated. Here is a quote from the introduction:

&lt;p&gt;&lt;/p&gt;

&lt;blockquote&gt;

	In recent years there has been an increasing momentum (some
	call it hype) for approaches with names as domain-specific
	languages, model-driven architecture, software factories,
	language workbenches, and intentional programming. While there
	are differences between these approaches (mostly of a
	technological nature?), the common goal is to achieve a
	higher-level of abstraction in software development by
	abstracting from low-level boilerplate code. (Making
        &lt;em&gt;domain-specific languages&lt;/em&gt; the approach of my choice,
	I'll use its terminology from now on.)  The idea of
	domain-specific languages has been around for a long time, but
	what seems to be new in the current wave, is the requirement
	to use DSL design and implementation as a standard tool in the
	software development process.  The challenge then is to
	develop a systematic method for designing new domain-specific
	languages.

  &lt;p&gt;&lt;/p&gt;
 
	This tutorial describes an experiment in DSL design and
	implementation. The experiment is simply to take a new domain
	(web applications), to develop a DSL (set of DSLs) for this
	domain, and observe the process to extract ingredients for a
	standard process.  The target of the experiment are web
	applications with a rich domain model that can serve as
	content management system editable via the browser, but also
	allow querying and aggretation based on the structure of the
	data.  The tutorial takes one particular combination of
	technologies.  The DSL will be a textual language. The
	generator targets Java with a certain collection of frameworks
	for implementation of web applications. The DSL is implemented
	using Stratego/XT, SDF, and Nix.

&lt;/blockquote&gt;

&lt;p&gt;&lt;/p&gt;

&lt;a href=&quot;http://www.eelcovisser.net&quot;&gt;Eelco Visser&lt;/a&gt;. 
&lt;a href=&quot;http://swerl.tudelft.nl/twiki/pub/Main/TechnicalReports/TUD-SERG-2007-017.pdf&quot;&gt;Domain-Specific Language Engineering. A Case Study in Agile DSL Development (Mark I)&lt;/a&gt;. Technical Report TUD-SERG-2007-017, Software Engineering Research Group, Delft University of Technology, June 2007. To appear in the proceedings of the 
&lt;a href=&quot;http://wiki.di.uminho.pt/wiki/bin/view/GTTSE2007/WebHome&quot;&gt;Summer School on Generative and Transformational Techniques in Software Engineering (GTTSE'07)&lt;/a&gt;.
(&lt;a href=&quot;http://swerl.tudelft.nl/twiki/pub/Main/TechnicalReports/TUD-SERG-2007-017.pdf&quot;&gt;pdf&lt;/a&gt;)</description>
	<pubDate>Sun, 24 Jun 2007 09:38:45 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: Scrap your Boilertemplate</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/55-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/55-Scrap-your-Boilertemplate.html</link>
	<description>In February I had &lt;a href=&quot;http://blog.eelcovisser.net/index.php?/archives/45-Domain-Specific-Language-Engineering.html&quot;&gt;promissed&lt;/a&gt; 'to report about my journey through webland and towards the GTTSE tutorial on this blog', but have failed miserably. I find I'm not a good
blogger. Not that I have nothing to say. During the process of designing and implementing WebDSL I have thought about dozens of things I could blog
about, but either didn't have the time, or didn't think it would be interesting for anyone but myself. 
I regret that; now that I have &lt;a href=&quot;http://www.webdsl.org&quot;&gt;something that works&lt;/a&gt; it would have been interesting to see a log of the process. Not all is lost though. I am finalizing a paper for the &lt;a href=&quot;http://wiki.di.uminho.pt/wiki/bin/view/GTTSE2007/WebHome&quot;&gt;GTTSE'07 summerschool&lt;/a&gt; in which I explain the design process. 

Here's a quote from the paper:

&lt;blockquote&gt;

	The boilertemplate smell is characterized by similar target
coding patterns used in different templates, only large chunks
	of target code (a complete page type) considered as a reusable
	programming pattern, and limited expressivity, since adding a
	slightly different pattern (type of page) already requires
	extending the generator. 

       &lt;p&gt;&lt;/p&gt;
	
	High time for some generator refactoring. The refactoring
	we're going to use here is called 'find an intermediate
	language' also known as 'scrap your
	boilertemplate'. In order to gain expressivity we
	need to better cover the variability in the application
	domain. While implementing the domain model DSL, we've
	explored the capabilities of the target platform, so by now we
	have a better idea how to implement variations on the CRUD
	theme by combining the basics of JSF and Seam in different
	ways.  What we now need is a language that sits in between the
	high-level domain modeling language and the low-level details
	of JSF/Seam and allows us to provide more variability to
	application developers while still maintaining an advantage
	over direct programming.

&lt;/blockquote&gt;

In preparation of my GTTSE presenation I have given a two part lecture at the &lt;a href=&quot;http://swerl.tudelft.nl/bin/view/MoDSE/Colloquium&quot;&gt;MoDSE Colloquium&lt;/a&gt; entitled &lt;em&gt;Domain-Specific Language Engineering&lt;/em&gt; (&lt;a href=&quot;http://swerl.tudelft.nl/twiki/pub/EelcoVisser/ResearchTalks/MoDSE-Visser-DSLI.pdf&quot;&gt;part 1&lt;/a&gt;, &lt;a href=&quot;http://swerl.tudelft.nl/twiki/pub/EelcoVisser/ResearchTalks/MoDSE-Visser-DSLII.pdf&quot;&gt;part 2&lt;/a&gt;).

At the &lt;a href=&quot;http://swerl.tudelft.nl/bin/view/MoDSE/FirstMoDSEWorkshop&quot;&gt;first MoDSE workshop&lt;/a&gt; yesterday I gave a talk with the title &lt;a href=&quot;http://swerl.tudelft.nl/twiki/pub/EelcoVisser/ResearchTalks/SweetWebDSL.pdf&quot;&gt;A Sweet WebDSL&lt;/a&gt;  focusing on the role of desugarings in a DSL for web applications.</description>
	<pubDate>Thu, 21 Jun 2007 09:36:14 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: Preventing Injection Attacks with Syntax Embeddings</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/54-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/54-Preventing-Injection-Attacks-with-Syntax-Embeddings.html</link>
	<description>&quot;Software written in one language often needs to construct sentences in another language, such as
SQL queries, XML output, or shell command invocations. This is almost always done using unhygienic
string manipulation, the concatenation of constants and client-supplied strings. A client can then supply
specially crafted input that causes the constructed sentence to be interpreted in an unintended way,
leading to an injection attack. We describe a more natural style of programming that yields code that
is impervious to injections by construction. Our approach embeds the grammars of the guest languages
(e.g., SQL) into that of the host language (e.g., Java) and automatically generates code that maps the
embedded language to constructs in the host language that reconstruct the embedded sentences, adding
escaping functions where appropriate. This approach is generic, meaning that it can be applied with
relative ease to any combination of host and guest languages.&quot;

&lt;p&gt;&lt;/p&gt;

The paper &lt;em&gt;Preventing Injection Attacks with Syntax Embeddings, A Host and Guest Language Independent Approach &lt;/em&gt;
by &lt;a href=&quot;http://martin.bravenboer.name&quot;&gt;Martin Bravenboer&lt;/a&gt;, &lt;a href=&quot;http://www.cs.uu.nl/~eelco&quot;&gt;Eelco Dolstra&lt;/a&gt;, and &lt;a href=&quot;http://www.eelcovisser.net&quot;&gt;Eelco Visser&lt;/a&gt; has been accepted at &lt;a href=&quot;http://www.gpce.org/07&quot;&gt;GPCE'07&lt;/a&gt;. 
(&lt;a href=&quot;http://swerl.tudelft.nl/twiki/pub/Main/TechnicalReports/TUD-SERG-2007-003.pdf&quot;&gt;pdf&lt;/a&gt;)</description>
	<pubDate>Fri, 08 Jun 2007 09:28:00 +0000</pubDate>
</item>
<item>
	<title>Eric Bouwers: Some new features</title>
	<guid>tag:blogger.com,1999:blog-28873279.post-8265584430250725211</guid>
	<link>http://ericbouwers.blogspot.com/2007/05/some-new-features.html</link>
	<description>Last Friday, I had a conversation with nEUrOO in #stratego about the results he was having with php-sat (see his &lt;a href=&quot;http://rgaucher.info/b/index.php/post/2007/05/24/PHP-Source-Code-Security-Scanners-basic-test&quot;&gt;blog&lt;/a&gt; for more details). After the conversation, and after looking at the test-file he mentioned in his blog, I got started and added 2 new features to php-sat.&lt;br /&gt;&lt;br /&gt;The first new feature is aimed at the usability of the tool itself, and is visible by a new command-line option: &lt;i&gt;-ra CODE&lt;/i&gt;. This option accepts one of &lt;b&gt;MCV, COR, EI, STY&lt;/b&gt; or &lt;b&gt; OPT&lt;/b&gt; as input, and makes sure that the only analysis that is run is the one that belongs to the given code. In other words, you can now run, for example, only the correctness checks by calling php-sat with: &lt;i&gt;--ra COR&lt;/i&gt;. This gives you a somewhat coarse-grained control over the behavior of the tool. A plan for more fine-grained control (on the level of patterns) is also mentioned some time ago, but the implementation of this level of control requires some more thoughts. In the meantime, please enjoy running a single kind of bug-patterns :).&lt;br /&gt;&lt;br /&gt;A second new feature is added to the analysis of safety-levels. Consider the following example:&lt;pre&gt;&amp;lt;?php&lt;br /&gt;  echo addslashes(htmlentities($_GET['name']));&lt;br /&gt;?&gt;&lt;/pre&gt; The default configuration for &lt;i&gt;echo&lt;/i&gt; requires a parameter to have both the level &lt;i&gt;EscapedHTML&lt;/i&gt; as well as &lt;i&gt;EscapedSlashes&lt;/i&gt;. Furthermore, the default configuration defines the return-type of the functions as:&lt;pre&gt;function: addslashes       level: escaped-slashes&lt;br /&gt;function: htmlentities     level: escaped-html&lt;/pre&gt; So this piece of code should not be flagged by php-sat. Unfortunately, previous revisions did flag this piece of code! &lt;br /&gt;&lt;br /&gt;The problem here is that the analysis uses the safety-level of a function that is mentioned in the configuration file &lt;u&gt;without&lt;/u&gt; considering the parameter of the function. This behavior works well for most functions, but when functions only add a property to their parameter it becomes incorrect. Because of this behavior, the &lt;i&gt;echo&lt;/i&gt;-statement is flagged because  the call to &lt;i&gt;addslashes&lt;/i&gt; is only annotated with &lt;i&gt;EscapedSlashes&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;Fortunately, the solution is not that complicated. Since we know that there are several functions that add a certain property to their parameter, we add the possibility to specify this in the configuration file. The new syntax for functions that add a safety-level is a '+' after the level of the function. This '+' forces a function to inspect the level of its (only) parameter and combine this with the level that is specified as its safety-level. The combination of the levels is the result of the function call. (Small note: this behavior is (currently) only supported for functions with a single parameter.)&lt;br /&gt;&lt;br /&gt;So from now on, when the following configuration is used: &lt;pre&gt;function: addslashes       level: escaped-slashes +&lt;br /&gt;function: htmlentities     level: escaped-html +&lt;/pre&gt; the example above is not flagged anymore because the call to &lt;i&gt;addslashes&lt;/i&gt; is annotated with its own safety-level (&lt;i&gt;EscapedSlashes&lt;/i&gt;), as well as the safety-level of its parameter (&lt;i&gt;EscapedHTML&lt;/i&gt;). A pretty useful feature I would say.</description>
	<pubDate>Mon, 28 May 2007 22:20:14 +0000</pubDate>
</item>
<item>
	<title>Eric Bouwers: Merging fun</title>
	<guid>tag:blogger.com,1999:blog-28873279.post-8663871666086271350</guid>
	<link>http://ericbouwers.blogspot.com/2007/05/merging-fun.html</link>
	<description>Yesterday, commit number &lt;a href=&quot;http://mail.cs.uu.nl/pipermail/psat-commits/2007q2/001051.html&quot;&gt;379&lt;/a&gt; and &lt;a href=&quot;http://mail.cs.uu.nl/pipermail/psat-commits/2007q2/001052.html&quot;&gt;380&lt;/a&gt; introduced a renewed implementation of the constant-propagation, and new functionality for finding vulnerabilities. You guessed it, the merging of constant-propagation and vulnerability analysis has taken off! The cool things are that 1) the old tests all pass, 2) some new tests pass and 3) I get to write a lot more tests!&lt;br /&gt;&lt;br /&gt;The &lt;a href=&quot;http://ericbouwers.blogspot.com/2007/04/thinking-of-merging.html&quot;&gt;main reason&lt;/a&gt; for starting the integration of both analysis was the fact that I saw a lot of code duplication popping up. This duplication was caused by the fact that the bookkeeping of internal structures is the same for all strategies, the code only differs for the properties of values. &lt;br /&gt;&lt;br /&gt;With this last piece of information I started to merging. My first approach consisted of trying to pass a list of get-set strategies to the &lt;i&gt;main&lt;/i&gt;-strategy and calling these strategies dynamically. This was obviously not a very good or nice start because it always seem to result in numerous segmentation faults. &lt;br /&gt;&lt;br /&gt;Thinking about the problem made the second attempt somewhat more pragmatic. Instead of generalizing I just wanted to make it work for constant propagation in combination with a second analysis. So I rewrote the strategy to receive two strategies, one for getting the properties of literals and one for getting the properties of operators. The choice for these language constructs is based on the reasoning that these constructs are the only ones that make or manipulate the actual properties of values. The other language constructs manipulate the flow of the values instead of the actual values. &lt;br /&gt;&lt;br /&gt;When this all seemed to work the more difficult challenge had to be solved, manipulation of variables and arrays. It turned out to be more simplistic then I thought because of the indirection between the variables and their values. For the purpose of dealing with aliasing, a variable does not point to a value but rather to a value-identifier. This identifier points to the actual value. This makes the creation of a reference easier, we just create a mapping from a variable to the value-identifier of the referenced variable. Because of this indirection we can simply make the value-identifier point to more then one property, implemented by a dynamic-rule for each property. This makes the merging of sets of dynamic rules a bit harder, but not impossible.&lt;br /&gt;&lt;br /&gt;It might sound simple (or incomprehensible), but getting everything right was still a bit tricky. For example, when an assignment is made the property of the RHS must be known before the LHS can be assigned this property. So what happens when the constant propagation cannot compute a value, should we simply fail to assign a property? &lt;br /&gt;The answer is no, the second analysis might still be successful. These kind of little problems made the implementation a little less straight-forward, and the code a little less beautiful. &lt;br /&gt;&lt;br /&gt;However, the result of it all is that the following example is now flagged correctly: &lt;pre&gt;&amp;lt;?php&lt;br /&gt; $foo = $_GET['asdf'];&lt;br /&gt; $bar = 1;&lt;br /&gt; $bar =&amp;amp; $foo;&lt;br /&gt; echo $bar;&lt;br /&gt;?&gt;&lt;/pre&gt; In this case, &lt;i&gt;echo $bar&lt;/i&gt; will be flagged by the latest php-sat.&lt;br /&gt;&lt;br /&gt;I experienced one problem with the implementation that is related to the semantics of Stratego. My first attempt in adding an annotation to a term was something like this:&lt;pre&gt; add-php-simple-value(|val):&lt;br /&gt;    t{a*} -&gt; t{annos}&lt;br /&gt;      where  b*    :=  a*&lt;br /&gt;           ; annos := [PHPSimpleValue(val) | b*]&lt;/pre&gt;This works perfectly, the annotations are matched as a list by the &lt;i&gt;*&lt;/i&gt;-syntax, and a list is added as an annotation to the term again. The only problem with this is that the second time this rule is applied it matches the annotations as a list of a list of annotations, which was not the behavior I desired. This problem is easily solved by also adding a &lt;i&gt;*&lt;/i&gt;  to build the term:&lt;pre&gt; add-php-simple-value(|val):&lt;br /&gt;    t{a*} -&gt; t{annos*}&lt;br /&gt;      where  b*     :=  a*&lt;br /&gt;           ; annos* := [PHPSimpleValue(val) | b*]&lt;/pre&gt;Now the list of annotations is not wrapped in an actual list anymore. I know it is documented somewhere, but this little explanation might save some others from an headache or a long debug-session.&lt;br /&gt;&lt;br /&gt;The next step in the analysis for vulnerabilities is a rather important one: &lt;b&gt;testing&lt;/b&gt;. Even though the basic parts of variables and assignments are already tested, there exists a large number of scenarios that need to be tested on this new integration-strategy. &lt;br /&gt;But hey, testing is fun!</description>
	<pubDate>Wed, 09 May 2007 22:14:26 +0000</pubDate>
</item>
<item>
	<title>Karl Trygve Kalleberg: Spoofax seminar rescheduled</title>
	<guid>http://journal.boblycat.org/2475 at http://journal.boblycat.org</guid>
	<link>http://journal.boblycat.org/node/2475</link>
	<description>&lt;p&gt;&lt;p&gt;Due to professoral scheduling constraints, I've had to move the &lt;a href=&quot;http://journal.boblycat.org/node/2453&quot;&gt;Spoofax seminar&lt;/a&gt;. New time, same place:&lt;/p&gt;
&lt;p&gt;Time: Tuesday 8th of May, 14:15.&lt;br /&gt;
Location: Lunch room, 3rd floor.&lt;/p&gt;
&lt;br class=&quot;giImageBlock-clear-both&quot; /&gt;&lt;/p&gt;</description>
	<pubDate>Mon, 30 Apr 2007 13:55:12 +0000</pubDate>
</item>
<item>
	<title>Eelco Visser: Global Variables</title>
	<guid>http://blog.eelcovisser.net/index.php?/archives/53-guid.html</guid>
	<link>http://blog.eelcovisser.net/index.php?/archives/53-Global-Variables.html</link>
	<description>During on of our chats on current affairs, Martin mentioned that Lennart Kats 
had proposed to introduce global variables in Stratego. My first reaction was
of course outrage. My second reaction was to immediately add it
to the compiler. The proposal was not to add some sort of C-style global variables,
but rather to provide better syntax for a programming pattern that was already
well established (although considered somewhat improper, at least by me). 

&lt;p&gt;&lt;/p&gt;

Dynamic rewrite rules are Stratego's feature for maintaining
state, albeit in a scoped way. A dynamic rule is a rewrite rule
defined at run-time. The following is the paradigmatic example of dynamic rules:

&lt;pre&gt;
  define-inline =
    ?Function(f, xs, e)
    ; rules( Inline : Call(f, es) -&gt; Let(xs, es, e)
&lt;/pre&gt;

This strategy definition matches a function definition for a function f with formal
parameters xs and body e, and then defines a dynamic rule Inline that rewrites
a call to function f to an instantiation of the body of the function. What distinghuishes
this definition from a static rewrite rule

&lt;pre&gt;
  Inline2 : Call(f, es) -&gt; Let(xs, es, e)
&lt;/pre&gt;

is that the variables f, xs, and e in the rule are inherited from the definition context (think
of it as a closure if that helps you). Indeed the rule Inline2 is not valid, since its right-hand
side uses the variables xs and e, which are not bound by the left-hand side.

&lt;p&gt;&lt;/p&gt;

So dynamic rules provide a way to dynamically construct a mapping from term (patterns)
to terms and use this mapping when convenient. Now it happens often in programming
that we just want to record a single value, which we want to access later. If we don't want
pass the value around using a variable, we need a global variable. This can be achieved
in Stratego using the following pattern:

&lt;pre&gt;
    x := &amp;lt;compute&amp;gt;
    ; rules( Foo : _ -&gt; x )
&lt;/pre&gt;

Here the value that 'compute' returns is bound to the variable x. Then the dynamic rule
Foo is defined to rewrite anything (underscore is wildcard and matches anything) to the
value of x. The value can later on be retrieved by an application &amp;lt;Foo&amp;gt;. This pattern
is not so nice since it has quite a bit of syntactic noise. What we would like is just write
&lt;pre&gt;
    Foo := &amp;lt;compute&amp;gt;
&lt;/pre&gt;

However, this binds Foo as a local variable in the current strategy definition. And we also
don't want to introduce C-style global variables.

&lt;p&gt;&lt;/p&gt;

Comes in the idea of Lennart, which is quite obvious in retrospect, as are all good ideas.
Still use the dynamic rule pattern above as implementation, but provide better syntax for
it. Still use the := operator, but in the context of a rules() interpret it as a dynamic global
variable assignment, so that we can now write the following for the pattern above:

&lt;pre&gt;
    rules( Foo := &amp;lt;compute&amp;gt; )
&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

I thought this was a great idea. Rather than putting this on the issue list, which is
always an ominous sine for a feature request ;-), I boasted to Martin to implement
this in five minutes. So we sat down defined the syntax for the rule and its implementation,
which is the addition of the following desugaring rule to the Stratego compiler's front-end:

&lt;pre&gt;
  Desugar :
    |[ rules( dr := t ) ]| -&gt; |[ where({y : !t; ?y; rules( dr : _ -&amp;gt; y )}) ]| 
    where y := &amp;lt;newname&amp;gt; &quot;globvar&quot;
&lt;/pre&gt;

The rule would compile the assignment above to

&lt;pre&gt;
    where({x : x := &amp;lt;compute&amp;gt;; rules( Foo : _ -&gt; x )})
&lt;/pre&gt;

introducing x as a fresh local variable. This took us 12 minutes from start
to the commit, including an informative commit message! Of course it
turned out that, while correct, the build didn't immediately succeed. To
add new syntax to Stratego, one first needs to create a new baseline
with the new syntax, before it can be used in the compiler. And Martin
added a nice test set.

&lt;p&gt;&lt;/p&gt;

While we were at it, we also included the following variant:

&lt;pre&gt;
  Desugar :
    |[ rules( dr :+= t ) ]| -&gt; |[ where({y : !t; ?y; rules( dr :+ _ -&amp;gt; y )}) ]| 
    where y := &amp;lt;newname&amp;gt; &quot;globvar&quot;
&lt;/pre&gt;

Exercise to the reader to figure out what this one does.

&lt;p&gt;&lt;/p&gt;

Another exercise to the reader is to explain why these global variables are
not the same as C-style global variables. 

&lt;p&gt;&lt;/p&gt;

There is also some room for critique. There are now two forms of the operator
:= in Stratego, one as a strategy x := t and one in the context of a dynamic
rules definition rules( x := t ). There is a subtle difference between these two;
can you spot it? (No, it is not eagerness, both versions first evaluate t before
assigning it to x.) 

Another issue is the cost in terms of time and space, at least compared to a
simple C assignment, and with the current implementation of dynamic rules.
The plans for a new implementation scheme for dynamic rules would improve
at least the storage cost.

&lt;p&gt; 

There you have it, challenging questions for the knowing. An opportunity for
comments to this blog?&lt;/p&gt;</description>
	<pubDate>Thu, 26 Apr 2007 17:45:00 +0000</pubDate>
</item>
<item>
	<title>Karl Trygve Kalleberg: Upcoming Seminar: Spoofax: A Development Environment for Software Transformations</title>
	<guid>http://journal.boblycat.org/2453 at http://journal.boblycat.org</guid>
	<link>http://journal.boblycat.org/node/2453</link>
	<description>&lt;p&gt;&lt;p&gt;As part of the PhD formalities, I'm required to hold a seminar on a topic of my own choosing. It's supposed to demonstrate to willing (or not-so-willing) listeners that I know how to talk scientifically and intelligibly about at least one subject.&lt;/p&gt;
&lt;p&gt;I decided to present the Eclipse plugin for Stratego I've been hacking on for the last two years. It's becoming a rather interesting development environment, and I suspect that people with an interest in computer languages and/or development environments might actually find some of the material interesting.&lt;/p&gt;
&lt;p&gt;Everybody, even (perhaps especially!) non-university folks are of course welcome to drop in, if they have the time.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;br /&gt;
Software development is expensive primarily because of the associated&lt;br /&gt;
maintenance cost; recent estimates suggest that about 70-90% of the&lt;br /&gt;
total cost of a software product is due to maintenance. It is therefore&lt;br /&gt;
desirable to automate as tasks as possible by supplying convenient and&lt;br /&gt;
powerful maintenance tools to the developers. This automation requires&lt;br /&gt;
the construction of software that analyses and transforms&lt;br /&gt;
other software.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Software transformation languages are programming languages designed&lt;br /&gt;
specifically for analysing and transforming software. They provide&lt;br /&gt;
language features and libraries that make it much simpler to automate&lt;br /&gt;
maintenance tasks. However, they are usually built on unfamiliar&lt;br /&gt;
programming paradigms, such as term or graph rewriting, and learning&lt;br /&gt;
them is often complicated by lack of good development environments.&lt;/p&gt;
&lt;p&gt;In this talk, I will demonstrate Spoofax, an interactive program&lt;br /&gt;
transformation environment based on Eclipse. This environment supports&lt;br /&gt;
the development of stand-alone software transformation programs using&lt;br /&gt;
the Stratego software transformation language and the XT toolkit of&lt;br /&gt;
transformation components. I will demonstrate the applicability of&lt;br /&gt;
Spoofax and Stratego/XT through a series of transformation programs for&lt;br /&gt;
Java code.&lt;br /&gt;
&lt;/p&gt;&lt;/p&gt;
&lt;p&gt;Time: 14:15, Tuesday 8th of May (&lt;b&gt;Updated Again&lt;/b&gt;)&lt;br /&gt;
Location: Lunchroom, 3rd Floor, Informatikkblokken, Høyteknologisenteret i Bergen&lt;br /&gt;
Cookies: Yes&lt;/p&gt;
&lt;p&gt;If you're vaguely interested in dropping in, but don't know exactly where to go, contact me or drop by room 4152A (my office) in the fourth floor in the Informatics-wing of HIB around 14:05, and I'll guide you.&lt;/p&gt;
&lt;br class=&quot;giImageBlock-clear-both&quot; /&gt;</description>
	<pubDate>Fri, 20 Apr 2007 10:04:05 +0000</pubDate>
</item>
<item>
	<title>Eric Bouwers: Thinking of Merging</title>
	<guid>tag:blogger.com,1999:blog-28873279.post-2560454953227834285</guid>
	<link>http://ericbouwers.blogspot.com/2007/04/thinking-of-merging.html</link>
	<description>I have been dealing with some challenges in the last couple of days. For example my &lt;a href=&quot;http://www.cs.uu.nl/docs/vakken/dba/exercise.htm&quot;&gt;practical assignment&lt;/a&gt; for DBA, to be implemented in &lt;a href=&quot;http://citeseer.ist.psu.edu/boncz99mil.html&quot;&gt;MIL&lt;/a&gt;, and styling the &lt;a href=&quot;http://ideas.cs.uu.nl/wiki/index.php/RFG:GuiDesign&quot;&gt;GUI&lt;/a&gt; for my thesis, which is coming along just &lt;a href=&quot;http://ideas.cs.uu.nl/~eric/frontend/&quot;&gt;fine&lt;/a&gt; I guess. Both of these tasks are easy for people who invented/work with it every day, but I sometimes find it hard to wrap my mind around the problem or keeping track of every detail. Good luck for me there exists a topic where I can work on without repeatedly searching on Google, analyzing PHP!  &lt;br /&gt;&lt;br /&gt;Speaking of analyzing PHP, Martin has written a &lt;a href=&quot;http://mbravenboer.blogspot.com/2007/04/migration-of-yacc-grammar-for-php-to.html&quot;&gt;blog&lt;/a&gt; about the generation of rules for operator-precedence in PHP. He mentions some interesting ideas for work on grammar engineering, so if you are looking for a (thesis)-project you should definitely check it out. Otherwise it is just an interesting post to read.&lt;br /&gt;&lt;br /&gt;As for my work in operators in PHP, I have finished the rest of the operators in PHP-Sat. Furthermore, the implementation of the constant-propagation regarding operators is revised within PHP-Front. This is done because I am thinking about merging the constant-propagation and the safety-type analysis into one big analysis. I know, it sounds like &lt;a href=&quot;http://www.google.com/search?q=premature+optimization&quot;&gt;premature optimization&lt;/a&gt; (a.k.a. the root of all evil), but I can explain why it is necessary.&lt;br /&gt;&lt;br /&gt;Consider the following piece of code:&lt;pre&gt;&amp;nbsp;&amp;nbsp;$foo = array(1,2);&lt;br /&gt;&amp;nbsp;&amp;nbsp;$foo[] = $_GET['bar'];&lt;br /&gt;&amp;nbsp;&amp;nbsp;echo $foo[2];&lt;/pre&gt; When we consider the constant-propagation we first assign the values &lt;i&gt;1&lt;/i&gt; and &lt;i&gt;2&lt;/i&gt; to the first two indexes of the array. The value of &lt;i&gt;$_GET['foo']&lt;/i&gt; is then assigned to the third index of the array which is the parameter to &lt;i&gt;echo&lt;/i&gt; in the last statement. We know that the value is assigned to the third index because PHP-Front keeps track of the internal index-count of arrays. &lt;br /&gt;Now lets look at the safety-type analysis. We first assign the safety-type &lt;i&gt;IntegerType&lt;/i&gt; to the first two indexes of the array. The safety-type of &lt;i&gt;$_GET['foo']&lt;/i&gt; is then assigned to the third index of the array which is the parameter to &lt;i&gt;echo&lt;/i&gt; in the last statement. We know that the safety-type is assigned to the third index because PHP-Sat keeps track of the internal index-count of arrays. &lt;br /&gt;&lt;br /&gt;You might have noticed that both paragraphs are almost identical, except for the kind of value that is assigned. Thinking about this case, cases for function calls and cases for objects it turns out that performing the safety-analysis involves a lot of bookkeeping. This bookkeeping, for example the internal index-count, is not specific for the propagated values, it encodes the internal semantics of PHP. Therefore, in order to provide a good safety-type analysis, we have to embed this bookkeeping. &lt;br /&gt;&lt;br /&gt;In order to avoid code duplication, which might be worse then premature optimization, I believe we must merge the two analyzes together. By separating the assignment of values from the bookkeeping we can visit a node, perform the bookkeeping and then perform as much analyzes on the node as we want. The only thing needed is a list of strategies that encodes a single analysis on the node.&lt;br /&gt;&lt;br /&gt;The idea might sound a bit vague, but while I was working on the operators I already saw some duplication creeping in. Some of the strategies for both analysis only differ on the strategies to &lt;i&gt;fetch&lt;/i&gt; or &lt;i&gt;add&lt;/i&gt; some value, a perfect change to generalize a bit I would say.</description>
	<pubDate>Tue, 10 Apr 2007 21:38:10 +0000</pubDate>
</item>
<item>
	<title>Martin Bravenboer: Migration of the YACC grammar for PHP to SDF</title>
	<guid>tag:blogger.com,1999:blog-6943366.post-2611748389855552008</guid>
	<link>http://mbravenboer.blogspot.com/2007/04/migration-of-yacc-grammar-for-php-to.html</link>
	<description>&lt;p&gt;
Last summer, &lt;a href=&quot;http://ericbouwers.blogspot.com&quot;&gt;Eric Bouwers&lt;/a&gt; started working on infrastructure for PHP program transformation and analysis, sponsored by the Google Summer of Code. He did an excellent job, thanks to his expertise in PHP and his thorough knowledge of &lt;a href=&quot;http://www.strategoxt.org&quot;&gt;Stratego/XT&lt;/a&gt;. To enjoy all the language engineering support in Stratego/XT, Eric developed a PHP grammar in SDF, the grammar formalism that is usually applied in Stratego/XT projects. Unfortunately it proved to be very difficult to get the grammar of PHP right.
&lt;/p&gt;

&lt;h2&gt;PHP precedence problems&lt;/h2&gt;

&lt;p&gt;
PHP features many operators, and the precedence of the operators is somewhat unusual and challenging for a grammar formalism. For example, PHP allows the weak binding assignment operator as an argument of the binary, strong binding &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; operator:
&lt;/p&gt;

&lt;pre&gt;
  if ($is_upload &amp;amp;&amp;amp; $file = fopen($fname, 'w')) { 
    ...
  }
&lt;/pre&gt;

&lt;p&gt;
The same holds for the unary, strong binding &lt;code&gt;!&lt;/code&gt; operator:
&lt;/p&gt;

&lt;pre&gt;
  if(!$foo = getenv('BAR')){
    ...
  }
&lt;/pre&gt;

&lt;p&gt;
A similar precedence rule for the &lt;code&gt;include&lt;/code&gt; operator allows an &lt;code&gt;include&lt;/code&gt; to occur as the argument of the strong binding &lt;code&gt;@&lt;/code&gt; operator:
&lt;/p&gt;

&lt;pre&gt;
  @include_once 'Var/Renderer/' . $mode . '.php'
&lt;/pre&gt;

&lt;h2&gt;Precedence rule recovery&lt;/h2&gt;

&lt;p&gt;
The most serious problem was to find out what the exact precedence rules of PHP operators are. The syntax of PHP is defined by a YACC grammar, which has a notion of precedence declarations that is heavily used by the PHP grammar. Unfortunately, for more complex grammars it is far from clear what the exact effect of the precedence declarations are. The precedence declarations are only used for conflict resolution in the parse table generator, so if there is no conflict, then the precedence declarations do not actually have any effect on a particular combination of operators. That's why we developed support for recovering precedence rules from YACC grammars, which I already wrote about in a &lt;a href=&quot;http://mbravenboer.blogspot.com/2007/01/grammar-engineering-im-loving-it.html&quot;&gt;previous blog&lt;/a&gt;. Based on these tools, we now have a very precise specification of the precedence rules of PHP.
&lt;/p&gt;

&lt;p&gt;
The next step in the process of getting a perfect PHP grammar was to actually use this specification to develop very precise precedence declarations for the SDF grammar of PHP. However, the precedence rule specification involves about 1650 rules, so migrating these precedence rules to SDF precedence declarations by hand is not really an option. Fortunately, all the ingredients are actually there to &lt;em&gt;generate&lt;/em&gt; SDF priority declarations from the precedence rules that we recover from the YACC grammar.
&lt;/p&gt;

&lt;h2&gt;Argument-specific priorities&lt;/h2&gt;

&lt;p&gt;
Thanks to two new features of SDF, these precedence rules can be translated directly to SDF. The first feature is argument-specific priorities. In the past, SDF only allowed priority declarations between productions. For example, the SDF priority
&lt;/p&gt;

&lt;pre&gt;
  E &quot;*&quot; E -&gt; E &gt; E &quot;+&quot; E -&gt; E
&lt;/pre&gt;

&lt;p&gt;
defines that the production for the &lt;code&gt;+&lt;/code&gt; operator cannot be applied to produce any of the &lt;code&gt;E&lt;/code&gt; arguments of the production for the &lt;code&gt;*&lt;/code&gt; operator, hence the production for the addition operator cannot be applied on the left-hand side or right-hand side of the multiplication operator. This priority implies that the multiplication operator binds stronger than the addition operator. This single SDF priority corresponds to the following &lt;em&gt;two&lt;/em&gt; precedence rules in the grammar formalism independent notation we are using in the &lt;a href=&quot;http://www.stratego-language.org/Stratego/GrammarEngineeringTools&quot;&gt;Stratego/XT Grammar Engineering Tools&lt;/a&gt;:
&lt;/p&gt;

&lt;pre&gt;
  &amp;lt;E -&gt; &amp;lt;E -&gt; E + E&gt; * E&gt;
  &amp;lt;E -&gt; E * &amp;lt;E -&gt; E + E&gt;&gt;
&lt;/pre&gt;

&lt;p&gt;
For many languages precedence rules are different for arguments of the same production. That's why we us the more specific representation of a precedence rules in our grammar engineering tools. Fortunately, SDF now supports argument-specific priorities as well. These argument-specific priorities are just plain numbers that indicate to which arguments of a production the priority applies. For example, the following SDF priority forbids the assignment operator only at the left-most and the right-most &lt;code&gt;E&lt;/code&gt; of the conditional operator:
&lt;/p&gt;

&lt;pre&gt;
  E &quot;?&quot; E &quot;:&quot; E -&gt; E &amp;lt;0,4&gt; &gt; E &quot;=&quot; E
&lt;/pre&gt;

&lt;p&gt;
This corresponds to the following precedence rules:
&lt;/p&gt;

&lt;pre&gt;
  &amp;lt;E -&gt; &amp;lt;E -&gt; E = E&gt; ? E : E&gt;
  &amp;lt;E -&gt; E ? E : &amp;lt;E -&gt; E = E&gt;&gt;
&lt;/pre&gt;

&lt;h2&gt;Non-transitive priorities&lt;/h2&gt;

&lt;p&gt;
The second new SDF feature that is required for expressing the PHP precedence rules is non-transitive priorities. Before the introduction of this feature, all SDF priorities where transitively closed. For example, if there are two separate priorities
&lt;/p&gt;

&lt;pre&gt;
  &quot;!&quot; E -&gt; E   &gt; E &quot;+&quot; E -&gt; E
  E &quot;+&quot; E -&gt; E &gt; V &quot;=&quot; E -&gt; E
&lt;/pre&gt;

&lt;p&gt;
then by the transitive closure of priorities this would imply the priority
&lt;/p&gt;

&lt;pre&gt;
  &quot;!&quot; E -&gt; E &gt;  V &quot;=&quot; E -&gt; E
&lt;/pre&gt;

&lt;p&gt;
This transitive closure feature is useful in most cases, but for some languages (such as PHP) the precedence rules are in fact not transitively closed, which makes the definition of these rules in SDF slightly problematic. For this reason, SDF now also features non-transitive priorities, using a dot before the &lt;code&gt;&gt;&lt;/code&gt; of the priority:
&lt;/p&gt;

&lt;pre&gt;
  &quot;!&quot; E -&gt; E .&gt; E &quot;+&quot; E -&gt; E
&lt;/pre&gt;

&lt;p&gt;
Non-transitive priorities will not be included in the transitive closure, which gives you very precise control over the precedence rules.
&lt;/p&gt;

&lt;h2&gt;Precedence rule migration&lt;/h2&gt;

&lt;p&gt;
Thanks to the position-specific, non-transitive priorities of SDF, the precedence rules that we recover from the YACC grammar for PHP can now be mapped directly to SDF priority declarations. The two precedence rules mentioned earlier:
&lt;/p&gt;

&lt;pre&gt;
  &amp;lt;E -&gt; &amp;lt;E -&gt; E + E&gt; * E&gt;
  &amp;lt;E -&gt; E * &amp;lt;E -&gt; E + E&gt;&gt;
&lt;/pre&gt;

&lt;p&gt;
now translate directly to SDF priorities:
&lt;/p&gt;

&lt;pre&gt;
  E * E -&gt; E &amp;lt;0&gt; .&gt; E + E -&gt; E
  E * E -&gt; E &amp;lt;2&gt; .&gt; E + E -&gt; E
&lt;/pre&gt;

&lt;p&gt;
The migration of the recovered YACC precedence rules results in about 1650 of these SDF priorities, but thanks to the fully automatic migration this huge number of priorities is not really a problem. The resulting PHP syntax definition immediately &lt;a href=&quot;https://bugs.cs.uu.nl/browse/PSAT-55&quot;&gt;solved&lt;/a&gt; &lt;a href=&quot;https://bugs.cs.uu.nl/browse/PSAT-58&quot;&gt;all&lt;/a&gt; the &lt;a href=&quot;https://bugs.cs.uu.nl/browse/PSAT-49&quot;&gt;known&lt;/a&gt; &lt;a href=&quot;https://bugs.cs.uu.nl/browse/PSAT-53&quot;&gt;issues&lt;/a&gt; with the PHP syntax definition, which shows that this migration was most reliable and successful.
&lt;/p&gt;

&lt;h2&gt;Future&lt;/h2&gt;

&lt;p&gt;
There is a lot of interesting work left to be done. First, it would be interesting to develop a more formal grammar for PHP, similar to the grammars of the C, Java, and C# specifications. These specifications all encode the precedence rules of the operators in the production rules, by introducing non-terminals for all the precedence levels. It should not be too difficult to automatically determine such an encoding from the precedence rules we recover. This would result in a formal specification of the PHP syntax, which will benefit many other parser generators. One of the remarkable things we found out is that the unary &lt;code&gt;-&lt;/code&gt; operator has the same precedence as the binary &lt;code&gt;-&lt;/code&gt; (usually it binds stronger), which results in &lt;code&gt;-1 * 3&lt;/code&gt; being parsed as &lt;code&gt;-(1 * 3)&lt;/code&gt;. We have not been able to find an example where this strange precedence rule results in unexpected behaviour, but for the development of a solid parser is it essential that such precedence rules are defined precisely.
&lt;/p&gt;

&lt;p&gt;
Second, it would be good to try to minimize the number of generated SDF priorities by determining a priority declaration that you can actually oversee as a human. This would involve finding out where the transitive closure feature of SDF priorities can be used to remove redundant priority declarations.
&lt;/p&gt;

&lt;p&gt;
Third, it would great to integrate the precedence rule migration in a tool that completely migrates a YACC/FLEX grammar to SDF. For this, we need tools to parse and understand a FLEX specification and extend the existing support for precedence rule migration to other YACC productions.
&lt;/p&gt;

&lt;p&gt;
Clearly, there is lots of interesting (and useful!) grammar engineering work to do in this direction!
&lt;/p&gt;</description>
	<pubDate>Tue, 03 Apr 2007 17:00:54 +0000</pubDate>
</item>
<item>
	<title>Martin Bravenboer: LDTA'07 slides on Grammar Engineering Tools</title>
	<guid>tag:blog