{"modulePath":"github.com/llgcode/ps","version":"v0.0.0-20210114104736-f4b0c5d1e02e","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package ps\n\nPackage ps\n\n### Arithmetic and Math Operators {#hdr-Arithmetic_and_Math_Operators}\n\n### Miscellaneous Operators {#hdr-Miscellaneous_Operators}\n\n### Operand Stack Manipulation Operators {#hdr-Operand_Stack_Manipulation_Operators}\n\nCopyright 2009 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. postscript scanner derived form the scanner package of go sources\n\n## Constants\n\n```go\nconst (\n\tScanIdents     = 1 \u003c\u003c -Ident\n\tScanInts       = 1 \u003c\u003c -Int\n\tScanFloats     = 1 \u003c\u003c -Float // includes Ints\n\tScanChars      = 1 \u003c\u003c -Char\n\tScanStrings    = 1 \u003c\u003c -String\n\tScanRawStrings = 1 \u003c\u003c -RawString\n\tScanComments   = 1 \u003c\u003c -Comment\n\tSkipComments   = 1 \u003c\u003c -skipComment // if set with ScanComments, comments become white space\n\tGoTokens       = ScanIdents | ScanFloats | ScanChars | ScanStrings | ScanRawStrings | ScanComments | SkipComments\n)\n```\nPredefined mode bits to control recognition of tokens. For instance, to configure a Scanner such that it only recognizes (Go) identifiers, integers, and skips comments, set the Scanner's Mode field to:\n\n\tScanIdents | ScanInts | SkipComments\n\n```go\nconst (\n\tEOF = -(iota + 1)\n\tIdent\n\tInt\n\tFloat\n\tChar\n\tString\n\tRawString\n\tComment\n)\n```\nThe result of Scan is one of the following tokens or a Unicode character.\n\n```go\nconst GoWhitespace = 1\u003c\u003c'\\t' | 1\u003c\u003c'\\n' | 1\u003c\u003c'\\r' | 1\u003c\u003c' '\n```\nGoWhitespace is the default value for the Scanner's Whitespace field. Its value selects Go's white space characters.\n\n## Functions\n\n```go\nfunc TokenString(tok int) string\n```\nTokenString returns a (visible) string for a token or Unicode character.\n\n## Types\n\n```go\ntype Dictionary map[string]Value\n```\n\n```go\nfunc NewDictionary(prealloc int) Dictionary\n```\n\n```go\ntype DictionaryStack []Dictionary\n```\n\n```go\ntype Interpreter struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewInterpreter(gc draw2d.GraphicContext) *Interpreter\n```\n\n```go\nfunc (interpreter *Interpreter) ClearDictionaries()\n```\n\n```go\nfunc (interpreter *Interpreter) ClearOperands()\n```\n\n```go\nfunc (interpreter *Interpreter) Define(name string, value Value)\n```\n\n```go\nfunc (interpreter *Interpreter) DictionaryStackSize() int\n```\n\n```go\nfunc (interpreter *Interpreter) Execute(reader io.Reader)\n```\n\n```go\nfunc (interpreter *Interpreter) ExecuteFile(filePath string) error\n```\n\n```go\nfunc (interpreter *Interpreter) FindValue(name string) Value\n```\n\n```go\nfunc (interpreter *Interpreter) FindValueInDictionaries(name string) (Value, Dictionary)\n```\n\n```go\nfunc (interpreter *Interpreter) Get(index int) Value\n```\n\n```go\nfunc (interpreter *Interpreter) GetGraphicContext() draw2d.GraphicContext\n```\n\n```go\nfunc (interpreter *Interpreter) GetValues(n int) []Value\n```\n\n```go\nfunc (interpreter *Interpreter) OperandSize() int\n```\n\n```go\nfunc (interpreter *Interpreter) Peek() Value\n```\n\n```go\nfunc (interpreter *Interpreter) PeekDictionary() Dictionary\n```\n\n```go\nfunc (interpreter *Interpreter) Pop() Value\n```\n\n```go\nfunc (interpreter *Interpreter) PopArray() []Value\n```\n\n```go\nfunc (interpreter *Interpreter) PopBoolean() bool\n```\n\n```go\nfunc (interpreter *Interpreter) PopDictionary() Dictionary\n```\n\n```go\nfunc (interpreter *Interpreter) PopFloat() float64\n```\n\n```go\nfunc (interpreter *Interpreter) PopInt() int\n```\n\n```go\nfunc (interpreter *Interpreter) PopName() string\n```\n\n```go\nfunc (interpreter *Interpreter) PopOperator() Operator\n```\n\n```go\nfunc (interpreter *Interpreter) PopProcedureDefinition() *ProcedureDefinition\n```\n\n```go\nfunc (interpreter *Interpreter) PopString() string\n```\n\n```go\nfunc (interpreter *Interpreter) PopValues(n int) []Value\n```\n\n```go\nfunc (interpreter *Interpreter) Push(operand Value)\n```\n\n```go\nfunc (interpreter *Interpreter) PushDictionary(dictionary Dictionary)\n```\n\n```go\nfunc (interpreter *Interpreter) SetGraphicContext(gc draw2d.GraphicContext)\n```\n\n```go\nfunc (interpreter *Interpreter) SystemDefine(name string, value Value)\n```\n\n```go\nfunc (interpreter *Interpreter) SystemDictionary() Dictionary\n```\n\n```go\nfunc (interpreter *Interpreter) UserDictionary() Dictionary\n```\n\n```go\ntype Mark struct{}\n```\nMark\n\n```go\ntype Operator interface {\n\tExecute(interpreter *Interpreter)\n}\n```\n\n```go\ntype OperatorFunc func(interpreter *Interpreter)\n```\n\n```go\ntype Position struct {\n\tFilename string // filename, if any\n\tOffset   int    // byte offset, starting at 0\n\tLine     int    // line number, starting at 1\n\tColumn   int    // column number, starting at 0 (character count per line)\n}\n```\nA source position is represented by a Position value. A position is valid if Line \u003e 0.\n\n```go\nfunc (pos *Position) IsValid() bool\n```\nIsValid returns true if the position is valid.\n\n```go\nfunc (pos Position) String() string\n```\n\n```go\ntype PrimitiveOperator struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewOperator(f OperatorFunc) *PrimitiveOperator\n```\n\n```go\nfunc (o *PrimitiveOperator) Execute(interpreter *Interpreter)\n```\n\n```go\ntype Procedure struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewProcedure(def *ProcedureDefinition) *Procedure\n```\n\n```go\nfunc (p *Procedure) Execute(interpreter *Interpreter)\n```\n\n```go\ntype ProcedureDefinition struct {\n\tValues []Value\n}\n```\n\n```go\nfunc NewProcedureDefinition() *ProcedureDefinition\n```\n\n```go\nfunc (p *ProcedureDefinition) Add(value Value)\n```\n\n```go\ntype Scanner struct {\n\n\t// Error is called for each error encountered. If no Error\n\t// function is set, the error is reported to os.Stderr.\n\tError func(s *Scanner, msg string)\n\n\t// ErrorCount is incremented by one for each error encountered.\n\tErrorCount int\n\n\t// The Mode field controls which tokens are recognized. For instance,\n\t// to recognize Ints, set the ScanInts bit in Mode. The field may be\n\t// changed at any time.\n\tMode uint\n\n\t// The Whitespace field controls which characters are recognized\n\t// as white space. To recognize a character ch \u003c= ' ' as white space,\n\t// set the ch'th bit in Whitespace (the Scanner's behavior is undefined\n\t// for values ch \u003e ' '). The field may be changed at any time.\n\tWhitespace uint64\n\n\t// Current token position. The Offset, Line, and Column fields\n\t// are set by Scan(); the Filename field is left untouched by the\n\t// Scanner.\n\tPosition\n\t// contains filtered or unexported fields\n}\n```\nA Scanner implements reading of Unicode characters and tokens from an io.Reader.\n\n```go\nfunc (s *Scanner) Init(src io.Reader) *Scanner\n```\nInit initializes a Scanner with a new source and returns itself. Error is set to nil, ErrorCount is set to 0, Mode is set to GoTokens, and Whitespace is set to GoWhitespace.\n\n```go\nfunc (s *Scanner) Next() rune\n```\nNext reads and returns the next Unicode character. It returns EOF at the end of the source. It reports a read error by calling s.Error, if set, or else prints an error message to os.Stderr. Next does not update the Scanner's Position field; use Pos() to get the current position.\n\n```go\nfunc (s *Scanner) Peek() rune\n```\nPeek returns the next Unicode character in the source without advancing the scanner. It returns EOF if the scanner's position is at the last character of the source.\n\n```go\nfunc (s *Scanner) Pos() Position\n```\nPosition returns the current source position. If called before Next() or Scan(), it returns the position of the next Unicode character or token returned by these functions. If called afterwards, it returns the position immediately after the last character of the most recent token or character scanned.\n\n```go\nfunc (s *Scanner) Scan() int\n```\nScan reads the next token or Unicode character from source and returns it. It only recognizes tokens t for which the respective Mode bit (1\\\u003c\\\u003c-t) is set. It returns EOF at the end of the source. It reports scanner errors (read and token errors) by calling s.Error, if set; otherwise it prints an error message to os.Stderr.\n\n```go\nfunc (s *Scanner) TokenText() string\n```\nTokenText returns the string corresponding to the most recently scanned token. Valid after calling Scan().\n\n```go\ntype Value interface{}\n```\n\n```go\ntype ValueStack []Value\n```\n\n","path":"github.com/llgcode/ps","name":"ps","synopsis":"Package ps Arithmetic and Math Operators Miscellaneous Operators Operand Stack Manipulation Operators Copyright 2009 The Go Authors.","isRedistributable":true}
