summaryrefslogtreecommitdiff
path: root/devel/compiler/ex.src
diff options
context:
space:
mode:
Diffstat (limited to 'devel/compiler/ex.src')
-rw-r--r--devel/compiler/ex.src31
1 files changed, 31 insertions, 0 deletions
diff --git a/devel/compiler/ex.src b/devel/compiler/ex.src
new file mode 100644
index 000000000..33890fb89
--- /dev/null
+++ b/devel/compiler/ex.src
@@ -0,0 +1,31 @@
+param Num = Sg | Pl ;
+param Gen = Masc | Fem ;
+
+oper Agr = {g : Gen ; n : Num} ;
+
+oper CN = {s : Num -> Str ; g : Gen} ;
+oper NP = {s : Str ; a : Agr} ;
+
+oper artDef : Gen -> Str = \g -> table {
+ (Masc) => "le" ;
+ (Fem) => "la"
+} ! g ;
+
+
+lin Voiture : CN = {
+ s = table {
+ (Sg) => "voiture" ;
+ (Pl) => "voitures"
+ } ;
+ g = Fem
+} ;
+
+lin Bus : CN = {
+ s = table {$x => "bus"} ;
+ g = Masc
+} ;
+
+lin Def : CN -> NP = \cn -> {
+ s = artDef cn.g ++ cn.s ! Sg ;
+ a = {g = cn.g ; n = Sg}
+} ;