yac

package
v1.5.18 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SPACE  = "\t "
	QUOTE  = "\"'`"
	TRANS  = " "
	BLOCK  = "[:](,){;}*/+-<>!=&|"
	EXPAND = "..."
	DEFINE = ":="
	ASSIGN = "="
	SUBS   = "["
	DEFS   = ":"
	SUPS   = "]"
	OPEN   = "("
	FIELD  = ","
	CLOSE  = ")"
	BEGIN  = "{"
	SPLIT  = ";"
	END    = "}"
)
View Source
const (
	PACKAGE = "package"
	IMPORT  = "import"
)
View Source
const (
	STATUS_NORMAL  = 0
	STATUS_DISABLE = -1
)
View Source
const (
	IF       = "if"
	ELSE     = "else"
	FOR      = "for"
	RANGE    = "range"
	BREAK    = "break"
	CONTINUE = "continue"
	SWITCH   = "switch"
	CASE     = "case"
	DEFAULT  = "default"
	FUNC     = "func"
	DEFER    = "defer"
	RETURN   = "return"

	CALL = "call"
	INIT = "init"
	MAIN = "main"
	INFO = "info"
)
View Source
const (
	KEYWORD  = "keyword"
	FUNCTION = "function"
)
View Source
const (
	MAP       = "map"
	SLICE     = "slice"
	STRUCT    = "struct"
	INTERFACE = "interface"
	STRING    = "string"
	BOOL      = "bool"
	INT       = "int"

	INSTANCEOF = "instanceof"
	IMPLEMENTS = "implements"

	CONST = "const"
	TYPE  = "type"
	VAR   = "var"
)
View Source
const (
	LEN = "len"
	KIT = "kit"
)
View Source
const (
	ERROR = "error"
)
View Source
const EXPR = "expr"
View Source
const STACK = "stack"
View Source
const YAC = "yac"

Variables

View Source
var Index = &ice.Context{Name: YAC, Help: "语法模块"}

Functions

func Format added in v1.5.5

func Format(arg ...Any) string

func StackAction added in v1.5.5

func StackAction() ice.Actions

func StackHandler added in v1.5.5

func StackHandler(m *ice.Message, arg ...string)

func TransActions added in v1.5.5

func TransActions(m *ice.Message, arg ...Any) ice.Actions

func TransCommands added in v1.5.5

func TransCommands(m *ice.Message, arg ...Any) ice.Commands

func TransContext added in v1.5.5

func TransContext(m *ice.Message, key string, arg ...Any) *ice.Context

Types

type Any added in v1.5.5

type Any = ice.Any

func Trans added in v1.5.5

func Trans(v Any) Any

func Wraps added in v1.5.5

func Wraps(v Any) Any

type Boolean added in v1.5.5

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

func (Boolean) MarshalJSON added in v1.5.5

func (s Boolean) MarshalJSON() ([]byte, error)

func (Boolean) Operate added in v1.5.5

func (s Boolean) Operate(op string, v Any) Any

type Buffer added in v1.5.5

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

type Caller added in v1.5.5

type Caller interface{ Call(string, ...Any) Any }

type Dict added in v1.5.5

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

func (Dict) MarshalJSON added in v1.5.5

func (s Dict) MarshalJSON() ([]byte, error)

func (Dict) Operate added in v1.5.5

func (s Dict) Operate(op string, v Any) Any

type Error added in v1.5.5

type Error struct {
	Position
	// contains filtered or unexported fields
}

func ErrNotFound added in v1.5.5

func ErrNotFound(arg ...Any) Error

func ErrNotImplement added in v1.5.5

func ErrNotImplement(arg ...Any) Error

func ErrNotSupport added in v1.5.5

func ErrNotSupport(arg ...Any) Error

func ErrNotValid added in v1.5.5

func ErrNotValid(arg ...Any) Error

type Expr added in v1.5.5

type Expr struct {
	*Stack
	// contains filtered or unexported fields
}

func NewExpr added in v1.5.5

func NewExpr(s *Stack) *Expr

type Field added in v1.5.5

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

func (Field) Format added in v1.5.5

func (s Field) Format() string

func (Field) MarshalJSON added in v1.5.5

func (s Field) MarshalJSON() ([]byte, error)

type Fields added in v1.5.5

type Fields []Field

func (Fields) For added in v1.5.5

func (s Fields) For(cb func(Field))

type Frame added in v1.5.5

type Frame struct {
	Position
	// contains filtered or unexported fields
}

type Function added in v1.5.5

type Function struct {
	Position
	// contains filtered or unexported fields
}

func (Function) MarshalJSON added in v1.5.5

func (s Function) MarshalJSON() ([]byte, error)

func (Function) Operate added in v1.5.5

func (s Function) Operate(op string, v Any) Any

type Interface added in v1.5.5

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

type List added in v1.5.5

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

func (List) MarshalJSON added in v1.5.5

func (s List) MarshalJSON() ([]byte, error)

func (List) Operate added in v1.5.5

func (s List) Operate(op string, v Any) Any

type Map added in v1.5.5

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

type Message added in v1.5.5

type Message struct{ *ice.Message }

func (Message) Call added in v1.5.5

func (m Message) Call(cmd string, arg ...Any) Any

type Number added in v1.5.5

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

func (Number) MarshalJSON added in v1.5.5

func (s Number) MarshalJSON() ([]byte, error)

func (Number) Operate added in v1.5.5

func (s Number) Operate(op string, v Any) Any

type Object added in v1.5.5

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

func (Object) Operate added in v1.5.5

func (s Object) Operate(op string, v Any) Any

type Operater added in v1.5.5

type Operater interface{ Operate(string, Any) Any }

type Position added in v1.5.5

type Position struct {
	*Buffer
	// contains filtered or unexported fields
}

type Slice added in v1.5.5

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

type Stack added in v1.5.5

type Stack struct {
	Error []Error
	Position
	// contains filtered or unexported fields
}

func NewStack added in v1.5.5

func NewStack(m *ice.Message, cb func(*Frame), arg ...string) *Stack

func (*Stack) Action added in v1.5.5

func (s *Stack) Action(m *ice.Message, obj Any, key string, arg ...string) *ice.Message

func (*Stack) Handler added in v1.5.5

func (s *Stack) Handler(obj Any) ice.Handler

type String added in v1.5.5

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

func (String) MarshalJSON added in v1.5.5

func (s String) MarshalJSON() ([]byte, error)

func (String) Operate added in v1.5.5

func (s String) Operate(op string, v Any) Any

type Struct added in v1.5.5

type Struct struct {
	Position
	// contains filtered or unexported fields
}

func (Struct) Find added in v1.5.5

func (s Struct) Find(k string) Any

func (Struct) For added in v1.5.5

func (s Struct) For(cb func(k string, v Any))

func (Struct) Operate added in v1.5.5

func (s Struct) Operate(op string, v Any) Any

type Value added in v1.5.5

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

Jump to

Keyboard shortcuts

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