draw2d/postscript-go/src/pkg/postscript/operators.go
2010-12-13 12:01:24 +00:00

37 lines
866 B
Go

// Copyright 2010 The postscript-go Authors. All rights reserved.
// created: 13/12/2010 by Laurent Le Goff
package postscript
type OperatorFunc func(interpreter *Interpreter)
type PrimitiveOperator struct {
f OperatorFunc
}
func NewOperator(f OperatorFunc) *PrimitiveOperator {
return &PrimitiveOperator{f}
}
func (o *PrimitiveOperator) Execute(interpreter *Interpreter) {
o.f(interpreter)
}
func save(interpreter *Interpreter) {
}
func restore(interpreter *Interpreter) {
}
func initSystemOperators(interpreter *Interpreter) {
interpreter.SystemDefine("save", NewOperator(save))
interpreter.SystemDefine("restore", NewOperator(restore))
initStackOperator(interpreter)
initMathOperators(interpreter)
initDictionaryOperators(interpreter)
initRelationalOperators(interpreter)
initControlOperators(interpreter)
initDrawingOperators(interpreter)
}