Concrete syntax constructors getting lost in JSGLR
using concrete Java syntax in Stratego:
rules foo1 : java |[ {java_bstm*} ]| -> "" foo2 : java |[ {~bstm*:bstm*} ]| -> ""
gives this AST
Rules( [ RDefNoArgs( "foo1" , RuleNoCond( ToMetaExpr(Block([meta-var("java_bstm*")])) , NoAnnoList(Str("\"\"")) ) ) , RDefNoArgs( "foo2" , RuleNoCond( ToMetaExpr(Block([Var(ListVar("bstm*"))])) , NoAnnoList(Str("\"\"")) ) ) ] )
The meta variables
java_bstm*
andbstm*
should represent lists of statements, and not single statements inside a single-statement block. The relevant productions for concrete Java support are:Submitted by Sebastian Erdweg on 2 March 2011 at 21:46variables "java_" "bstm" [0-9\']* "*" -> JavaBlockStm* {prefer} context-free syntax "~bstm*:" StrategoTerm -> JavaBlockStm* {cons("FromMetaExpr")}
Issue Log
(It seems email notifications were broken, only just noticed this issue.) So you found a case where you could reproduce this problem? Was it in any of the source files? The XML one I looked at seemed to work. Anyway, the problem likely resides in the TreeBuilder class that implodes the tree. As a workaround, you can probably use
~bstm:bstms
as well.
Using
~bstm:bstms
did not help.I extracted the example to the following file:
https://svn.strategoxt.org/repos/StrategoXT/sugarj/branches/SugarJ-editor-services/case-studies/concretesyntax/MetaListVarTest.sugj
This may be a duplicate of Spoofax/346, and may indicate a parser issue rather than an imploder issue.
Log in to post comments