diff --git a/postscript-go/src/pkg/postscript/interpreter.go b/postscript-go/src/pkg/postscript/interpreter.go index 1ddbc26..45481b7 100644 --- a/postscript-go/src/pkg/postscript/interpreter.go +++ b/postscript-go/src/pkg/postscript/interpreter.go @@ -77,7 +77,16 @@ func (interpreter *Interpreter) computeReference(ref string) { } func (interpreter *Interpreter) scan(scanner *Scanner, token int) { if token == Ident { - interpreter.computeReference(scanner.TokenText()) + switch scanner.TokenText() { + case "true": + interpreter.Push(true) + case "false": + interpreter.Push(false) + case "null": + interpreter.Push(nil) + default: + interpreter.computeReference(scanner.TokenText()) + } } else if token == '/' { scanner.Scan() interpreter.Push("/" + scanner.TokenText()) @@ -104,7 +113,16 @@ func (interpreter *Interpreter) scanArray(scanner *Scanner) []Value { token := scanner.Scan() for token != EOF && token != ']' { if token == Ident { - array = append(array, scanner.TokenText()) + var v Value = scanner.TokenText() + switch scanner.TokenText() { + case "true": + v = true + case "false": + v = false + case "null": + v = nil + } + array = append(array, v) } else { interpreter.scan(scanner, token) array = append(array, interpreter.Pop()) @@ -119,7 +137,16 @@ func (interpreter *Interpreter) scanProcedure(scanner *Scanner) *ProcedureDefini token := scanner.Scan() for token != EOF && token != '}' { if token == Ident { - proceduredef.Add(scanner.TokenText()) + var v Value = scanner.TokenText() + switch scanner.TokenText() { + case "true": + v = true + case "false": + v = false + case "null": + v = nil + } + proceduredef.Add(v) } else { interpreter.scan(scanner, token) proceduredef.Add(interpreter.Pop()) @@ -146,6 +173,9 @@ func (interpreter *Interpreter) PeekDictionary() Dictionary { stackPointer := len(interpreter.dictionaryStack) - 1 return interpreter.dictionaryStack[stackPointer] } +func (interpreter *Interpreter) ClearDictionaries() { + interpreter.dictionaryStack = interpreter.dictionaryStack[:2] +} func (interpreter *Interpreter) DictionaryStackSize() int { return len(interpreter.dictionaryStack) @@ -165,6 +195,14 @@ func (interpreter *Interpreter) FindValueInDictionaries(name string) (Value, Dic return nil, nil } +func (interpreter *Interpreter) UserDictionary() Dictionary { + return interpreter.dictionaryStack[0] +} + +func (interpreter *Interpreter) SystemDictionary() Dictionary { + return interpreter.dictionaryStack[0] +} + func (interpreter *Interpreter) Define(name string, value Value) { interpreter.PeekDictionary()[name] = value } @@ -227,8 +265,8 @@ func (interpreter *Interpreter) ClearOperands() { func (interpreter *Interpreter) PopFloat() float { operand := interpreter.Pop() if s, ok := operand.(string); ok { - log.Printf("Erro this is a string %s\n", s) - } + log.Printf("String not float: %s", s) + } return operand.(float) } diff --git a/postscript-go/src/pkg/postscript/operators.go b/postscript-go/src/pkg/postscript/operators.go index 2325ed2..6cc0525 100644 --- a/postscript-go/src/pkg/postscript/operators.go +++ b/postscript-go/src/pkg/postscript/operators.go @@ -19,9 +19,11 @@ func (o *PrimitiveOperator) Execute(interpreter *Interpreter) { func save(interpreter *Interpreter) { + interpreter.Push("VM Snapshot") } func restore(interpreter *Interpreter) { + interpreter.Pop() } @@ -30,8 +32,12 @@ func initSystemOperators(interpreter *Interpreter) { interpreter.SystemDefine("restore", NewOperator(restore)) initStackOperator(interpreter) initMathOperators(interpreter) + initArrayOperators(interpreter) initDictionaryOperators(interpreter) initRelationalOperators(interpreter) initControlOperators(interpreter) + initMiscellaneousOperators(interpreter) initDrawingOperators(interpreter) + + initConflictingOperators(interpreter) } diff --git a/postscript-go/src/pkg/postscript/operators_array.go b/postscript-go/src/pkg/postscript/operators_array.go new file mode 100644 index 0000000..16215dd --- /dev/null +++ b/postscript-go/src/pkg/postscript/operators_array.go @@ -0,0 +1,93 @@ +// Copyright 2010 The postscript-go Authors. All rights reserved. +// created: 13/12/2010 by Laurent Le Goff + +package postscript + + +import () +//int array array -> Create array of length int +func array(interpreter *Interpreter) { + interpreter.Push(make([]Value, interpreter.PopInt())) +} +//array length int -> Return number of elements in array +func lengtharray(interpreter *Interpreter) { + interpreter.Push(float(len(interpreter.Pop().([]Value)))) +} +//array index get any -> Return array element indexed by index +func getarray(interpreter *Interpreter) { + index := interpreter.PopInt() + array := interpreter.Pop().([]Value) + interpreter.Push(array[index]) +} +//array index any put – -> Put any into array at index +func putarray(interpreter *Interpreter) { + value := interpreter.Pop() + index := interpreter.PopInt() + array := interpreter.Pop().([]Value) + array[index] = value +} +//array index count getinterval subarray -> Return subarray of array starting at index for count elements +func getinterval(interpreter *Interpreter) { + count := interpreter.PopInt() + index := interpreter.PopInt() + array := interpreter.Pop().([]Value) + subarray := make([]Value, count) + copy(subarray, array[index:index+count]) + interpreter.Push(subarray) +} +//array1 index array2 putinterval – Replace subarray of array1 starting at index by array2|packedarray2 +func putinterval(interpreter *Interpreter) { + array2 := interpreter.Pop().([]Value) + index := interpreter.PopInt() + array1 := interpreter.Pop().([]Value) + for i, v := range array2 { + array1[i+index] = v + } +} +// any0 … anyn−1 array astore array +// stores the objects any0 to anyn−1 from the operand stack into array, where n is the length of array +func astore(interpreter *Interpreter) { + array := interpreter.Pop().([]Value) + n := len(array) + for i := 0; i < n; i++ { + array[i] = interpreter.Pop() + } +} +//array aload any0 … any-1 array +//Push all elements of array on stack +func aload(interpreter *Interpreter) { + array := interpreter.Pop().([]Value) + for _, v := range array { + interpreter.Push(v) + } + interpreter.Push(array) +} +//array proc forall – Execute proc for each element of array +func forallarray(interpreter *Interpreter) { + proc := NewProcedure(interpreter.PopProcedureDefinition()) + array := interpreter.Pop().([]Value) + for _, v := range array { + interpreter.Push(v) + proc.Execute(interpreter) + } +} + +var packing bool = false + +func currentpacking(interpreter *Interpreter) { + interpreter.Push(packing) +} +func setpacking(interpreter *Interpreter) { + packing = interpreter.PopBoolean() +} + +func initArrayOperators(interpreter *Interpreter) { + interpreter.SystemDefine("array", NewOperator(array)) + interpreter.SystemDefine("getinterval", NewOperator(getinterval)) + interpreter.SystemDefine("putinterval", NewOperator(putinterval)) + interpreter.SystemDefine("astore", NewOperator(astore)) + interpreter.SystemDefine("aload", NewOperator(aload)) + interpreter.SystemDefine("currentpacking", NewOperator(currentpacking)) + interpreter.SystemDefine("setpacking", NewOperator(setpacking)) + +} diff --git a/postscript-go/src/pkg/postscript/operators_conflict.go b/postscript-go/src/pkg/postscript/operators_conflict.go new file mode 100644 index 0000000..e68a216 --- /dev/null +++ b/postscript-go/src/pkg/postscript/operators_conflict.go @@ -0,0 +1,96 @@ +package postscript + +import ( + "fmt" + "log" +) + +// dictionary copy conflict with stack copy +// type dicriminant +func commonCopy(interpreter *Interpreter) { + switch v := interpreter.Peek().(type) { + case float: + copystack(interpreter) + case Dictionary: + copydict(interpreter) + default: + panic(fmt.Sprintf("Not yet implemented: %v copy", v)) + } +} +func commonforall(interpreter *Interpreter) { + switch v := interpreter.Get(1).(type) { + case Dictionary: + foralldict(interpreter) + case []Value: + forallarray(interpreter) + case string: + panic("Not yet implemented: string proc forall") + default: + panic(fmt.Sprintf("Not yet implemented: %v proc forall", v)) + } +} + +func length(interpreter *Interpreter) { + switch v := interpreter.Peek().(type) { + case Dictionary: + lengthdict(interpreter) + case []Value: + lengtharray(interpreter) + case string: + panic("Not yet implemented: string proc forall") + default: + panic(fmt.Sprintf("Not yet implemented: %v length", v)) + } +} +func get(interpreter *Interpreter) { + switch v := interpreter.Get(1).(type) { + case Dictionary: + getdict(interpreter) + case []Value: + getarray(interpreter) + case string: + panic("Not yet implemented: string proc forall") + default: + panic(fmt.Sprintf("Not yet implemented: %v index get", v)) + } +} +func put(interpreter *Interpreter) { + switch v := interpreter.Get(2).(type) { + case Dictionary: + putdict(interpreter) + case []Value: + putarray(interpreter) + case string: + panic("Not yet implemented: string proc forall") + default: + panic(fmt.Sprintf("Not yet implemented: %v index any put", v)) + } +} + +func readonly(interpreter *Interpreter) { + log.Println("readonly, not yet implemented") +} + +func cvlit(interpreter *Interpreter) { + log.Println("cvlit, not yet implemented") +} + +func xcheck(interpreter *Interpreter) { + value := interpreter.Pop() + if _, ok := value.(*ProcedureDefinition); ok { + interpreter.Push(true) + } else { + interpreter.Push(false) + } +} + +func initConflictingOperators(interpreter *Interpreter) { + interpreter.SystemDefine("copy", NewOperator(commonCopy)) + interpreter.SystemDefine("forall", NewOperator(commonforall)) + interpreter.SystemDefine("length", NewOperator(length)) + interpreter.SystemDefine("get", NewOperator(get)) + interpreter.SystemDefine("put", NewOperator(put)) + interpreter.SystemDefine("readonly", NewOperator(readonly)) + interpreter.SystemDefine("cvlit", NewOperator(cvlit)) + interpreter.SystemDefine("xcheck", NewOperator(xcheck)) +} diff --git a/postscript-go/src/pkg/postscript/operators_control.go b/postscript-go/src/pkg/postscript/operators_control.go index 0b87b7e..d0d6755 100644 --- a/postscript-go/src/pkg/postscript/operators_control.go +++ b/postscript-go/src/pkg/postscript/operators_control.go @@ -3,6 +3,21 @@ package postscript +import ( + "log" +) +// any exec – Execute arbitrary object +func exec(interpreter *Interpreter) { + value := interpreter.Pop() + if pdef, ok := value.(*ProcedureDefinition); ok { + NewProcedure(pdef).Execute(interpreter) + } else if procedure, ok := value.(*Procedure); ok { + procedure.Execute(interpreter) + } else { + log.Printf("Push value: %v\n", value) + interpreter.Push(value) + } +} func ifoperator(interpreter *Interpreter) { operator := NewProcedure(interpreter.PopProcedureDefinition()) @@ -35,9 +50,22 @@ func foroperator(interpreter *Interpreter) { } } +// any stopped bool -> Establish context for catching stop +func stopped(interpreter *Interpreter) { + value := interpreter.Pop() + if pdef, ok := value.(*ProcedureDefinition); ok { + NewProcedure(pdef).Execute(interpreter) + } else { + interpreter.Push(value) + } + interpreter.Push(false) +} + func initControlOperators(interpreter *Interpreter) { + interpreter.SystemDefine("exec", NewOperator(exec)) interpreter.SystemDefine("if", NewOperator(ifoperator)) interpreter.SystemDefine("ifelse", NewOperator(ifelse)) interpreter.SystemDefine("for", NewOperator(foroperator)) + interpreter.SystemDefine("stopped", NewOperator(stopped)) } diff --git a/postscript-go/src/pkg/postscript/operators_dictionary.go b/postscript-go/src/pkg/postscript/operators_dictionary.go index 8cd6ecf..cee8221 100644 --- a/postscript-go/src/pkg/postscript/operators_dictionary.go +++ b/postscript-go/src/pkg/postscript/operators_dictionary.go @@ -7,14 +7,29 @@ package postscript import ( "log" ) - - -func get(interpreter *Interpreter) { - name := interpreter.PopName() - dictionary := interpreter.Pop().(Dictionary) - interpreter.Push(dictionary[name]) +//int dict dict -> Create dictionary with capacity for int elements +func dict(interpreter *Interpreter) { + interpreter.Push(NewDictionary(interpreter.PopInt())) } - +//dict length int -> Return number of entries in dict +func lengthdict(interpreter *Interpreter) { + dictionary := interpreter.Pop().(Dictionary) + interpreter.Push(float(len(dictionary))) +} +//dict maxlength int -> Return current capacity of dict +func maxlength(interpreter *Interpreter) { + interpreter.Pop() + interpreter.Push(float(999999999)) // push arbitrary value +} +//dict begin – -> Push dict on dictionary stack +func begin(interpreter *Interpreter) { + interpreter.PushDictionary(interpreter.Pop().(Dictionary)) +} +//– end – -> Pop current dictionary off dictionary stack +func end(interpreter *Interpreter) { + interpreter.PopDictionary() +} +//key value def – -> Associate key and value in current dictionary func def(interpreter *Interpreter) { value := interpreter.Pop() name := interpreter.PopName() @@ -23,32 +38,7 @@ func def(interpreter *Interpreter) { } interpreter.Define(name, value) } - -func bind(interpreter *Interpreter) { - pdef := interpreter.PopProcedureDefinition() - values := make([]Value, len(pdef.Values)) - for i, value := range pdef.Values { - if s, ok := value.(string); ok { - firstChar := s[0] - if firstChar != '(' && firstChar != '/' { - v, _ := interpreter.FindValueInDictionaries(s) - operator, isOperator := v.(Operator) - if isOperator { - values[i] = operator - } else { - values[i] = value - } - } else { - values[i] = value - } - } else { - values[i] = value - } - } - pdef.Values = values - interpreter.Push(pdef) -} - +//key load value -> Search dictionary stack for key and return associated value func load(interpreter *Interpreter) { name := interpreter.PopName() value, _ := interpreter.FindValueInDictionaries(name) @@ -57,19 +47,41 @@ func load(interpreter *Interpreter) { } interpreter.Push(value) } - -func begin(interpreter *Interpreter) { - interpreter.PushDictionary(interpreter.Pop().(Dictionary)) +//key value store – -> Replace topmost definition of key +func store(interpreter *Interpreter) { + value := interpreter.Pop() + key := interpreter.PopName() + _, dictionary := interpreter.FindValueInDictionaries(key) + if dictionary != nil { + dictionary[key] = value + } } - -func end(interpreter *Interpreter) { - interpreter.PopDictionary() +//dict key get any -> Return value associated with key in dict +func getdict(interpreter *Interpreter) { + key := interpreter.PopName() + dictionary := interpreter.Pop().(Dictionary) + interpreter.Push(dictionary[key]) } - -func dict(interpreter *Interpreter) { - interpreter.Push(NewDictionary(interpreter.PopInt())) +//dict key value put – -> Associate key with value in dict +func putdict(interpreter *Interpreter) { + value := interpreter.Pop() + key := interpreter.PopName() + dictionary := interpreter.Pop().(Dictionary) + dictionary[key] = value } - +//dict key undef – Remove key and its value from dict +func undef(interpreter *Interpreter) { + key := interpreter.PopName() + dictionary := interpreter.Pop().(Dictionary) + dictionary[key] = nil +} +//dict key known bool -> Test whether key is in dict +func known(interpreter *Interpreter) { + key := interpreter.PopName() + dictionary := interpreter.Pop().(Dictionary) + interpreter.Push(dictionary[key] != nil) +} +//key where (dict true) or false -> Find dictionary in which key is defined func where(interpreter *Interpreter) { key := interpreter.PopName() _, dictionary := interpreter.FindValueInDictionaries(key) @@ -80,14 +92,80 @@ func where(interpreter *Interpreter) { interpreter.Push(true) } } +// dict1 dict2 copy dict2 -> Copy contents of dict1 to dict2 +func copydict(interpreter *Interpreter) { + dict2 := interpreter.Pop().(Dictionary) + dict1 := interpreter.Pop().(Dictionary) + for key, value := range dict1 { + dict2[key] = value + } + interpreter.Push(dict2) +} +//dict proc forall – -> Execute proc for each entry in dict +func foralldict(interpreter *Interpreter) { + proc := NewProcedure(interpreter.PopProcedureDefinition()) + dict := interpreter.Pop().(Dictionary) + for key, value := range dict { + interpreter.Push(key) + interpreter.Push(value) + proc.Execute(interpreter) + } +} +//– currentdict dict -> Return current dictionary +func currentdict(interpreter *Interpreter) { + interpreter.Push(interpreter.PeekDictionary()) +} +//– systemdict dict -> Return system dictionary +func systemdict(interpreter *Interpreter) { + interpreter.Push(interpreter.SystemDictionary()) +} +//– userdict dict -> Return writeable dictionary in local VM +func userdict(interpreter *Interpreter) { + interpreter.Push(interpreter.UserDictionary()) +} +//– globaldict dict -> Return writeable dictionary in global VM +func globaldict(interpreter *Interpreter) { + interpreter.Push(interpreter.UserDictionary()) +} +//– statusdict dict -> Return product-dependent dictionary +func statusdict(interpreter *Interpreter) { + interpreter.Push(interpreter.UserDictionary()) +} +//– countdictstack int -> Count elements on dictionary stack +func countdictstack(interpreter *Interpreter) { + interpreter.Push(float(interpreter.DictionaryStackSize())) +} +//array dictstack subarray -> Copy dictionary stack into array +func dictstack(interpreter *Interpreter) { + panic("No yet implemenented") +} +//– cleardictstack – -> Pop all nonpermanent dictionaries off dictionary stack +func cleardictstack(interpreter *Interpreter) { + interpreter.ClearDictionaries() +} func initDictionaryOperators(interpreter *Interpreter) { - interpreter.SystemDefine("get", NewOperator(get)) - interpreter.SystemDefine("def", NewOperator(def)) - interpreter.SystemDefine("load", NewOperator(load)) - interpreter.SystemDefine("bind", NewOperator(bind)) + interpreter.SystemDefine("dict", NewOperator(dict)) + //interpreter.SystemDefine("length", NewOperator(length)) // already define in operators_conflict.go + interpreter.SystemDefine("maxlength", NewOperator(maxlength)) interpreter.SystemDefine("begin", NewOperator(begin)) interpreter.SystemDefine("end", NewOperator(end)) - interpreter.SystemDefine("dict", NewOperator(dict)) + interpreter.SystemDefine("def", NewOperator(def)) + interpreter.SystemDefine("load", NewOperator(load)) + interpreter.SystemDefine("store", NewOperator(store)) + //interpreter.SystemDefine("get", NewOperator(get)) // already define in operators_conflict.go + //interpreter.SystemDefine("put", NewOperator(put)) // already define in operators_conflict.go + interpreter.SystemDefine("undef", NewOperator(undef)) + interpreter.SystemDefine("known", NewOperator(known)) interpreter.SystemDefine("where", NewOperator(where)) + //interpreter.SystemDefine("copydict", NewOperator(copydict)) // already define in operators_conflict.go + //interpreter.SystemDefine("foralldict", NewOperator(foralldict)) // already define in operators_conflict.go + interpreter.SystemDefine("currentdict", NewOperator(currentdict)) + interpreter.SystemDefine("systemdict", NewOperator(systemdict)) + interpreter.SystemDefine("userdict", NewOperator(userdict)) + interpreter.SystemDefine("globaldict", NewOperator(globaldict)) + interpreter.SystemDefine("statusdict", NewOperator(statusdict)) + interpreter.SystemDefine("countdictstack", NewOperator(countdictstack)) + interpreter.SystemDefine("dictstack", NewOperator(dictstack)) + interpreter.SystemDefine("cleardictstack", NewOperator(cleardictstack)) } diff --git a/postscript-go/src/pkg/postscript/operators_graphics.go b/postscript-go/src/pkg/postscript/operators_graphics.go index f135ed5..129ce52 100644 --- a/postscript-go/src/pkg/postscript/operators_graphics.go +++ b/postscript-go/src/pkg/postscript/operators_graphics.go @@ -1,19 +1,17 @@ // Copyright 2010 The postscript-go Authors. All rights reserved. // created: 13/12/2010 by Laurent Le Goff +// Graphics operators package postscript import ( - "log" "image" "draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d" "math" + "log" ) -// begin Primitive Operator implementation - - //Path Construction Operators func newpath(interpreter *Interpreter) { interpreter.GetGraphicContext().BeginPath() @@ -74,7 +72,7 @@ func rcurveto(interpreter *Interpreter) { } func clippath(interpreter *Interpreter) { - + log.Printf("clippath not yet implemented") } func stroke(interpreter *Interpreter) { @@ -194,7 +192,7 @@ func setcmybcolor(interpreter *Interpreter) { func setdash(interpreter *Interpreter) { offset := interpreter.PopInt() dash := interpreter.PopArray() - log.Printf("dash: %v, offset: %d \n", dash, offset) + log.Printf("setdash not yet implemented dash: %v, offset: %d \n", dash, offset) } func setlinejoin(interpreter *Interpreter) { @@ -223,6 +221,7 @@ func setlinecap(interpreter *Interpreter) { func setmiterlimit(interpreter *Interpreter) { interpreter.PopInt() + log.Printf("setmiterlimit not yet implemented") } func setlinewidth(interpreter *Interpreter) { @@ -230,37 +229,49 @@ func setlinewidth(interpreter *Interpreter) { } func showpage(interpreter *Interpreter) { - + log.Printf("showpage may be an implementation specific, override show page to generate multi page images") } func show(interpreter *Interpreter) { s := interpreter.PopString() interpreter.GetGraphicContext().FillString(s) + log.Printf("show not really implemented") +} +//ax ay string ashow – -> Add (ax , ay) to width of each glyph while showing string +func ashow(interpreter *Interpreter) { + log.Printf("ashow not really implemented") + s := interpreter.PopString() + interpreter.PopFloat() + interpreter.PopFloat() + interpreter.GetGraphicContext().FillString(s) } func findfont(interpreter *Interpreter) { - + log.Printf("findfont not yet implemented") } func scalefont(interpreter *Interpreter) { - + log.Printf("scalefont not yet implemented") } func setfont(interpreter *Interpreter) { - + log.Printf("setfont not yet implemented") } func stringwidth(interpreter *Interpreter) { interpreter.Push(10.0) interpreter.Push(10.0) + log.Printf("stringwidth not yet implemented") } func setflat(interpreter *Interpreter) { interpreter.Pop() + log.Printf("setflat not yet implemented") } func currentflat(interpreter *Interpreter) { interpreter.Push(1.0) + log.Printf("currentflat not yet implemented") } @@ -308,6 +319,7 @@ func initDrawingOperators(interpreter *Interpreter) { interpreter.SystemDefine("stroke", NewOperator(stroke)) interpreter.SystemDefine("fill", NewOperator(fill)) interpreter.SystemDefine("show", NewOperator(show)) + interpreter.SystemDefine("ashow", NewOperator(ashow)) interpreter.SystemDefine("showpage", NewOperator(showpage)) interpreter.SystemDefine("findfont", NewOperator(findfont)) @@ -333,7 +345,7 @@ func initDrawingOperators(interpreter *Interpreter) { interpreter.SystemDefine("currentflat", NewOperator(currentflat)) // Coordinate System and Matrix operators - interpreter.SystemDefine("matrix", NewOperator(transform)) + interpreter.SystemDefine("matrix", NewOperator(matrix)) interpreter.SystemDefine("transform", NewOperator(transform)) interpreter.SystemDefine("itransform", NewOperator(itransform)) interpreter.SystemDefine("translate", NewOperator(translate)) diff --git a/postscript-go/src/pkg/postscript/operators_misc.go b/postscript-go/src/pkg/postscript/operators_misc.go new file mode 100644 index 0000000..a27f701 --- /dev/null +++ b/postscript-go/src/pkg/postscript/operators_misc.go @@ -0,0 +1,42 @@ +// Copyright 2010 The postscript-go Authors. All rights reserved. +// created: 13/12/2010 by Laurent Le Goff + +// Miscellaneous Operators +package postscript + +import ( + "log" +) + +//proc bind proc Replace operator names in proc with operators; perform idiom recognition +func bind(interpreter *Interpreter) { + pdef := interpreter.PopProcedureDefinition() + values := make([]Value, len(pdef.Values)) + for i, value := range pdef.Values { + if s, ok := value.(string); ok { + firstChar := s[0] + if firstChar != '(' && firstChar != '/' { + v, _ := interpreter.FindValueInDictionaries(s) + operator, isOperator := v.(Operator) + if v == nil { + log.Printf("Can't find def: %s\n", s) + } + if isOperator { + values[i] = operator + } else { + values[i] = value + } + } else { + values[i] = value + } + } else { + values[i] = value + } + } + pdef.Values = values + interpreter.Push(pdef) +} + +func initMiscellaneousOperators(interpreter *Interpreter) { + interpreter.SystemDefine("bind", NewOperator(bind)) +} diff --git a/postscript-go/src/pkg/postscript/operators_relational.go b/postscript-go/src/pkg/postscript/operators_relational.go index 546a90f..0f43169 100644 --- a/postscript-go/src/pkg/postscript/operators_relational.go +++ b/postscript-go/src/pkg/postscript/operators_relational.go @@ -10,6 +10,12 @@ func eq(interpreter *Interpreter) { interpreter.Push(value1 == value2) } +func ne(interpreter *Interpreter) { + value1 := interpreter.Pop() + value2 := interpreter.Pop() + interpreter.Push(value1 != value2) +} + func lt(interpreter *Interpreter) { f2 := interpreter.PopFloat() f1 := interpreter.PopFloat() @@ -18,5 +24,6 @@ func lt(interpreter *Interpreter) { func initRelationalOperators(interpreter *Interpreter) { interpreter.SystemDefine("eq", NewOperator(eq)) + interpreter.SystemDefine("ne", NewOperator(ne)) interpreter.SystemDefine("lt", NewOperator(lt)) } diff --git a/postscript-go/src/pkg/postscript/operators_stack.go b/postscript-go/src/pkg/postscript/operators_stack.go index e55a4ea..e9c3325 100644 --- a/postscript-go/src/pkg/postscript/operators_stack.go +++ b/postscript-go/src/pkg/postscript/operators_stack.go @@ -19,6 +19,7 @@ func exch(interpreter *Interpreter) { func dup(interpreter *Interpreter) { interpreter.Push(interpreter.Peek()) } + //any1 … anyn n copy any1 … anyn any1 … anyn -> Duplicate top n elements func copystack(interpreter *Interpreter) { n := interpreter.PopInt() @@ -77,7 +78,6 @@ func initStackOperator(interpreter *Interpreter) { interpreter.SystemDefine("pop", NewOperator(pop)) interpreter.SystemDefine("exch", NewOperator(exch)) interpreter.SystemDefine("dup", NewOperator(dup)) - interpreter.SystemDefine("copy", NewOperator(copystack)) interpreter.SystemDefine("index", NewOperator(index)) interpreter.SystemDefine("roll", NewOperator(roll)) interpreter.SystemDefine("clear", NewOperator(clear)) diff --git a/postscript-go/src/pkg/postscript/scanner.go b/postscript-go/src/pkg/postscript/scanner.go index a8e0ab7..79aa3d5 100644 --- a/postscript-go/src/pkg/postscript/scanner.go +++ b/postscript-go/src/pkg/postscript/scanner.go @@ -284,7 +284,7 @@ func (s *Scanner) error(msg string) { func (s *Scanner) scanIdentifier() int { ch := s.next() // read character after first '_' or letter - for ch == '_' || unicode.IsLetter(ch) || unicode.IsDigit(ch) || ch == '.' { + for ch == '_' || unicode.IsLetter(ch) || unicode.IsDigit(ch) || ch == '.' || ch == '-' || ch == '`' { ch = s.next() } return ch @@ -489,7 +489,7 @@ redo: // determine token value tok := ch switch { - case unicode.IsLetter(ch) || ch == '_': + case unicode.IsLetter(ch) || ch == '_' || ch == '`': if s.Mode&ScanIdents != 0 { tok = Ident ch = s.scanIdentifier() @@ -499,7 +499,8 @@ redo: case ch == '-': // minus ch = s.next() if !isDecimal(ch) { - fmt.Printf("Error may be a digi: %c\n") + s.error(fmt.Sprintf("Error may be a digi: %c\n", ch)) + } else { if s.Mode&(ScanInts|ScanFloats) != 0 { tok, ch = s.scanNumber(ch) diff --git a/postscript-go/test_files/golfer.ps b/postscript-go/test_files/golfer.ps new file mode 100644 index 0000000..2ef8c02 --- /dev/null +++ b/postscript-go/test_files/golfer.ps @@ -0,0 +1,1398 @@ +%!PS-Adobe-2.0 EPSF-1.2 +%%Creator:Adobe Illustrator(TM) 1.0b2- +%%Title:golfer art+ +%%CreationDate:1/6/87 9:32 AM +%%DocumentFonts:Helvetica-Bold +%%BoundingBox:7 31 577 726 +%%TemplateBox:0 -48 576 672 +%%EndComments +100 dict begin +/q{bind def}bind def +/Q{load def}q +/x{exch def}q +/X/def Q +/g{/_g x/p{_g setgray}X}q +/G{/_G x/P{_G setgray}X}q +/k{/_b x/_g x/_r x/p{_r _g _b setrgbcolor}X}q +/K{/_B x/_G x/_R x/P{_R _G _B setrgbcolor}X}q +/d/setdash Q +/i/setflat Q +/j/setlinejoin Q +/J/setlinecap Q +/M/setmiterlimit Q +/w/setlinewidth Q +/_C{.25 sub round .25 add}q +/_c{transform _C exch _C exch itransform}q +/c{_c curveto}q +/C/c Q +/v{currentpoint 6 2 roll _c curveto}q +/V/v Q +/y{_c 2 copy curveto}q +/Y/y Q +/l{_c lineto}q +/L/l Q +/m{_c moveto}q +/_e[]X +/_E{_e length 0 ne{gsave 1 g 0 G 1 i 0 J 0 j .5 w 10 M[]0 d +/Helvetica-Bold 24 0 0 1 z +[0.966 0.259 -0.259 0.966 +_e 0 get _e 2 get add 2 div _e 1 get _e 3 get add 2 div]a +(ERROR: can't fill a path)t T grestore}if}q +/n/newpath Q +/N/newpath Q +/F{p{fill}stopped{/_e[pathbbox]X n _E}if}q +/f{closepath F}q +/S{P stroke}q +/s{closepath S}q +/B{gsave F grestore S}q +/b{closepath B}q +/u{}q +/U{}q +/_s/ashow Q +/_S{(?)exch{2 copy 0 exch put pop dup true charpath currentpoint _m setmatrix +stroke _M setmatrix moveto 3 copy pop rmoveto}forall pop pop pop n}q +/_A{_a moveto _t exch 0 exch}q +/_L{0 _l neg translate _M currentmatrix pop}q +/_w{dup stringwidth exch 3 -1 roll length 1 sub _t mul add exch}q +/_z[{0 0}bind{dup _w exch neg 2 div exch neg 2 div}bind +{dup _w exch neg exch neg}bind]X +/z{_z exch get/_a x/_t x/_l x exch findfont exch scalefont setfont}q +/_d{matrix currentmatrix X}q +/_D{/_m _d gsave concat/_M _d}q +/e{_D p/t{_A _s _L}X}q +/r{_D P/t{_A _S _L}X}q +/a{_D/t{dup p _A _s P _A _S _L}X}q +/o{_D/t{pop _L}X}q +/T{grestore}q +/Z{findfont begin currentdict dup length dict begin +{1 index/FID ne{X}{pop pop}ifelse}forall/FontName exch X dup length 0 ne +{/Encoding Encoding 256 array copy X 0 exch{dup type/nametype eq +{Encoding 2 index 2 index put pop 1 add}{exch pop}ifelse}forall}if pop +currentdict dup end end/FontName get exch definefont pop}q +n +%%EndProlog +u +0.9 g +0 G +1 i +0 J +0 j +1 w +10 M +[]0 d +%%Note: +15.815 40.248 m +567.815 40.002 L +567.748 716.565 L +15.998 716.81 L +15.815 40.248 L +b +U +1 g +285.313 40 m +567.688 40.125 L +567.812 78.375 L +285.312 78.25 L +285.313 40 L +b +0 g +175.5 163 m +180.007 163 173.738 169.081 171.75 168.75 c +174.75 169.25 176.25 169.5 174.5 171.25 C +178 171.25 176.349 173.783 175 176.75 c +173.75 179.5 170.75 182.25 168.25 182 C +165.5 181.25 167.622 182.838 165.25 186 c +164.5 187 164.75 187.5 161.75 186.75 c +158.75 186 163.25 190 156.75 190 c +150.25 190 148.5 189 145.5 186 c +142.5 183 139.75 183.75 139.5 182.5 c +139.25 181.25 139.5 176.75 138.75 175.5 c +138 174.25 136.75 174.25 136.25 178 c +135.75 181.75 140.25 182.25 134 187 C +135.75 190.75 134.5 191.75 131 193.5 C +131 200 129.202 203.364 119.5 208.5 c +115.25 210.75 107 212.75 104.75 208.75 c +102.5 204.75 103 206.5 96.5 205.75 c +90 205 87.25 202.5 86.5 197.75 c +85.75 193 82.75 195 79 194.75 c +75.25 194.5 77 192.75 77.25 191.75 c +77.5 190.75 75.25 192.5 71.5 192 c +67.75 191.5 64.25 185.5 69.5 180.75 c +74.75 176 66.5 180.75 64.25 182.25 c +62 183.75 60.5 181.75 61 180.25 c +61.5 178.75 58.75 180.75 57.5 180.75 c +56.25 180.75 51.008 180.188 52 172.25 c +52.25 170.25 51.5 170.5 49.75 169.25 c +48 168 45.75 164.25 48.5 158.75 c +51.25 153.25 49 150 48 145.5 c +47 141 48 138.25 51.25 137.25 c +54.5 136.25 54 133.791 54 130.75 C +57 130.5 59 129.25 58.75 124.5 C +62.25 124.5 61.75 126.75 62.5 130 c +63.25 133.25 65.75 129 66.25 127 c +66.75 125 67.5 125 72 125 C +74.75 116.25 74.75 120.5 75.25 117.25 C +80 117.5 79.5 116.75 83.25 113.75 c +87 110.75 88.25 115.5 92 118.5 c +95.75 121.5 94.25 122.75 96.25 118.75 c +98.25 114.75 98.5 119 101.5 119.25 c +104.5 119.5 101 115.75 105.25 114.5 c +109.5 113.25 105 113.75 103.5 111.25 c +102 108.75 95 103.5 101.75 101.5 c +108.5 99.5 103.5 99.75 94.75 99.5 c +86 99.25 73.75 87.5 97.25 73.25 C +117.25 53.25 117.25 53.5 v +117.25 53.75 175.25 163 175.5 163 c +f +1 J +0.2 w +389.709 210.076 m +511.826 210.076 l +S +394.709 212.461 m +516.826 212.461 l +S +415.459 215.112 m +537.576 215.112 l +S +399.709 217.762 m +521.826 217.762 l +S +402.459 222.799 m +524.576 222.799 l +S +402.709 225.45 m +524.826 225.45 l +S +392.959 227.851 m +515.076 227.851 l +S +400.691 232.856 m +522.809 232.856 l +S +388.191 235.241 m +510.309 235.241 l +S +393.941 237.892 m +516.059 237.892 l +S +393.441 240.292 m +515.559 240.292 l +S +396.191 242.928 m +518.309 242.928 l +S +386.441 245.579 m +508.559 245.579 l +S +393.191 248.23 m +515.309 248.23 l +S +414.191 250.631 m +536.309 250.631 l +S +397.95 252.973 m +520.067 252.973 l +S +398.7 255.358 m +520.817 255.358 l +S +400.7 258.009 m +522.817 258.009 l +S +384.45 260.659 m +506.567 260.659 l +S +380.7 265.696 m +502.817 265.696 l +S +379.95 268.347 m +502.067 268.347 l +S +386.7 270.748 m +508.817 270.748 l +S +394.433 275.752 m +516.55 275.752 l +S +381.933 278.138 m +504.05 278.138 l +S +379.433 280.789 m +501.55 280.789 l +S +383.183 283.189 m +505.3 283.189 l +S +370.433 285.825 m +492.55 285.825 l +S +382.433 288.476 m +504.55 288.476 l +S +356.183 291.127 m +478.3 291.127 l +S +372.433 293.277 m +494.55 293.277 l +S +361.866 296.006 m +483.984 296.006 l +S +365.616 298.406 m +487.734 298.406 l +S +366.866 301.042 m +488.984 301.042 l +S +346.866 303.693 m +468.984 303.693 l +S +338.616 306.344 m +460.734 306.344 l +S +330.866 308.494 m +452.984 308.494 l +S +301.575 344.342 m +423.692 344.342 l +S +314.075 346.728 m +436.192 346.728 l +S +318.325 349.378 m +440.442 349.378 l +S +312.075 352.029 m +434.192 352.029 l +S +327.325 357.065 m +449.442 357.065 l +S +327.575 359.716 m +449.692 359.716 l +S +317.825 362.117 m +439.942 362.117 l +S +335.558 367.122 m +457.675 367.122 l +S +313.058 369.507 m +435.175 369.507 l +S +318.808 372.158 m +440.925 372.158 l +S +317.579 404.674 m +439.696 404.674 l +S +322.312 409.179 m +444.429 409.179 l +S +323.812 412.065 m +445.929 412.065 l +S +329.562 414.715 m +451.679 414.715 l +S +329.062 417.116 m +451.179 417.116 l +S +331.812 419.752 m +453.929 419.752 l +S +322.062 422.402 m +444.179 422.402 l +S +328.812 425.053 m +450.929 425.053 l +S +349.812 427.454 m +471.929 427.454 l +S +333.571 429.796 m +455.688 429.796 l +S +334.321 432.182 m +456.438 432.182 l +S +336.321 434.832 m +458.438 434.832 l +S +320.071 437.483 m +442.188 437.483 l +S +316.321 442.519 m +438.438 442.519 l +S +315.571 445.17 m +437.688 445.17 l +S +322.321 447.571 m +444.438 447.571 l +S +330.054 452.576 m +452.171 452.576 l +S +317.554 454.961 m +439.671 454.961 l +S +315.054 457.612 m +437.171 457.612 l +S +318.804 460.012 m +440.921 460.012 l +S +306.054 462.648 m +428.171 462.648 l +S +300.054 465.299 m +422.171 465.299 l +S +291.804 467.95 m +413.921 467.95 l +S +308.054 470.101 m +430.171 470.101 l +S +260.834 543.511 m +382.951 543.511 l +S +246.066 548.016 m +368.184 548.016 l +S +256.066 550.901 m +378.184 550.901 l +S +253.566 553.552 m +375.684 553.552 l +S +230.316 555.952 m +352.434 555.952 l +S +244.566 558.588 m +366.684 558.588 l +S +238.566 561.239 m +360.684 561.239 l +S +230.316 563.89 m +352.434 563.89 l +S +216.566 565.541 m +338.684 565.541 l +S +104.443 572.01 m +226.575 572.209 l +S +98.682 567.48 m +220.814 567.68 l +S +91.688 565.11 m +213.82 565.31 l +S +97.192 561.955 m +219.324 562.155 l +S +73.943 559.517 m +196.075 559.717 l +S +88.199 556.904 m +210.331 557.103 l +S +82.203 554.243 m +204.335 554.443 l +S +73.956 551.578 m +196.088 551.778 l +S +73.707 549.405 m +195.839 549.605 l +S +85.302 539.953 m +207.434 540.152 l +S +79.541 535.423 m +201.673 535.623 l +S +72.547 533.053 m +194.679 533.253 l +S +78.051 529.898 m +200.183 530.098 l +S +54.802 527.46 m +176.934 527.66 l +S +69.058 524.847 m +191.19 525.046 l +S +63.061 522.186 m +185.194 522.385 l +S +54.815 519.521 m +176.947 519.721 l +S +54.566 517.348 m +176.698 517.547 l +S +u +189.475 196.879 m +311.592 196.879 l +S +176.975 199.265 m +299.092 199.265 l +S +174.475 201.916 m +296.592 201.916 l +S +178.225 204.316 m +300.342 204.316 l +S +165.475 206.952 m +287.592 206.952 l +S +177.475 209.603 m +299.592 209.603 l +S +155.725 212.254 m +277.842 212.254 l +S +167.475 214.404 m +289.592 214.404 l +S +156.908 217.133 m +279.026 217.133 l +S +144.658 219.533 m +266.776 219.533 l +S +161.908 222.169 m +284.026 222.169 l +S +153.908 224.82 m +276.026 224.82 l +S +163.658 226.971 m +285.776 226.971 l +S +152.408 229.121 m +274.526 229.121 l +S +145.925 233.316 m +268.042 233.316 l +S +157.675 235.466 m +279.792 235.466 l +S +147.108 238.195 m +269.226 238.195 l +S +134.858 240.595 m +256.976 240.595 l +S +137.608 243.231 m +259.726 243.231 l +S +144.108 245.882 m +266.226 245.882 l +S +153.858 248.033 m +275.976 248.033 l +S +155.108 231.183 m +277.226 231.183 l +S +103.425 247.816 m +225.542 247.816 l +S +100.175 249.966 m +222.292 249.966 l +S +89.608 252.695 m +211.726 252.695 l +S +77.358 255.095 m +199.476 255.095 l +S +U +u +1 g +0 J +1 w +120.001 389.999 m +170.811 344.713 248.714 349.191 294.001 400.001 c +339.287 450.811 334.809 528.714 283.999 574.001 c +233.189 619.287 155.286 614.809 109.999 563.999 c +64.713 513.189 69.191 435.286 120.001 389.999 c +f +202 482 m +F +U +u +258 302 m +306.6 267.759 373.759 279.4 408 328 c +442.241 376.6 430.6 443.759 382 478 c +333.4 512.241 266.241 500.6 232 452 c +197.759 403.4 209.4 336.241 258 302 c +f +320 390 m +F +U +u +196 376 m +252.332 345.072 323.072 365.668 354 422 c +384.928 478.332 364.332 549.072 308 580 c +251.668 610.928 180.928 590.332 150 534 c +119.072 477.668 139.668 406.928 196 376 c +f +252 478 m +F +U +u +106 257 m +170.064 231.595 242.595 262.936 268 327 c +293.405 391.064 262.064 463.595 198 489 c +133.936 514.405 61.405 483.064 36 419 c +10.595 354.936 41.936 282.405 106 257 c +f +152 373 m +F +U +u +366.001 122 m +415.706 97.7 475.7 118.296 500 168.001 c +524.3 217.706 503.704 277.7 453.999 302 c +404.294 326.3 344.3 305.704 320 255.999 c +295.7 206.294 316.296 146.3 366.001 122 c +f +410 212 m +F +U +u +227.999 198 m +267.763 185.85 309.849 208.236 322 247.999 c +334.15 287.763 311.764 329.849 272.001 342 c +232.237 354.15 190.151 331.764 178 292.001 c +165.85 252.237 188.236 210.151 227.999 198 c +f +250 270 m +F +U +0 g +15.75 71.25 m +24.25 82.75 24.75 84.75 27.75 82.25 c +30.75 79.75 31.75 81.25 32.75 82.75 c +33.75 84.25 30.75 86.75 35.75 88.75 c +40.75 90.75 41.25 91.75 43.25 89.75 c +45.25 87.75 39.25 89.25 50.25 88.75 c +61.25 88.25 70.25 81.75 74.25 75.25 c +78.25 68.75 77.75 67.25 75.25 63.25 c +72.75 59.25 68.25 56.75 72.25 57.25 c +76.25 57.75 75.75 60.75 77.75 56.75 c +79.75 52.75 80.25 51.25 79.25 49.25 c +78.25 47.25 74.25 46.75 81.25 46.25 c +88.25 45.75 91.75 37.557 91.75 40.25 c +15.752 40.248 l +15.75 71.25 l +f +340.75 55.5 m +F +u +u +3 w +280.774 44.223 m +567.893 44.223 l +S +280.774 48.728 m +567.893 48.728 l +S +280.774 53.734 m +567.893 53.734 l +S +U +u +280.774 58.739 m +567.893 58.739 l +S +280.774 63.245 m +567.893 63.245 l +S +280.774 68.251 m +567.893 68.251 l +S +U +u +280.774 73.257 m +567.893 73.257 l +S +280.774 78.263 m +567.893 78.263 l +S +U +U +0.8 g +0.2 w +243 252 m +323 235 l +346 273 l +368 248 l +376 247 376 248 V +377 174 380.5 121 330.5 40 C +90.5 40 91.5 40 V +138.5 129 163 162 214 200 C +236 229 234.527 240.11 238 254 c +240 262 243 252 y +b +0.5 g +359.5 485 m +389.267 485 402.5 486.25 415.75 489 c +429 491.75 435 493.25 439 493.5 c +443 493.75 490.398 537.797 502.5 562 c +507 571 514.5 577 517.5 579.5 c +520.5 582 501.5 591 y +428 512 428 512.5 v +428 513 356.5 510 356 509.5 c +355.5 509 351 488 y +359 485 359.5 485 v +b +0.7 g +370 496.5 m +368 480.5 365.5 472.5 364.5 471.5 C +329.5 476.5 l +323.5 489.5 l +370 496.5 l +b +0.5 g +352.75 494 m +380 493.25 399.626 496.75 407.5 499 c +418 502 424.586 497.135 432.75 505.5 c +453 526.25 473.5 544.5 496.5 586.5 C +473.5 590 473.5 590.5 V +456 571.5 443 563.5 434 558 c +425 552.5 416 544 408.5 534.5 C +399 533 379.5 537.5 364 537.5 c +348.5 537.5 352.75 494 y +b +1 g +500 583 m +500.5 577.098 517 573.5 520.5 572 c +524 570.5 526.353 568.989 526.5 579 c +526.675 590.992 541 586 539 624 C +538.5 624 506 628 y +499.958 583.498 500 583 v +b +0 g +1 J +3 w +562 629 m +343 645 217 644 77 601 C +52 576 L +59.5 562 80.132 560.877 87 589 c +89.513 599.292 87 597 101 601 c +108.323 603.092 265 654 561 617 C +562 629 l +f +1 G +0 J +0.7 w +305 634 m +391.5 636.5 415 635 473 632 c +S +0.5 w +213 626.5 m +153.5 619 125.925 611.699 90.75 602.5 c +78.654 599.337 82.567 597.884 82.5 592 c +82.395 582.717 73.75 571 59 572.5 c +S +1 g +0 G +1 w +73 595.25 m +79.25 592.5 76.25 574.75 57.25 580 C +73 595.25 l +f +0.5 g +0.2 w +312 574.25 m +311.25 570.5 310.687 571.687 306.187 569.187 C +307.687 564.187 311.106 565.66 304.5 561.5 c +302.594 560.299 305.598 556.561 305.75 555.5 c +306.038 553.485 304.629 548.098 297 548.5 c +292.25 548.75 255.5 536 y +229.5 608.5 l +224 650 224.5 650 v +248.101 650 273.345 678.918 298 655.5 c +324.857 629.99 316.981 613.501 316.75 612.875 c +313.346 603.644 313.238 604.937 314.75 597.375 c +316.88 586.725 317.016 588.834 318.625 584.75 C +320.25 581.875 318.625 580.375 y +316.689 578.236 313.081 579.809 310.375 579 c +307.013 577.994 312 574.25 y +B +0 g +0.5 w +288.5 456 m +S +0.2 w +211 511 m +194.5 518.5 187 520.5 170.5 500 C +154.5 498.5 149.5 501 131.5 479.5 C +151 477.5 140 475 161 460 c +182 445 190.5 436.5 212 461 C +224.5 458 229 454.5 238.5 447 C +238 446.5 237 500.5 y +211 511 l +f +1 g +207.5 526.5 m +206 514.5 204 506 236 490.5 C +242.5 509.5 l +207.5 526.5 l +b +0 g +1 w +294.464 627.589 m +288.571 618.522 284.821 617.313 280 615.5 c +275.179 613.686 271.429 605.224 277.857 587.089 C +274.107 586.485 275.179 585.88 275.714 582.858 C +271.429 599.179 270.357 606.433 259.643 609.455 c +248.929 612.477 245.714 589.507 247.321 566.537 C +228.572 554.448 L +224.639 578.851 235.956 576.38 212.5 600.992 c +194.17 620.226 195.893 654.791 225.357 658.418 C +223.214 667.485 233.929 678.97 259.107 677.761 c +284.286 676.552 281.071 667.485 Y +302.5 667.485 334.964 665.942 301.429 614.895 C +306.25 639.679 303.571 643.306 296.607 646.933 C +299.286 634.239 294.464 627.589 y +f +0.7 g +0.2 w +207.5 524.5 m +214.75 519.25 241.5 509 y +239 504.5 l +232 503 214.5 508.75 206.75 519 C +207 522.5 207.5 524.5 y +b +1 g +298 546.5 m +272.625 574.625 248.5 596 195.5 568.5 C +196.26 524.417 214.492 504.333 239.5 510.5 C +298 546.5 l +b +0.8 g +351.5 542 m +367 540 L +358.5 509.5 357 489.5 357 482 C +323.5 482.5 295.5 485.5 284.5 477.5 c +298.5 468.5 l +299 457 l +270.5 451 l +238.5 483.5 l +241 513.5 l +250.5 538 252.5 547.5 282.5 550 C +306.251 550 334.454 541.702 343.687 542.187 C +342.576 538.175 346.737 538.055 351.5 542 c +b +0 g +1 w +333.25 484.75 m +343.25 458.25 371.5 466 349 418.5 C +359 348.5 378 357 363 336 C +358.5 333 359 333 v +359.5 333 353 328 359 327.5 c +365 327 371 316.5 373.5 253.5 C +381 245.5 l +371 221 371 220.5 V +360.5 247 358 253 351 261.5 C +340 238 331.5 220.5 328.5 211.5 C +301 229.5 265 250 232.5 244.5 C +247.5 287 246 299.5 275 320.5 C +270 331.5 268.689 334.634 265.75 336.25 c +255.75 341.75 261.891 340.771 251 375 c +247.5 386 249.5 384 255.5 399 C +252.5 397 253.5 401 253.5 402.5 c +253.5 404 252.057 400.023 251 402.5 c +235 440 219.5 489.5 249.5 534 C +238.5 503.5 242.102 477.13 260 463 c +269.5 455.5 278.75 453.25 291 457.25 C +297.5 461 299.549 465.787 282 476.75 C +292.5 487.5 333.25 484.75 y +f +457.25 576.25 m +454.936 574.233 453.51 595.217 479.25 583 C +495.651 573.321 495.931 560.263 482.5 560.5 C +486.25 566 491.682 565.465 478.5 575 c +463.444 585.891 460.318 578.924 457.25 576.25 c +f +1 g +460.75 581.5 m +463.387 583.699 467.528 583.937 470.5 583.375 c +473.752 582.76 473.75 581.75 Y +461.735 583.841 458.891 579.95 460.75 581.5 c +f +0 g +310.393 647.785 m +329.089 651.66 328.75 623.692 320.178 607.976 C +319.107 621.274 316.428 636.386 310.536 635.782 c +304.643 635.177 310.393 647.785 y +f +284.286 663.858 m +286.964 677.157 280.536 689.246 281.071 689.246 C +289.107 677.761 288.036 665.672 y +284.286 663.858 l +f +0.2 w +274.643 683.201 m +278.929 678.97 280 668.694 279.464 665.672 c +S +276.25 686.224 m +284.393 677.036 283.75 662.045 y +S +1 w +297.679 661.44 m +312.602 661.44 312.143 677.157 310.536 680.784 C +308.929 672.321 305.179 666.276 292.857 664.463 C +297.679 661.44 l +f +0.2 w +295 661.44 m +298.75 666.276 302.5 675.343 294.464 683.201 c +S +300.357 681.992 m +304.265 669.255 303.814 670.807 292.321 656.604 c +S +311.821 649.078 m +321.464 649.078 330.571 646.66 329.5 627.921 c +S +307.536 650.892 m +316.268 651.33 319.057 653.025 326.821 646.056 c +330.446 642.802 331.1 637.618 331.107 637.593 c +S +304.643 665.067 m +305.629 663.874 321.031 667.072 321.304 651.569 c +S +0.5 w +311.071 639.679 m +317.893 638.968 312.696 617.332 v +S +1 w +313.375 612.875 m +315.455 614.262 313.5 617.375 297.125 615.375 C +310.375 616.625 311.875 611.875 313.375 612.875 c +f +1 g +308.5 604.875 m +309.833 600.875 309.125 601.25 307.375 599 C +302.25 600.625 303.25 599.875 299 602.5 C +304.25 604.75 308.375 605.25 308.5 604.875 c +f +0 g +307.5 604.437 m +305.463 602.811 305.481 601.49 307.375 598.937 C +309.261 601.307 309.489 602.172 308.562 605.062 C +308.562 604.937 308.191 604.989 307.5 604.437 c +f +0.2 w +305.625 583.75 m +304.687 582.562 306.5 579.375 308.875 579.75 c +S +1 w +311.125 574.5 m +310.25 573.898 310 573.437 304.937 569.312 C +306.229 564.611 308.063 564.014 308.312 564.562 C +309.775 566.476 307.663 569.565 306.687 569.75 C +311.812 571.75 311.625 572.5 312 574.25 C +311.687 574.75 311.176 574.535 311.125 574.5 c +f +298.625 603 m +302 600.437 304.294 599.524 307.812 598.937 c +308.187 598.875 308.562 598.5 308.687 597.875 c +S +297.5 602.25 m +299.939 602.851 307.687 603.062 311.75 607.812 C +307.812 606 297.011 602.129 297.5 602.25 c +f +213.5 576.125 m +218.674 549.92 230.862 532.355 245.5 526.5 C +243.75 514.5 209.75 494.25 195.5 568.5 C +203.75 572.25 213.347 576.901 213.5 576.125 c +f +0.2 w +343.375 541.75 m +333.375 534.75 318.25 525.5 312 521.25 c +S +351.562 541.937 m +337.936 530.579 327.2 525.581 313.25 517.75 c +S +0.3 w +312.75 495 m +291.75 483.5 276.25 476 274.25 466 c +S +0.5 w +229 580.75 m +235.5 571 241.25 554.75 245.75 528 c +S +1 w +235 581 m +246 555.75 246.75 537.75 245.75 526 C +252.125 560.5 243.75 567.75 239.75 581.5 C +240 581.5 237 581.75 235 581 C +f +0.7 g +0.2 w +248.625 580.5 m +253.169 564.605 256.75 553.75 250.25 535.75 C +257.5 552.75 259.125 558.937 252.875 579.687 C +251.029 580.149 248.517 580.879 248.625 580.5 c +b +0 g +1 w +258.25 577.75 m +262.047 567.879 262.5 552.5 259.25 544.25 C +267.75 548.25 275 549.75 278.25 549.75 C +281.75 555.25 282.75 556.75 279.5 565.25 C +270.06 573.13 257.909 578.635 258.25 577.75 c +f +207.5 524.5 m +F +207.25 514.75 m +207.185 514.86 228.75 497.5 238 500.75 C +236 494.5 l +225 498 213.924 503.454 207.25 514.75 c +f +1 g +0.2 w +191 516 m +175.472 497.418 168.5 492 171.5 453 C +185 443.5 189 443.5 200 450.5 C +186.5 469.5 182 491 198.5 515.5 C +194.5 516 191.339 516.406 191 516 c +b +201 515 m +194 499 187 484 203.5 453 C +206.5 455 211.5 460.5 212 461 C +203.5 480.5 193.5 501.5 206 510.5 C +205 499.5 210.5 490.5 232.5 473.5 C +232.5 483 231.5 482.5 233 492 C +221 498 210 505 208 512.5 C +201 515 l +b +0 g +1 G +0.5 w +268 442.5 m +253.5 402.5 l +S +269.5 435.5 m +258.5 407 258.5 407.5 v +S +0.5 G +0.4 w +293.5 480.5 m +297.5 463.5 298.5 460.5 289 445.5 c +S +1 G +1 J +0.3 w +349.125 418.125 m +338.393 403.978 348.387 416.158 341.625 408.875 c +S +u +1 g +0 G +0 J +0.2 w +336.038 340.015 m +338.267 329.694 L +342.937 338.843 L +340.707 349.164 L +336.038 340.015 L +b +339.487 339.429 m +B +U +u +328.791 340.569 m +331.562 330.38 L +335.743 339.762 L +332.972 349.952 L +328.791 340.569 L +b +332.267 340.166 m +B +U +u +321.758 340.67 m +325.133 330.664 L +328.746 340.28 L +325.37 350.286 L +321.758 340.67 L +b +325.252 340.475 m +B +U +u +314.504 340.97 m +317.88 330.964 L +321.492 340.58 L +318.117 350.586 L +314.504 340.97 L +b +317.998 340.775 m +B +U +u +u +307.24 340.468 m +311.982 331.033 L +314.214 341.059 L +309.473 350.494 L +307.24 340.468 L +b +310.727 340.764 m +B +U +u +300.016 339.751 m +304.757 330.316 L +306.99 340.342 L +302.249 349.777 L +300.016 339.751 L +b +303.503 340.047 m +B +U +U +u +u +292.985 339.2 m +298.349 330.104 L +299.903 340.258 L +294.54 349.353 L +292.985 339.2 L +b +296.444 339.729 m +B +U +u +285.826 338 m +291.189 328.904 L +292.744 339.057 L +287.38 348.153 L +285.826 338 L +b +289.285 338.529 m +B +U +U +u +278.742 336.229 m +285.413 328.042 L +285.423 338.314 L +278.753 346.501 L +278.742 336.229 L +b +282.083 337.272 m +B +U +u +272.228 332.392 m +279.743 324.974 L +278.644 335.186 L +271.13 342.604 L +272.228 332.392 L +b +275.437 333.789 m +B +U +0 g +1 G +1 w +266.25 335.5 m +276.25 351.5 284.659 350 343 350 c +364 350 363 336 y +S +271 321 m +294 332 309 335 362 324 c +S +u +1 g +0 G +0.2 w +350.823 325.912 m +364.33 322.302 L +361.658 347.078 L +348.151 350.689 L +350.823 325.912 L +b +356.24 336.495 m +B +U +0 g +1 w +274 347.5 m +281.5 351.5 280.229 357.581 311 338 c +316.5 334.5 322.5 338 351 357.5 C +282 360 l +274 347.5 l +f +1 G +0.5 w +269.25 355.75 m +277.75 353.25 284.25 352.5 288.75 349.75 c +S +353.25 358.25 m +347.25 354 345.5 353.5 339.75 349.5 c +S +0.3 w +355.25 272.75 m +359.75 281.5 361.25 285 363.25 290.75 c +S +0.5 G +0.5 w +354 219 m +339 195 327 176 317 166 c +S +323 197 m +310 150 308 135 235 48 c +S +1 w +241 241.5 m +232 227.5 215.231 198.443 215 198 c +192.581 155 178 110 164 71 c +S +0 G +0.2 w +265.394 600.822 m +263.576 606.114 262.122 612.994 253.035 607.173 C +250.126 603.468 249.763 601.704 249.763 596.589 c +249.763 591.473 254.307 592.179 257.76 587.24 c +261.213 582.301 266.484 579.302 267.029 588.475 c +S +0.3 g +260.668 605.409 m +262.486 601.352 261.94 599.941 257.578 597.824 c +253.216 595.707 257.76 591.473 260.305 592.355 c +262.849 593.237 263.394 592.532 264.303 591.65 c +265.212 590.768 266.666 591.826 264.667 594.119 c +262.667 596.413 259.759 593.943 261.032 597.471 c +262.304 600.999 260.668 605.409 y +b +0 g +257.578 606.644 m +254.125 605.056 251.58 604.174 251.58 598.177 c +251.58 592.179 258.487 590.415 259.214 588.651 c +S +u +1 g +257.397 584.594 m +258.601 581.671 262.019 580.25 265.03 581.419 c +268.041 582.588 269.506 585.905 268.302 588.827 c +267.097 591.75 263.679 593.172 260.668 592.003 c +257.657 590.833 256.192 587.516 257.397 584.594 c +b +262.849 586.711 m +B +U +u +0.2 g +1 w +258.487 586.358 m +263.213 582.477 L +267.211 587.063 L +262.486 590.944 L +258.487 586.358 L +f +262.849 586.711 m +F +U +0 g +309.25 579.875 m +310.75 580.5 313.25 583.125 314.625 581 c +F +1 g +307.964 565.926 m +307.88 566.015 306.794 566.513 307.22 566.682 c +307.647 566.851 307.68 566.599 307.935 566.639 C +307.924 566.13 307.971 566.31 307.964 565.926 c +f +510 104 m +509.564 104.895 511.5 89 495.5 74.5 C +495.5 68 l +506 79 518.582 86.358 510 104 c +f +0 g +0.2 w +403.75 534.25 m +413.25 533.75 415.75 534.25 417.75 534.75 c +S +1 G +0.3 w +538.5 629 m +542 625 547.5 620 y +S +548.75 629.25 m +552.25 625.25 557.75 620.25 y +S +0 G +0.2 w +518.5 587.5 m +522.5 586 526 587.5 527 587.5 c +S +514 617.5 m +518 614 518.5 611.5 520 607.5 c +S +528.25 613.75 m +533.25 615.25 532.5 615.5 538.25 614.25 c +S +1 g +538 637.5 m +537.25 618 533 617.5 531.25 617.5 c +529.5 617.5 528.235 615.255 528.5 622.5 c +529.25 643 528.775 643.326 534.25 642.75 c +539 642.25 539 642.25 540.5 630.75 C +538 631 l +538 629 538 631.25 v +538 633.5 538 637.5 Y +b +0.7 g +507.5 650.75 m +510 648.5 510.25 645.75 511.75 643.25 c +513.25 640.75 508.5 638.25 508.5 638 c +508.5 637.75 507.5 650.75 y +b +1 g +529.25 639.25 m +528.5 643 527 642.75 524 642.75 c +521 642.75 519.75 644 519.5 632.25 C +519.75 638 519.75 641 v +519.75 644 518.75 644.25 515.25 644.25 c +511.75 644.25 511.75 646 509.25 641.25 c +506.75 636.5 505.75 633.25 506 633.25 c +506.25 633.25 509.75 628.25 Y +511.5 620.25 512.75 619.75 515.5 619.5 c +518.25 619.25 520.25 618.25 519.5 623.5 C +521 618.25 521 617.75 524.75 617 c +528.5 616.25 528.5 618.25 528.5 622.5 c +528.5 626.75 529.25 639.25 y +b +507.75 636.75 m +512.687 638.231 515.604 641 515.25 641 C +517.839 637.469 517.494 629.281 508.75 625.5 C +508.75 625.25 502 635 502.25 634.75 c +502.5 634.5 507.75 636.75 y +b +493.5 571.5 m +495.171 563.425 503.634 565.498 503.5 576.25 c +503.25 596.25 515.75 586.25 509 636.75 c +508.301 641.977 510 650.75 506.5 651.5 c +501.514 652.568 500.436 652.26 499.25 644.75 c +498.5 640 496.5 646.25 496 648.5 c +495.5 650.75 493.75 651 490.75 650.25 c +487.75 649.5 488.253 648.665 487.5 645.5 c +486.194 640.013 486.75 641.75 484.5 645.5 c +482.39 649.016 481.306 648.011 477.5 647.25 c +475 646.75 474.784 644.479 475.25 640.75 c +475.5 638.75 474 642.25 472.5 644.5 c +471 646.75 469.25 645.5 466.5 645.5 c +463.75 645.5 463.25 641.003 463.5 635.5 c +463.511 635.25 463 626.25 y +449.75 627.25 l +459.25 618.5 465.606 612.863 468.25 597 c +468.75 594 468 592.25 470 592.75 C +459.719 593.497 459.195 585.398 461 586 c +466.25 587.75 471.75 589.25 476.75 587 c +481.75 584.75 486.25 584.25 489.5 586.25 C +490.25 582.75 492 578.75 493.5 571.5 c +b +0 g +486.25 592.5 m +489 595.25 492.117 593.078 492.25 592.75 c +494.972 586.028 477 591.75 467.25 593 c +S +0.4 w +470 592.75 m +474.25 595.75 475 596 481.5 595.75 c +S +1 J +2.5 w +477.75 630 m +478.5 620.75 l +S +479.25 617.5 m +480 610.5 l +S +480.25 607.75 m +481 600.25 481 600.5 v +S +487.5 631.75 m +487.75 623.5 l +S +487.75 620.75 m +487.75 612.5 l +S +488 609.25 m +488.25 609.25 487.75 602.5 y +S +498 630.75 m +497.25 623.75 l +S +496.75 620.75 m +495.5 612.5 l +S +495.25 609.5 m +493.75 602 l +S +0 J +0.2 w +465.5 637.25 m +464.5 629.75 461.25 628.75 464.75 617 c +S +0.5 w +502 589.25 m +503.25 585 503.5 583.25 503.5 577 c +S +1 g +1 w +521.949 86.694 m +521.637 87.353 523.021 75.657 511.583 64.988 C +511.583 60.205 l +519.089 68.299 528.083 73.713 521.949 86.694 c +f +553.457 99.673 m +553.091 100.449 554.713 86.67 541.309 74.1 C +541.309 68.465 l +550.105 78.001 560.646 84.379 553.457 99.673 c +f +482.74 95.04 m +482.429 95.699 483.812 84.003 472.375 73.334 C +472.375 68.551 l +479.881 76.645 488.875 82.059 482.74 95.04 c +f +450.924 87.63 m +450.69 88.028 451.731 80.968 443.129 74.528 C +443.129 71.641 l +448.774 76.527 455.538 79.795 450.924 87.63 c +f +0 g +308 61.5 m +N +3 w +16.002 40.373 m +568.002 40.127 L +567.748 716.565 L +S +u +15.815 40.248 m +567.815 40.002 L +567.748 716.565 L +15.998 716.81 L +15.815 40.248 L +s +U +%%Trailer +_E end +showpage