Files
gf-core/book/examples/chapter8/CalculatorP.gf
2010-11-22 12:55:37 +00:00

15 lines
281 B
Plaintext

concrete CalculatorP of Calculator = open Prelude in {
lincat
Exp = SS ;
lin
EPlus = infix "+" ;
EMinus = infix "-" ;
ETimes = infix "*" ;
EDiv = infix "/" ;
EInt i = i ;
oper
infix : Str -> SS -> SS -> SS = \f,x,y ->
ss ("(" ++ x.s ++ f ++ y.s ++ ")") ;
}