diff options
| author | john.j.camilleri <john.j.camilleri@chalmers.se> | 2013-09-16 07:17:27 +0000 |
|---|---|---|
| committer | john.j.camilleri <john.j.camilleri@chalmers.se> | 2013-09-16 07:17:27 +0000 |
| commit | f5461eb3d4eb2605b546a4ed202c12bcdaa1f4e4 (patch) | |
| tree | 946c9e8542b8e8271b6b529a95c0400fa6613cb4 /examples/gfcc/ImperC.gf | |
| parent | 8e1c6cca407c82fc09569d80c231b8d256735989 (diff) | |
Remove contribs and examples
Everything has now been moved to a separate repository at
https://github.com/GrammaticalFramework/gf-contrib
The contents of the examples folder are build during SetupWeb
Diffstat (limited to 'examples/gfcc/ImperC.gf')
| -rw-r--r-- | examples/gfcc/ImperC.gf | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/examples/gfcc/ImperC.gf b/examples/gfcc/ImperC.gf deleted file mode 100644 index 57f9d9f9e..000000000 --- a/examples/gfcc/ImperC.gf +++ /dev/null @@ -1,56 +0,0 @@ ---# -path=.:../../lib/prelude -concrete ImperC of Imper = open ResImper in { - flags lexer=codevars ; unlexer=code ; startcat=Program ; - - lincat - Exp = PrecExp ; - Typ = {s,s2 : Str} ; - Rec = {s,s2,s3 : Str} ; - - lin - Empty = ss [] ; - 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) ; - - RecOne typ stm prg = stm ** { - s2 = typ.s ++ stm.$0 ; - s3 = prg.s - } ; - 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 ; - Assign _ x exp = continues (x.s ++ "=" ++ 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.s2 ++ "," ++ e.s)) ; - Return _ exp = statement ("return" ++ exp.s) ; - Returnv = statement "return" ; - End = ss [] ; - - EVar _ x = constant x.s ; - EInt n = constant n.s ; - EFloat a b = constant (a.s ++ "." ++ b.s) ; - EMul _ _ = infixL 3 "*" ; - EAdd _ _ = infixL 2 "+" ; - ESub _ _ = infixL 2 "-" ; - ELt _ _ = infixN 1 "<" ; - - EAppNil val f = constant (f.s ++ paren []) ; - EApp args val f exps = constant (f.s ++ paren exps.s) ; - - TInt = {s = "int" ; s2 = "\"%d\""} ; - TFloat = {s = "float" ; s2 = "\"%f\""} ; - NilTyp = ss [] ; - ConsTyp = cc2 ; - OneExp _ e = e ; - ConsExp _ _ e es = ss (e.s ++ "," ++ es.s) ; -} |
