mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
gf-book web page index and toc
This commit is contained in:
14
gf-book/examples/chapter8/CalculatorP.gf
Normal file
14
gf-book/examples/chapter8/CalculatorP.gf
Normal file
@@ -0,0 +1,14 @@
|
||||
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 ++ ")") ;
|
||||
}
|
||||
Reference in New Issue
Block a user