From 1c1acf1b971d13a496a92b9d8d6b14fde85e28f3 Mon Sep 17 00:00:00 2001 From: aarne Date: Tue, 27 Mar 2007 16:32:44 +0000 Subject: top-level toy compiler - far from complete --- devel/compiler/ex.src | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'devel/compiler/ex.src') 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 -- cgit v1.2.3