mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
14 lines
320 B
Plaintext
14 lines
320 B
Plaintext
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) ;
|
|
}
|