From 3ead73f4a63dfea9b1b0cf76c1581181778e6739 Mon Sep 17 00:00:00 2001 From: grammarware Date: Sun, 8 Jul 2012 12:33:04 +0200 Subject: [PATCH] Fixed a bug in the algebratic data type extractor --- shared/rascal/src/extract/RascalADT2BGF.rsc | 5 +++-- topics/convergence/guided/bgf/rascal-a.bgf | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/shared/rascal/src/extract/RascalADT2BGF.rsc b/shared/rascal/src/extract/RascalADT2BGF.rsc index ac366388..1884f9d3 100644 --- a/shared/rascal/src/extract/RascalADT2BGF.rsc +++ b/shared/rascal/src/extract/RascalADT2BGF.rsc @@ -7,6 +7,7 @@ import String; import syntax::BGF; import normal::BGF; import io::WriteBGF; +import export::BNF; layout LAYOUTLIST = LAYOUT* !>> [\ \t\n\r/]; lexical LAYOUT @@ -32,7 +33,7 @@ public void main(list[str] args) public void main() { - iprintln(process(|project://fl/src/Abstract.rsc|)); + println(pp(process(|project://fl/src/Abstract.rsc|))); } BGFGrammar process(loc src) @@ -59,7 +60,7 @@ BGFExpression type2expr((Name)`str`) = val(string()); BGFExpression type2expr((Name)`int`) = val(integer()); default BGFExpression type2expr(Name n) = nonterminal(""); -BGFExpression expr2expr((DataExpr)``) = nonterminal(""); +BGFExpression expr2expr((DataExpr)``) = type2expr(t); BGFExpression expr2expr((DataExpr)``) = selectable("",type2expr(t)); BGFExpression expr2expr((DataExpr)`()`) = selectable("",epsilon()); BGFExpression expr2expr((DataExpr)`()`) = selectable("",expr2expr(e)); diff --git a/topics/convergence/guided/bgf/rascal-a.bgf b/topics/convergence/guided/bgf/rascal-a.bgf index bcbf71e3..6a9b0a8d 100644 --- a/topics/convergence/guided/bgf/rascal-a.bgf +++ b/topics/convergence/guided/bgf/rascal-a.bgf @@ -1,2 +1,2 @@ -FLPrgfsFLFunFLFunfstringargsstrbodyFLExprFLExprbinarye1FLExpropFLOpe2FLExprapplyfstringvargsFLExprifThenElsecFLExprtFLExpreFLExprargumentastringliteraliintFLOpminusplusequal +FLPrgfsFLFunFLFunfstringargsstringbodyFLExprFLExprbinarye1FLExpropFLOpe2FLExprapplyfstringvargsFLExprifThenElsecFLExprtFLExpreFLExprargumentastringliteraliintFLOpminusplusequal