gutscript

package
v0.0.0-...-08386a5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const GutsEofCode = 1
View Source
const GutsErrCode = 2
View Source
const GutsFlag = -1000
View Source
const GutsLast = 267
View Source
const GutsMaxDepth = 200
View Source
const GutsNprod = 79
View Source
const GutsPrivate = 57344
View Source
const T_BOOLEAN_AND = 57392
View Source
const T_BOOLEAN_OR = 57391
View Source
const T_BREAK = 57382
View Source
const T_CALLEND = 57388
View Source
const T_CALLSTART = 57387
View Source
const T_CATCH = 57372
View Source
const T_CLASS = 57373
View Source
const T_CLONE = 57361
View Source
const T_COMMENT = 57352
View Source
const T_CONST = 57380
View Source
const T_CONTINUE = 57383
View Source
const T_DOES = 57375
View Source
const T_DOT = 57346
View Source
const T_ECHO = 57369
View Source
const T_ELSE = 57365
View Source
const T_ELSEIF = 57364
View Source
const T_EOF = 57353
View Source
const T_EQUAL = 57354
View Source
const T_EXTENDS = 57376
View Source
const T_FLOATING = 57348
View Source
const T_FOR = 57366
View Source
const T_FOREACH = 57370
View Source
const T_FUNCTION_GLYPH = 57378
View Source
const T_FUNCTION_PROTOTYPE = 57377
View Source
const T_GT_EQUAL = 57356
View Source
const T_IDENTIFIER = 57347
View Source
const T_IF = 57362
View Source
const T_IN = 57363
View Source
const T_INDENT = 57357
View Source
const T_IS = 57374
View Source
const T_LT_EQUAL = 57355
View Source
const T_NAMESPACE = 57386
View Source
const T_NEW = 57360
View Source
const T_NEWLINE = 57359
View Source
const T_NS_SEPARATOR = 57385
View Source
const T_NUMBER = 57349
View Source
const T_OBJECT_OPERATOR = 57389
View Source
const T_ONELINE_COMMENT = 57351
View Source
const T_OUTDENT = 57358
View Source
const T_RANGE_OPERATOR = 57379
View Source
const T_RETURN = 57381
View Source
const T_SAY = 57367
View Source
const T_SPACE = 57368
View Source
const T_STRING = 57350
View Source
const T_THROW = 57384
View Source
const T_TRY = 57371
View Source
const UMINUS = 57390

Variables

View Source
var GutsAct = []int{}/* 267 elements not displayed */
View Source
var GutsChk = []int{}/* 131 elements not displayed */
View Source
var GutsDebug = 100
View Source
var GutsDef = []int{}/* 131 elements not displayed */
View Source
var GutsExca = []int{
	-1, 1,
	1, -1,
	-2, 0,
}
View Source
var GutsPact = []int{}/* 131 elements not displayed */
View Source
var GutsPgo = []int{

	0, 0, 189, 188, 14, 1, 187, 186, 3, 4,
	185, 184, 89, 181, 180, 176, 166, 165, 164, 161,
	146, 144, 7, 137, 134, 133, 124, 123, 2, 115,
	91, 91, 91,
}
View Source
var GutsR1 = []int{

	0, 24, 23, 22, 12, 12, 12, 4, 4, 4,
	4, 4, 4, 4, 4, 4, 29, 29, 21, 20,
	20, 20, 19, 8, 8, 8, 7, 7, 6, 6,
	6, 5, 5, 13, 17, 17, 14, 14, 15, 15,
	16, 16, 28, 28, 28, 18, 18, 26, 26, 27,
	30, 1, 1, 1, 1, 1, 1, 1, 1, 1,
	1, 1, 1, 1, 1, 1, 1, 1, 1, 31,
	32, 25, 3, 2, 9, 10, 10, 10, 11,
}
View Source
var GutsR2 = []int{

	0, 1, 1, 3, 3, 2, 1, 1, 1, 1,
	1, 1, 1, 1, 2, 1, 2, 3, 4, 4,
	5, 4, 3, 3, 2, 1, 3, 1, 3, 2,
	0, 5, 5, 5, 4, 0, 2, 0, 2, 0,
	3, 1, 3, 2, 1, 1, 1, 4, 2, 1,
	3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
	3, 3, 3, 3, 2, 1, 1, 1, 1, 4,
	2, 1, 1, 1, 1, 3, 1, 0, 4,
}
View Source
var GutsStatenames = []string{}
View Source
var GutsStates []string
View Source
var GutsTok1 = []int{}/* 125 elements not displayed */
View Source
var GutsTok2 = []int{

	2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
	12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
	22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
	32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
	42, 43, 44, 45, 46, 47, 59, 60, 61,
}
View Source
var GutsTok3 = []int{
	0,
}
View Source
var GutsTokenNames []string
View Source
var GutsToknames = []string{
	"T_DOT",
	"T_IDENTIFIER",
	"T_FLOATING",
	"T_NUMBER",
	"T_STRING",
	"T_ONELINE_COMMENT",
	"T_COMMENT",
	"T_EOF",
	"T_EQUAL",
	"T_LT_EQUAL",
	"T_GT_EQUAL",
	"T_INDENT",
	"T_OUTDENT",
	"T_NEWLINE",
	"T_NEW",
	"T_CLONE",
	"T_IF",
	"T_IN",
	"T_ELSEIF",
	"T_ELSE",
	"T_FOR",
	"T_SAY",
	"T_SPACE",
	"T_ECHO",
	"T_FOREACH",
	"T_TRY",
	"T_CATCH",
	"T_CLASS",
	"T_IS",
	"T_DOES",
	"T_EXTENDS",
	"T_FUNCTION_PROTOTYPE",
	"T_FUNCTION_GLYPH",
	"T_RANGE_OPERATOR",
	"T_CONST",
	"T_RETURN",
	"T_BREAK",
	"T_CONTINUE",
	"T_THROW",
	"T_NS_SEPARATOR",
	"T_NAMESPACE",
	"T_CALLSTART",
	"T_CALLEND",
	"T_OBJECT_OPERATOR",
	" (",
	" )",
	" |",
	" ^",
	" &",
	" +",
	" -",
	" *",
	" /",
	" %",
	" !",
	"UMINUS",
	"T_BOOLEAN_OR",
	"T_BOOLEAN_AND",
}
View Source
var LexKeywords = map[string]int{
	"if":      T_IF,
	"class":   T_CLASS,
	"for":     T_FOR,
	"foreach": T_FOREACH,
	"else":    T_ELSE,
	"elseif":  T_ELSEIF,
	"echo":    T_ECHO,
	"is":      T_IS,
	"return":  T_RETURN,
	"extends": T_EXTENDS,
	"does":    T_DOES,
	"new":     T_NEW,
	"clone":   T_CLONE,
}

Functions

func CompileFile

func CompileFile(srcFile string) (string, error)

func DumpTokenTypeList

func DumpTokenTypeList(items []*GutsSymType) string

func DumpTokensFromChannel

func DumpTokensFromChannel(itemChannel chan *GutsSymType)

Given a token type list, check the returned token items

func GetTokenName

func GetTokenName(typ int) string

func GutsStatname

func GutsStatname(s int) string

func GutsTokname

func GutsTokname(c int) string

func Gutslex1

func Gutslex1(lex GutsLexer, lval *GutsSymType) int

Types

type GutsLex

type GutsLex struct {
	// the line
	Input       string
	Line        int
	Start       int
	Pos         int
	IndentLevel int

	Items chan *GutsSymType
	// contains filtered or unexported fields
}

func CreateLexer

func CreateLexer(input string, capacity uint32) *GutsLex

func (*GutsLex) Error

func (l *GutsLex) Error(s string)

func (*GutsLex) Lex

func (l *GutsLex) Lex(lval *GutsSymType) int

set token in lval, return the token type id

type GutsLexer

type GutsLexer interface {
	Lex(lval *GutsSymType) int
	Error(s string)
}

type GutsParser

type GutsParser struct {
	Val GutsSymType
}

func (*GutsParser) Parse

func (self *GutsParser) Parse(Gutslex GutsLexer) int

type GutsSymType

type GutsSymType struct {
	// contains filtered or unexported fields
}

func (*GutsSymType) GetLine

func (self *GutsSymType) GetLine() int

func (*GutsSymType) GetPos

func (self *GutsSymType) GetPos() int

func (*GutsSymType) String

func (self *GutsSymType) String() string

type TokenType

type TokenType int

Directories

Path Synopsis
codegen
php

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL