summaryrefslogtreecommitdiff
path: root/old-examples/tutorial/calculator
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-27 09:18:50 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-27 09:18:50 +0000
commit5c713d8f027a9b6be687ee3f7e917e8bd2115773 (patch)
tree65da19829810b753345a5b2164bef2d8876268dd /old-examples/tutorial/calculator
parentf7b2a83059697f1b36a6369e489ac276e7ff875d (diff)
took away old-examples
Diffstat (limited to 'old-examples/tutorial/calculator')
-rw-r--r--old-examples/tutorial/calculator/Calculator.gf25
-rw-r--r--old-examples/tutorial/calculator/CalculatorC.gf24
-rw-r--r--old-examples/tutorial/calculator/CalculatorE.gf27
-rw-r--r--old-examples/tutorial/calculator/CalculatorJ.gf25
-rw-r--r--old-examples/tutorial/calculator/CalculatorP.gf27
5 files changed, 0 insertions, 128 deletions
diff --git a/old-examples/tutorial/calculator/Calculator.gf b/old-examples/tutorial/calculator/Calculator.gf
deleted file mode 100644
index 65192e226..000000000
--- a/old-examples/tutorial/calculator/Calculator.gf
+++ /dev/null
@@ -1,25 +0,0 @@
-abstract Calculator = {
-
- flags startcat = Prog ;
-
- cat Prog ; Exp ; Var ;
-
- fun
- PEmpty : Prog ;
- PInit : Exp -> (Var -> Prog) -> Prog ;
- PAss : Var -> Exp -> Prog -> Prog ;
-
- EPlus, EMinus, ETimes, EDiv : Exp -> Exp -> Exp ;
-
- EInt : Int -> Exp ;
- EVar : Var -> Exp ;
-
- ex1 : Prog ;
-
- def
- ex1 =
- PInit (EPlus (EInt 2) (EInt 3)) (\x ->
- PInit (EPlus (EVar x) (EInt 1)) (\y ->
- PAss x (EPlus (EVar x) (ETimes (EInt 9) (EVar y))) PEmpty)) ;
-
-}
diff --git a/old-examples/tutorial/calculator/CalculatorC.gf b/old-examples/tutorial/calculator/CalculatorC.gf
deleted file mode 100644
index 53eade357..000000000
--- a/old-examples/tutorial/calculator/CalculatorC.gf
+++ /dev/null
@@ -1,24 +0,0 @@
---# -path=.:prelude
-
-concrete CalculatorC of Calculator = open Prelude, Formal in {
-
- flags lexer=codevars ; unlexer=code ;
-
- lincat
- Prog, Var = SS ;
- Exp = TermPrec ;
-
- lin
- PEmpty = ss [] ;
- PInit exp prog = ss ("int" ++ prog.$0 ++ "=" ++ top exp ++ ";" ++ prog.s) ;
- PAss vr exp prog = ss (vr.s ++ "=" ++ top exp ++ ";" ++ prog.s) ;
-
- EPlus = infixl 0 "+" ;
- EMinus = infixl 0 "-" ;
- ETimes = infixl 1 "*" ;
- EDiv = infixl 1 "/" ;
-
- EInt i = constant i.s ;
- EVar x = constant x.s ;
-
-}
diff --git a/old-examples/tutorial/calculator/CalculatorE.gf b/old-examples/tutorial/calculator/CalculatorE.gf
deleted file mode 100644
index f432d371a..000000000
--- a/old-examples/tutorial/calculator/CalculatorE.gf
+++ /dev/null
@@ -1,27 +0,0 @@
---# -path=.:prelude
-
-concrete CalculatorE of Calculator = open Prelude in {
-
- flags lexer=codevar ; unlexer=unwords ;
-
- lincat
- Prog, Exp, Var = SS ;
-
- lin
- PEmpty = ss [] ;
- PInit exp prog = ss ("initialize" ++ prog.$0 ++ "as" ++ exp.s ++ PAUSE ++ prog.s) ;
- PAss vr exp prog = ss ("redefine" ++ vr.s ++ "as" ++ exp.s ++ PAUSE ++ prog.s) ;
-
- EPlus = infix "plus" ;
- EMinus = infix "minus" ;
- ETimes = infix "times" ;
- EDiv = infix ["divided by"] ;
-
- EInt i = i ;
- EVar x = x ;
-
- oper
- infix : Str -> SS -> SS -> SS = \op,x,y ->
- ss (x.s ++ op ++ y.s ++ PAUSE) ;
- PAUSE = "PAUSE" ;
-}
diff --git a/old-examples/tutorial/calculator/CalculatorJ.gf b/old-examples/tutorial/calculator/CalculatorJ.gf
deleted file mode 100644
index 68ff5342c..000000000
--- a/old-examples/tutorial/calculator/CalculatorJ.gf
+++ /dev/null
@@ -1,25 +0,0 @@
---# -path=.:prelude
-
-concrete CalculatorJ of Calculator = open Prelude in {
-
- flags lexer=codevars ; unlexer=code ;
-
- lincat
- Prog, Exp, Var = SS ;
-
- lin
- PEmpty = ss [] ;
- PInit exp prog = ss (exp.s ++ ";" ++ "istore" ++ prog.$0 ++ ";" ++ prog.s) ;
- PAss vr exp prog = ss (exp.s ++ ";" ++ "istore" ++ vr.s ++ ";" ++ prog.s) ;
-
- EPlus = postfix "iadd" ;
- EMinus = postfix "isub" ;
- ETimes = postfix "imul" ;
- EDiv = postfix "idiv" ;
-
- EInt = prefixSS "iconst" ;
- EVar = prefixSS "iload" ;
-
- oper
- postfix : Str -> SS -> SS -> SS = \op,x,y -> ss (x.s ++ ";" ++ y.s ++ ";" ++ op) ;
-}
diff --git a/old-examples/tutorial/calculator/CalculatorP.gf b/old-examples/tutorial/calculator/CalculatorP.gf
deleted file mode 100644
index 57ac549c1..000000000
--- a/old-examples/tutorial/calculator/CalculatorP.gf
+++ /dev/null
@@ -1,27 +0,0 @@
---# -path=.:prelude
-
-concrete CalculatorP of Calculator = open Prelude in {
-
- flags lexer=codevars ; unlexer=code ;
-
- lincat
- Prog, Var = SS ;
- Exp = SS ;
-
- lin
- PEmpty = ss [] ;
- PDecl exp prog = ss ("int" ++ prog.$0 ++ "=" ++ exp.s ++ ";" ++ prog.s) ;
- PAss vr exp prog = ss (vr.s ++ "=" ++ exp.s ++ ";" ++ prog.s) ;
-
- EPlus = infix "+" ;
- EMinus = infix "-" ;
- ETimes = infix "*" ;
- EDiv = infix "/" ;
-
- EInt i = i ;
- EVar x = x ;
-
- oper
- infix : Str -> SS -> SS -> SS = \f,x,y ->
- ss ("(" ++ x.s ++ f ++ y.s ++ ")") ;
-}