diff options
| author | aarne <unknown> | 2004-09-22 20:42:21 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2004-09-22 20:42:21 +0000 |
| commit | d5b4230d6dbee8c03eedf8d181dfa2badf1a954b (patch) | |
| tree | b2d8fd926161d4d904fbf42aa25261ac90691e40 /examples/gfcc/ImperC.gf | |
| parent | a0116fd288640a47166b5104b46d9b6fa510a563 (diff) | |
making parsing ImperC work
Diffstat (limited to 'examples/gfcc/ImperC.gf')
| -rw-r--r-- | examples/gfcc/ImperC.gf | 20 |
1 files changed, 12 insertions, 8 deletions
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 ; |
