Submitted on 26 April 2005 at 13:54

On 2 October 2012 at 14:39 André Vieira commented:

We stumbled upon this again with the new WebDSL’s String constructor using an ast(…) attribute. The signature had to be added manually.

This could be implemented by using a pattern matching for AST attributes ( I created a grammar for them in my Automated Testing project) and adding an extra prod2prodrule handling this special case.

If we take a look at the current prod2prodrule implementation, we can see a sdf production rule is transformed into the following format rtg |[ A -> y(t*) ]| where A is the sort type, y the constructor name and t* a tree representation of the production rule. Im just not sure about the last (t*) but y can be extracted from the ast(…) term and if there is no main constructor, so basically if after parsing the ast term the top level aterm is not of type ASTCons (from my Testing project), then we can ignore the rule since it does not have a constructor.

After that we can procede to use the body of ASTCons to construct the tree t*, I just need to know what this tree structure is supposed to look like.


On 28 January 2013 at 14:47 Eelco Visser removed tag 0.18

On 28 January 2013 at 14:47 Eelco Visser tagged interesting

Log in to post comments