diff options
| author | aarne <aarne@cs.chalmers.se> | 2007-03-27 20:54:49 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2007-03-27 20:54:49 +0000 |
| commit | fd518ed2a3fe50238e0e9e7947e33cc9d5de9bce (patch) | |
| tree | 384d4e0a74cd0019dbf20394f2eeb9b83b24b1cc /devel/compiler/ex.src | |
| parent | 7c30d211c3eda504668c0eab51e99d6e52db2127 (diff) | |
primitive pattern matching
Diffstat (limited to 'devel/compiler/ex.src')
| -rw-r--r-- | devel/compiler/ex.src | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/devel/compiler/ex.src b/devel/compiler/ex.src index e8f0c6374..6169cb5ee 100644 --- a/devel/compiler/ex.src +++ b/devel/compiler/ex.src @@ -8,14 +8,13 @@ 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 { +oper artDef : Gen -> Str = \g -> table Gen { (Masc) => "le" ; (Fem) => "la" } ! $g ; - lin Voiture : CN = { - s = table { + s = table Num { (Sg) => "voiture" ; (Pl) => "voitures" } ; @@ -24,13 +23,20 @@ lin Voiture : CN = { lin Bus : CN = { - s = table {$x => "bus"} ; + s = table Num {$x => "bus"} ; g = (Masc@) } ; -{- +lin Indef : CN -> NP = \cn -> { + s = table Gen { + (Masc) => "un" ; + $x => "une" + } ! $cn.g ++ $cn.s ! (Sg@) ; + a = {g = $cn.g ; n = (Sg@)} +} ; + + lin Def : CN -> NP = \cn -> { s = &artDef $cn.g ++ $cn.s ! (Sg@) ; a = {g = $cn.g ; n = (Sg@)} } ; --}
\ No newline at end of file |
