summaryrefslogtreecommitdiff
path: root/devel/compiler/ex.src
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-03-27 16:32:44 +0000
committeraarne <aarne@cs.chalmers.se>2007-03-27 16:32:44 +0000
commit1c1acf1b971d13a496a92b9d8d6b14fde85e28f3 (patch)
tree7fc40594193cbf6435feb5425ee2e4feb2652d32 /devel/compiler/ex.src
parent273dc7120f9ce0b469dc081d6a3382f096a4f97b (diff)
top-level toy compiler - far from complete
Diffstat (limited to 'devel/compiler/ex.src')
-rw-r--r--devel/compiler/ex.src15
1 files changed, 10 insertions, 5 deletions
diff --git a/devel/compiler/ex.src b/devel/compiler/ex.src
index 33890fb89..f7b381548 100644
--- a/devel/compiler/ex.src
+++ b/devel/compiler/ex.src
@@ -1,6 +1,8 @@
param Num = Sg | Pl ;
param Gen = Masc | Fem ;
+param AG = A Num Gen ;
+
oper Agr = {g : Gen ; n : Num} ;
oper CN = {s : Num -> Str ; g : Gen} ;
@@ -9,7 +11,7 @@ oper NP = {s : Str ; a : Agr} ;
oper artDef : Gen -> Str = \g -> table {
(Masc) => "le" ;
(Fem) => "la"
-} ! g ;
+} ! $g ;
lin Voiture : CN = {
@@ -17,15 +19,18 @@ lin Voiture : CN = {
(Sg) => "voiture" ;
(Pl) => "voitures"
} ;
- g = Fem
+ g = (Fem@)
} ;
+{-
lin Bus : CN = {
s = table {$x => "bus"} ;
- g = Masc
+ g = (Masc@)
} ;
+
lin Def : CN -> NP = \cn -> {
- s = artDef cn.g ++ cn.s ! Sg ;
- a = {g = cn.g ; n = Sg}
+ s = artDef $cn.g ++ $cn.s ! (Sg@) ;
+ a = {g = $cn.g ; n = (Sg@)}
} ;
+-} \ No newline at end of file