From d5b4230d6dbee8c03eedf8d181dfa2badf1a954b Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 22 Sep 2004 20:42:21 +0000 Subject: making parsing ImperC work --- examples/gfcc/ImperC.gf | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'examples/gfcc/ImperC.gf') diff --git a/examples/gfcc/ImperC.gf b/examples/gfcc/ImperC.gf index 28ce65a95..69ffa9226 100644 --- a/examples/gfcc/ImperC.gf +++ b/examples/gfcc/ImperC.gf @@ -4,21 +4,25 @@ concrete ImperC of Imper = open ResImper in { lincat Exp = PrecExp ; - Body = {s,s2 : Str} ; + Rec = {s,s2,s3 : Str} ; lin Empty = ss [] ; - Funct args val body cont = ss ( - val.s ++ cont.$0 ++ paren body.s2 ++ "{" ++ - body.s ++ "}" ++ ";" ++ cont.s) ; + FunctNil val stm cont = ss ( + val.s ++ cont.$0 ++ paren [] ++ "{" ++ + stm.s ++ "}" ++ ";" ++ cont.s) ; + Funct args val rec = ss ( + val.s ++ rec.$0 ++ paren rec.s2 ++ "{" ++ + rec.s ++ "}" ++ ";" ++ rec.s3) ; - BodyNil stm = stm ** {s2 = []} ; - BodyOne typ stm = stm ** { - s2 = typ.s ++ stm.$0 + RecOne typ stm prg = stm ** { + s2 = typ.s ++ stm.$0 ; + s3 = prg.s } ; - BodyCons typ _ body = { + RecCons typ _ body prg = { s = body.s ; s2 = typ.s ++ body.$0 ++ "," ++ body.s2 ; + s3 = prg.s } ; Decl typ cont = continues (typ.s ++ cont.$0) cont ; -- cgit v1.2.3