cleaned up in lab2 grammars ; added myproject/ from the lecture

This commit is contained in:
aarneranta
2021-04-28 12:16:07 +02:00
parent 4da15031d1
commit 3faf1f2265
14 changed files with 85 additions and 635 deletions

View File

@@ -0,0 +1,30 @@
resource MicroResEng = {
param Number = Sg | Pl ;
oper
N = {s : Number => Str} ;
worstN : Str -> Str -> N
= \x,y -> {s = table {Sg => x ; Pl => y}} ;
regN : Str -> N
= \x -> worstN x (x + "s") ;
smartN : Str -> N
= \x -> case x of
{
b + ("ay"|"oy"|"uy") => regN x ;
bab + "y" => worstN x (bab + "ies") ;
_ => regN x
} ;
mkN = overload {
mkN : (dog : Str) -> N
= smartN ;
mkN : (man,men : Str) -> N
= worstN
} ;
}