From 59da54cc7d0e73db4544c80451fb80cc0c6cb47e Mon Sep 17 00:00:00 2001 From: grammarware Date: Sun, 24 Jun 2012 08:41:04 +0200 Subject: [PATCH] Rascal ADT extractor changed to extract choice as choice --- shared/rascal/src/extract/RascalADT2BGF.rsc | 8 ++++---- topics/convergence/guided/bgf/rascal-a.bgf | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/shared/rascal/src/extract/RascalADT2BGF.rsc b/shared/rascal/src/extract/RascalADT2BGF.rsc index 2a4559c5..ac366388 100644 --- a/shared/rascal/src/extract/RascalADT2BGF.rsc +++ b/shared/rascal/src/extract/RascalADT2BGF.rsc @@ -50,10 +50,10 @@ BGFGrammar process(loc src) return normalise(syntax::BGF::grammar([],ps)); } -list[BGFProduction] def2prod((DataDef)` = ;`) - = [production("","",expr2expr(d))]; -default list[BGFProduction] def2prod((DataDef)` = <{DataExpr "|"}+ ds> ;`) - = [production("","",expr2expr(d)) | d <- ds]; +BGFProduction def2prod((DataDef)` = ;`) + = production("","",expr2expr(d)); +default BGFProduction def2prod((DataDef)` = <{DataExpr "|"}+ ds> ;`) + = production("","",choice([expr2expr(d) | d <- ds])); BGFExpression type2expr((Name)`str`) = val(string()); BGFExpression type2expr((Name)`int`) = val(integer()); diff --git a/topics/convergence/guided/bgf/rascal-a.bgf b/topics/convergence/guided/bgf/rascal-a.bgf index 21033eaf..bcbf71e3 100644 --- a/topics/convergence/guided/bgf/rascal-a.bgf +++ b/topics/convergence/guided/bgf/rascal-a.bgf @@ -1,2 +1,2 @@ -FLPrgfsFLFunFLFunfstringargsstrbodyFLExprFLExpre1FLExpropFLOpe2FLExprFLExprfstringvargsFLExprFLExprcFLExprtFLExpreFLExprFLExprastringFLExpriintFLOpFLOpFLOp +FLPrgfsFLFunFLFunfstringargsstrbodyFLExprFLExprbinarye1FLExpropFLOpe2FLExprapplyfstringvargsFLExprifThenElsecFLExprtFLExpreFLExprargumentastringliteraliintFLOpminusplusequal