summaryrefslogtreecommitdiff
path: root/examples/gfcc/ImperC.gf
diff options
context:
space:
mode:
authoraarne <unknown>2004-09-25 08:24:11 +0000
committeraarne <unknown>2004-09-25 08:24:11 +0000
commit5a208ce3ea26726d15e814c0498680597cca45fa (patch)
tree89ca12f9b6f9fe16cf4bcd6d165e13f3021ce619 /examples/gfcc/ImperC.gf
parentff2a2895c08b667894b565c8d39f0bf63d85492a (diff)
compiler works on abs and fibonacci
Diffstat (limited to 'examples/gfcc/ImperC.gf')
-rw-r--r--examples/gfcc/ImperC.gf4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/gfcc/ImperC.gf b/examples/gfcc/ImperC.gf
index fd59e16d5..d4e690635 100644
--- a/examples/gfcc/ImperC.gf
+++ b/examples/gfcc/ImperC.gf
@@ -27,10 +27,12 @@ concrete ImperC of Imper = open ResImper in {
Decl typ cont = continues (typ.s ++ cont.$0) cont ;
Assign _ x exp = continues (x.s ++ "=" ++ exp.s) ;
- Return _ exp = statement ("return" ++ exp.s) ;
While exp loop = continue ("while" ++ paren exp.s ++ loop.s) ;
IfElse exp t f = continue ("if" ++ paren exp.s ++ t.s ++ "else" ++ f.s) ;
Block stm = continue ("{" ++ stm.s ++ "}") ;
+ Printf t e = continues ("printf" ++ paren (t.s ++ "," ++ e.s)) ;
+ Return _ exp = statement ("return" ++ exp.s) ;
+ Returnv = statement "return" ;
End = ss [] ;
EVar _ x = constant x.s ;