mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-02 07:42:50 -06:00
gf-book web page index and toc
This commit is contained in:
13
gf-book/examples/chapter8/CalculatorJ.gf
Normal file
13
gf-book/examples/chapter8/CalculatorJ.gf
Normal file
@@ -0,0 +1,13 @@
|
||||
concrete CalculatorJ of Calculator = open Prelude in {
|
||||
lincat
|
||||
Exp = SS ;
|
||||
lin
|
||||
EPlus = postfix "iadd" ;
|
||||
EMinus = postfix "isub" ;
|
||||
ETimes = postfix "imul" ;
|
||||
EDiv = postfix "idiv" ;
|
||||
EInt i = ss ("ldc" ++ i.s) ;
|
||||
oper
|
||||
postfix : Str -> SS -> SS -> SS = \op,x,y ->
|
||||
ss (x.s ++ ";" ++ y.s ++ ";" ++ op) ;
|
||||
}
|
||||
Reference in New Issue
Block a user