Documentation ¶
Overview ¶
Code generated by goyacc -l -o ruby.go ruby.y. DO NOT EDIT.
compiled from https://github.com/whitequark/parser/blob/master/lib/parser/lexer/stack_state.rb
Index ¶
- Constants
- Variables
- func DebugLevel() int
- func GetType(n Node, scope ScopeChain, class *Class) (t types.Type, err error)
- func Indent(strs ...string) string
- func LogDebug(verbosity int, format string, v ...interface{})
- type ArgsNode
- func (n ArgsNode) Copy() Node
- func (n ArgsNode) FindByName(name string) (Node, error)
- func (n ArgsNode) LineNo() int
- func (n ArgsNode) SetType(t types.Type)
- func (n ArgsNode) String() string
- func (n ArgsNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
- func (n ArgsNode) Type() types.Type
- type ArrayNode
- type AssignmentNode
- type Block
- type BlockParam
- type Body
- type BooleanNode
- type BracketAccessNode
- func (n *BracketAccessNode) Copy() Node
- func (n *BracketAccessNode) LineNo() int
- func (n *BracketAccessNode) SetType(t types.Type)
- func (n *BracketAccessNode) String() string
- func (n *BracketAccessNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
- func (n *BracketAccessNode) Type() types.Type
- type BracketAssignmentNode
- func (n *BracketAssignmentNode) Copy() Node
- func (n *BracketAssignmentNode) LineNo() int
- func (n *BracketAssignmentNode) SetType(t types.Type)
- func (n *BracketAssignmentNode) String() string
- func (n *BracketAssignmentNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
- func (n *BracketAssignmentNode) Type() types.Type
- type CVarNode
- type CaseNode
- type Class
- func (cls *Class) AddConstant(constant *Constant)
- func (cls *Class) AddIVar(name string, ivar *IVar) error
- func (cls *Class) AddIVars(args ArgsNode, readable, writeable bool)
- func (cls *Class) AddStatement(stmt Node)
- func (cls *Class) BuildType(outerScope ScopeChain) *types.Class
- func (cls *Class) ConstGet(name string) (Const, error)
- func (cls *Class) Constant()
- func (cls *Class) Copy() Node
- func (cls *Class) GenerateMethod(m *Method, class *types.Class)
- func (cls *Class) Get(name string) (Local, bool)
- func (cls *Class) GetAncestorMethod(methodName string) (*Class, *Method, bool)
- func (cls *Class) IVars(skip map[string]bool) []*IVar
- func (cls *Class) LineNo() int
- func (cls *Class) Methods(skip map[string]bool) []*Method
- func (cls *Class) Name() string
- func (cls *Class) Parent() *Class
- func (cls *Class) QualifiedName() string
- func (cls *Class) Set(string, Local)
- func (cls *Class) SetType(t types.Type)
- func (cls *Class) String() string
- func (cls *Class) TakesConstants() bool
- func (cls *Class) TargetType(scope ScopeChain, class *Class) (types.Type, error)
- func (cls *Class) Type() types.Type
- type Comment
- type Condition
- type Const
- type Constant
- type ConstantNode
- type ConstantScope
- type Float64Node
- type GVarNode
- type HashNode
- type IVar
- type IVarNode
- func (n *IVarNode) Copy() Node
- func (n *IVarNode) IVar() *IVar
- func (n *IVarNode) LineNo() int
- func (n *IVarNode) NormalizedVal() string
- func (n *IVarNode) SetType(t types.Type)
- func (n *IVarNode) String() string
- func (n *IVarNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
- func (n *IVarNode) Type() types.Type
- type IdentNode
- type InfixExpressionNode
- func (n *InfixExpressionNode) Copy() Node
- func (n *InfixExpressionNode) HasMethod() bool
- func (n *InfixExpressionNode) LineNo() int
- func (n *InfixExpressionNode) SetType(t types.Type)
- func (n *InfixExpressionNode) String() string
- func (n *InfixExpressionNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
- func (n *InfixExpressionNode) Type() types.Type
- type IntNode
- type KernelNode
- type KeyValuePair
- type LexState
- type Lexer
- func (l *Lexer) Advance() (rune, rune, error)
- func (l *Lexer) AtExprStart() bool
- func (l *Lexer) Emit(t int)
- func (l *Lexer) Error(e string)
- func (l *Lexer) Lex(lval *yySymType) int
- func (l *Lexer) Peek() (rune, error)
- func (l *Lexer) Read() (rune, error)
- func (l *Lexer) ResetBuffer()
- func (l *Lexer) RewindBuffer()
- func (l *Lexer) Tokenize()
- type Local
- type Method
- func (m *Method) AddParam(p *Param) error
- func (m *Method) Analyze(ms *MethodSet) error
- func (method *Method) AnalyzeArguments(class *Class, c *MethodCall) error
- func (n *Method) Copy() Node
- func (m *Method) GoName() string
- func (n *Method) LineNo() int
- func (m *Method) ReturnType() types.Type
- func (n *Method) SetType(t types.Type)
- func (n *Method) String() string
- func (n *Method) TargetType(locals ScopeChain, class *Class) (types.Type, error)
- func (n *Method) Type() types.Type
- type MethodCall
- func (n *MethodCall) Copy() Node
- func (n *MethodCall) LineNo() int
- func (c *MethodCall) PositionalArgs() ArgsNode
- func (c *MethodCall) ReceiverType(scope ScopeChain, class *Class) types.Type
- func (n *MethodCall) RequiresTransform() bool
- func (c *MethodCall) SetBlock(blk *Block)
- func (n *MethodCall) SetType(t types.Type)
- func (n *MethodCall) String() string
- func (c *MethodCall) TargetType(scope ScopeChain, class *Class) (types.Type, error)
- func (n *MethodCall) Type() types.Type
- type MethodSet
- type Module
- func (mod *Module) AddConstant(constant *Constant)
- func (mod *Module) ConstGet(name string) (Const, error)
- func (mod *Module) Constant()
- func (mod *Module) Copy() Node
- func (mod *Module) Get(name string) (Local, bool)
- func (mod *Module) LineNo() int
- func (mod *Module) Name() string
- func (mod *Module) QualifiedName() string
- func (mod *Module) Set(string, Local)
- func (mod *Module) SetType(t types.Type)
- func (mod *Module) String() string
- func (mod *Module) TakesConstants() bool
- func (mod *Module) TargetType(scope ScopeChain, class *Class) (types.Type, error)
- func (mod *Module) Type() types.Type
- type Namespace
- type NilNode
- type Node
- type NoopNode
- type NotExpressionNode
- func (n *NotExpressionNode) Copy() Node
- func (n *NotExpressionNode) LineNo() int
- func (n *NotExpressionNode) SetType(t types.Type)
- func (n *NotExpressionNode) String() string
- func (n *NotExpressionNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
- func (n *NotExpressionNode) Type() types.Type
- type Param
- type ParamKind
- type ParamList
- type ParseError
- type RangeNode
- type ReturnNode
- type Root
- func (r *Root) AddCall(c *MethodCall)
- func (r *Root) AddComment(c Comment)
- func (r *Root) AddError(err error)
- func (r *Root) AddMethod(m *Method)
- func (r *Root) AddReturn(n *ReturnNode)
- func (r *Root) AddStatement(n Node)
- func (r *Root) Analyze() error
- func (r *Root) AnalyzeMethodSet(ms *MethodSet, rcvr types.Type) error
- func (r *Root) GetMethod(name string) (*Method, bool)
- func (r *Root) ParseError() error
- func (r *Root) PopClass() *Class
- func (r *Root) PopModule() *Module
- func (r *Root) PushClass(name string, lineNo int)
- func (r *Root) PushModule(name string, lineNo int)
- func (n *Root) String() string
- type RubyLocal
- type Scope
- type ScopeAccessNode
- func (n *ScopeAccessNode) Copy() Node
- func (n *ScopeAccessNode) LineNo() int
- func (n *ScopeAccessNode) Lookup(scope ScopeChain, outer, inner string) (Const, error)
- func (n *ScopeAccessNode) ReceiverName() string
- func (n *ScopeAccessNode) SetType(t types.Type)
- func (n *ScopeAccessNode) String() string
- func (n *ScopeAccessNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
- func (n *ScopeAccessNode) Type() types.Type
- func (n *ScopeAccessNode) Walk(scope ScopeChain) (Const, error)
- type ScopeChain
- func (chain ScopeChain) Current() Scope
- func (chain ScopeChain) Extend(scope Scope) ScopeChain
- func (chain ScopeChain) Get(name string) (Local, bool)
- func (chain ScopeChain) MustGet(name string) Local
- func (chain ScopeChain) Name() string
- func (chain ScopeChain) Prefix() string
- func (chain ScopeChain) ResolveVar(s string) Local
- func (chain ScopeChain) Set(name string, local Local)
- type SelfNode
- type SimpleScope
- type Stack
- type StackState
- type State
- type Statements
- type StringKind
- type StringNode
- func (n *StringNode) Copy() Node
- func (n *StringNode) FmtString(delim string) string
- func (n *StringNode) GoString() string
- func (n *StringNode) LineNo() int
- func (n *StringNode) OrderedInterps() []Node
- func (n *StringNode) SetType(t types.Type)
- func (n *StringNode) String() string
- func (n *StringNode) TargetType(scope ScopeChain, class *Class) (types.Type, error)
- func (n *StringNode) TranslateEscapes(segment string) (string, error)
- func (n *StringNode) Type() types.Type
- type SuperNode
- func (n *SuperNode) Copy() Node
- func (n *SuperNode) Inline() Statements
- func (n *SuperNode) LineNo() int
- func (n *SuperNode) SetType(t types.Type)
- func (n *SuperNode) String() string
- func (n *SuperNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
- func (n *SuperNode) Type() types.Type
- type SymbolNode
- type Token
- type WhenNode
- type WhileNode
Constants ¶
View Source
const ADDASSIGN = 57350
View Source
const ALIAS = 57419
View Source
const AND = 57370
View Source
const ASSIGN = 57347
View Source
const ASTERISK = 57377
View Source
const BANG = 57382
View Source
const BEGIN = 57398
View Source
const BREAK = 57416
View Source
const CARET = 57372
View Source
const CASE = 57411
View Source
const CLASS = 57390
View Source
const COLON = 57356
View Source
const COMMA = 57437
View Source
const COMMENT = 57430
View Source
const CONSTANT = 57408
View Source
const CVAR = 57426
View Source
const DEF = 57392
View Source
const DIVASSIGN = 57352
View Source
const DO = 57420
View Source
const DOT = 57432
View Source
const DOT2 = 57357
View Source
const DOT3 = 57358
View Source
const DO_BLOCK = 57422
View Source
const DO_COND = 57421
View Source
const ELSE = 57402
View Source
const ELSIF = 57410
View Source
const END = 57393
View Source
const ENSURE = 57409
View Source
const EQ = 57362
View Source
const FALSE = 57389
View Source
const FLOAT = 57387
View Source
const FOR = 57415
View Source
const GT = 57366
View Source
const GTE = 57367
View Source
const GVAR = 57427
View Source
const HASHROCKET = 57459
View Source
const IDENT = 57429
View Source
const IF = 57394
View Source
const IF_MOD = 57395
View Source
const INT = 57386
View Source
const INTERPBEG = 57440
View Source
const INTERPEND = 57441
View Source
const IVAR = 57425
View Source
const LABEL = 57431
View Source
const LBRACE = 57433
View Source
const LBRACEBLOCK = 57434
View Source
const LBRACKET = 57453
View Source
const LBRACKETSTART = 57454
View Source
const LOGICALAND = 57360
View Source
const LOGICALOR = 57359
View Source
const LOWEST = 57346
View Source
const LPAREN = 57456
View Source
const LPARENSTART = 57457
View Source
const LSHIFT = 57373
View Source
const LSHIFTASSIGN = 57353
View Source
const LT = 57368
View Source
const LTE = 57369
View Source
const MATCH = 57364
View Source
const METHODIDENT = 57428
View Source
const MINUS = 57376
View Source
const MODASSIGN = 57348
View Source
const MODULE = 57391
View Source
const MODULO = 57379
View Source
const MULASSIGN = 57349
View Source
const (
Main = "__main__"
)
View Source
const NEQ = 57363
View Source
const NEWLINE = 57436
View Source
const NEXT = 57417
View Source
const NIL = 57383
View Source
const NOTMATCH = 57365
View Source
const PIPE = 57371
View Source
const PLUS = 57375
View Source
const POW = 57381
View Source
const PRIVATE = 57423
View Source
const PROTECTED = 57424
View Source
const QMARK = 57355
View Source
const RAWSTRINGBEG = 57446
View Source
const RAWSTRINGEND = 57447
View Source
const RAWWORDSBEG = 57449
View Source
const RAWXSTRINGBEG = 57451
View Source
const RBRACE = 57435
View Source
const RBRACKET = 57455
View Source
const REGEXBEG = 57443
View Source
const REGEXEND = 57444
View Source
const REGEXPOPT = 57445
View Source
const RESCUE = 57399
View Source
const RESCUE_MOD = 57400
View Source
const RETURN = 57405
View Source
const RPAREN = 57458
View Source
const RSHIFT = 57374
View Source
const RSHIFTASSIGN = 57354
View Source
const SCOPE = 57460
View Source
const SELF = 57407
View Source
const SEMICOLON = 57452
View Source
const SLASH = 57378
View Source
const SPACESHIP = 57361
View Source
const STRING = 57385
View Source
const STRINGBEG = 57438
View Source
const STRINGBODY = 57442
View Source
const STRINGEND = 57439
View Source
const SUBASSIGN = 57351
View Source
const SUPER = 57418
View Source
const SYMBOL = 57384
View Source
const THEN = 57401
View Source
const TRUE = 57388
View Source
const UNARY_NUM = 57380
View Source
const UNLESS = 57396
View Source
const UNLESS_MOD = 57397
View Source
const UNTIL = 57413
View Source
const UNTIL_MOD = 57414
View Source
const WHEN = 57412
View Source
const WHILE = 57403
View Source
const WHILE_MOD = 57404
View Source
const WORDSBEG = 57448
View Source
const XSTRINGBEG = 57450
View Source
const YIELD = 57406
Variables ¶
View Source
var BadLocal = new(local)
View Source
var Illegal int = 99999999
Functions ¶
func DebugLevel ¶
func DebugLevel() int
Types ¶
type ArrayNode ¶
type ArrayNode struct { Args ArgsNode // contains filtered or unexported fields }
func (*ArrayNode) TargetType ¶
type AssignmentNode ¶
type AssignmentNode struct { Left []Node Right []Node Reassignment bool OpAssignment bool SetterCall bool // contains filtered or unexported fields }
func (*AssignmentNode) Copy ¶
func (n *AssignmentNode) Copy() Node
func (*AssignmentNode) LineNo ¶
func (n *AssignmentNode) LineNo() int
func (*AssignmentNode) SetType ¶
func (n *AssignmentNode) SetType(t types.Type)
func (*AssignmentNode) String ¶
func (n *AssignmentNode) String() string
func (*AssignmentNode) TargetType ¶
func (n *AssignmentNode) TargetType(scope ScopeChain, class *Class) (types.Type, error)
func (*AssignmentNode) Type ¶
func (n *AssignmentNode) Type() types.Type
type Body ¶
type Body struct { Statements Statements ReturnType types.Type ExplicitReturns []*ReturnNode }
func (*Body) InferReturnType ¶
func (b *Body) InferReturnType(scope ScopeChain, class *Class) error
type BooleanNode ¶
type BooleanNode struct { Val string // contains filtered or unexported fields }
func (*BooleanNode) Copy ¶
func (n *BooleanNode) Copy() Node
basic literals should never needed to be mutated by a client that's copied a subtree, so these methods are here to satisfy the interface only.
func (*BooleanNode) LineNo ¶
func (n *BooleanNode) LineNo() int
func (*BooleanNode) SetType ¶
func (n *BooleanNode) SetType(t types.Type)
func (*BooleanNode) String ¶
func (n *BooleanNode) String() string
func (*BooleanNode) TargetType ¶
func (n *BooleanNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
func (*BooleanNode) Type ¶
func (n *BooleanNode) Type() types.Type
type BracketAccessNode ¶
type BracketAccessNode struct { Composite Node Args ArgsNode // contains filtered or unexported fields }
func (*BracketAccessNode) Copy ¶
func (n *BracketAccessNode) Copy() Node
func (*BracketAccessNode) LineNo ¶
func (n *BracketAccessNode) LineNo() int
func (*BracketAccessNode) SetType ¶
func (n *BracketAccessNode) SetType(t types.Type)
func (*BracketAccessNode) String ¶
func (n *BracketAccessNode) String() string
func (*BracketAccessNode) TargetType ¶
func (n *BracketAccessNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
func (*BracketAccessNode) Type ¶
func (n *BracketAccessNode) Type() types.Type
type BracketAssignmentNode ¶
type BracketAssignmentNode struct { Composite Node Args ArgsNode // contains filtered or unexported fields }
func (*BracketAssignmentNode) Copy ¶
func (n *BracketAssignmentNode) Copy() Node
func (*BracketAssignmentNode) LineNo ¶
func (n *BracketAssignmentNode) LineNo() int
func (*BracketAssignmentNode) SetType ¶
func (n *BracketAssignmentNode) SetType(t types.Type)
func (*BracketAssignmentNode) String ¶
func (n *BracketAssignmentNode) String() string
func (*BracketAssignmentNode) TargetType ¶
func (n *BracketAssignmentNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
func (*BracketAssignmentNode) Type ¶
func (n *BracketAssignmentNode) Type() types.Type
type CVarNode ¶
type CVarNode struct { Val string // contains filtered or unexported fields }
func (*CVarNode) TargetType ¶
type CaseNode ¶
type CaseNode struct { Value Node Whens []*WhenNode RequiresExpansion bool // contains filtered or unexported fields }
func (*CaseNode) TargetType ¶
type Class ¶
type Class struct { Superclass string Statements Statements MethodSet *MethodSet Body Body Constants []*Constant Module *Module Private bool // contains filtered or unexported fields }
func (*Class) AddConstant ¶
func (*Class) AddStatement ¶
func (*Class) GetAncestorMethod ¶
func (*Class) QualifiedName ¶
func (*Class) TakesConstants ¶
func (*Class) TargetType ¶
type Condition ¶
type Condition struct { Condition Node True Statements False Node // contains filtered or unexported fields }
func (*Condition) TargetType ¶
type Constant ¶
func (*Constant) QualifiedName ¶
type ConstantNode ¶
func (*ConstantNode) Copy ¶
func (n *ConstantNode) Copy() Node
func (*ConstantNode) LineNo ¶
func (n *ConstantNode) LineNo() int
func (*ConstantNode) SetType ¶
func (n *ConstantNode) SetType(t types.Type)
func (*ConstantNode) String ¶
func (n *ConstantNode) String() string
func (*ConstantNode) TargetType ¶
func (n *ConstantNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
func (*ConstantNode) Type ¶
func (n *ConstantNode) Type() types.Type
type ConstantScope ¶
type Float64Node ¶
type Float64Node struct { Val string // contains filtered or unexported fields }
func (*Float64Node) Copy ¶
func (n *Float64Node) Copy() Node
func (*Float64Node) LineNo ¶
func (n *Float64Node) LineNo() int
func (Float64Node) SetType ¶
func (n Float64Node) SetType(t types.Type)
func (Float64Node) String ¶
func (n Float64Node) String() string
func (Float64Node) TargetType ¶
func (n Float64Node) TargetType(locals ScopeChain, class *Class) (types.Type, error)
func (Float64Node) Type ¶
func (n Float64Node) Type() types.Type
type GVarNode ¶
type GVarNode struct { Val string // contains filtered or unexported fields }
func (*GVarNode) TargetType ¶
type HashNode ¶
type HashNode struct { Pairs []*KeyValuePair // contains filtered or unexported fields }
func (*HashNode) TargetType ¶
type IdentNode ¶
type IdentNode struct { Val string MethodCall *MethodCall // contains filtered or unexported fields }
func (*IdentNode) TargetType ¶
type InfixExpressionNode ¶
type InfixExpressionNode struct { Operator string Left Node Right Node // contains filtered or unexported fields }
func (*InfixExpressionNode) Copy ¶
func (n *InfixExpressionNode) Copy() Node
func (*InfixExpressionNode) HasMethod ¶
func (n *InfixExpressionNode) HasMethod() bool
func (*InfixExpressionNode) LineNo ¶
func (n *InfixExpressionNode) LineNo() int
func (*InfixExpressionNode) SetType ¶
func (n *InfixExpressionNode) SetType(t types.Type)
func (*InfixExpressionNode) String ¶
func (n *InfixExpressionNode) String() string
func (*InfixExpressionNode) TargetType ¶
func (n *InfixExpressionNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
func (*InfixExpressionNode) Type ¶
func (n *InfixExpressionNode) Type() types.Type
type IntNode ¶
type IntNode struct { Val string // contains filtered or unexported fields }
func (*IntNode) TargetType ¶
type KernelNode ¶
type KernelNode struct{}
Placeholder in AST for Kernel method lookups
func (*KernelNode) Copy ¶
func (n *KernelNode) Copy() Node
func (*KernelNode) LineNo ¶
func (n *KernelNode) LineNo() int
func (*KernelNode) SetType ¶
func (n *KernelNode) SetType(t types.Type)
func (*KernelNode) String ¶
func (n *KernelNode) String() string
func (*KernelNode) TargetType ¶
func (n *KernelNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
func (*KernelNode) Type ¶
func (n *KernelNode) Type() types.Type
type KeyValuePair ¶
type KeyValuePair struct { Key Node Label string Value Node // contains filtered or unexported fields }
func (KeyValuePair) Copy ¶
func (n KeyValuePair) Copy() Node
func (*KeyValuePair) LineNo ¶
func (n *KeyValuePair) LineNo() int
func (*KeyValuePair) SetType ¶
func (n *KeyValuePair) SetType(t types.Type)
func (*KeyValuePair) String ¶
func (n *KeyValuePair) String() string
func (*KeyValuePair) TargetType ¶
func (n *KeyValuePair) TargetType(locals ScopeChain, class *Class) (types.Type, error)
func (*KeyValuePair) Type ¶
func (n *KeyValuePair) Type() types.Type
type Lexer ¶
type Lexer struct { *bytes.Buffer Root *Root State *Stack[LexState] StringDelim *Stack[rune] // contains filtered or unexported fields }
func (*Lexer) AtExprStart ¶
func (*Lexer) ResetBuffer ¶
func (l *Lexer) ResetBuffer()
func (*Lexer) RewindBuffer ¶
func (l *Lexer) RewindBuffer()
type Method ¶
type Method struct { Receiver Node Name string Body *Body *ParamList Locals *SimpleScope Scope ScopeChain Root *Root Block *BlockParam Private bool // contains filtered or unexported fields }
func (*Method) AnalyzeArguments ¶
func (method *Method) AnalyzeArguments(class *Class, c *MethodCall) error
func (*Method) ReturnType ¶
func (*Method) TargetType ¶
type MethodCall ¶
type MethodCall struct { Receiver Node Method *Method MethodName string Args ArgsNode Block *Block RawBlock string Getter bool // contains filtered or unexported fields }
func (*MethodCall) Copy ¶
func (n *MethodCall) Copy() Node
func (*MethodCall) LineNo ¶
func (n *MethodCall) LineNo() int
func (*MethodCall) PositionalArgs ¶
func (c *MethodCall) PositionalArgs() ArgsNode
func (*MethodCall) ReceiverType ¶
func (c *MethodCall) ReceiverType(scope ScopeChain, class *Class) types.Type
func (*MethodCall) RequiresTransform ¶
func (n *MethodCall) RequiresTransform() bool
func (*MethodCall) SetBlock ¶
func (c *MethodCall) SetBlock(blk *Block)
func (*MethodCall) SetType ¶
func (n *MethodCall) SetType(t types.Type)
func (*MethodCall) String ¶
func (n *MethodCall) String() string
func (*MethodCall) TargetType ¶
func (c *MethodCall) TargetType(scope ScopeChain, class *Class) (types.Type, error)
func (*MethodCall) Type ¶
func (n *MethodCall) Type() types.Type
type MethodSet ¶
type MethodSet struct { Methods map[string]*Method Order []string Calls map[string][]*MethodCall Class *Class Module *Module }
func NewMethodSet ¶
func NewMethodSet() *MethodSet
func (*MethodSet) AddCall ¶
func (ms *MethodSet) AddCall(c *MethodCall)
type Module ¶
type Module struct { Statements Statements MethodSet *MethodSet Parent *Module Constants []*Constant Modules []*Module Classes []*Class // contains filtered or unexported fields }
func (*Module) AddConstant ¶
func (*Module) QualifiedName ¶
func (*Module) TakesConstants ¶
func (*Module) TargetType ¶
type NilNode ¶
type NilNode struct {
// contains filtered or unexported fields
}
func (*NilNode) TargetType ¶
type NoopNode ¶
type NoopNode struct {
// contains filtered or unexported fields
}
func (*NoopNode) TargetType ¶
type NotExpressionNode ¶
type NotExpressionNode struct { Arg Node // contains filtered or unexported fields }
func (*NotExpressionNode) Copy ¶
func (n *NotExpressionNode) Copy() Node
func (*NotExpressionNode) LineNo ¶
func (n *NotExpressionNode) LineNo() int
func (*NotExpressionNode) SetType ¶
func (n *NotExpressionNode) SetType(t types.Type)
func (*NotExpressionNode) String ¶
func (n *NotExpressionNode) String() string
func (*NotExpressionNode) TargetType ¶
func (n *NotExpressionNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
func (*NotExpressionNode) Type ¶
func (n *NotExpressionNode) Type() types.Type
type Param ¶
type ParamList ¶
func NewParamList ¶
func NewParamList() *ParamList
func (*ParamList) GetParamByName ¶
func (*ParamList) PositionalParams ¶
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
func NewParseError ¶
func NewParseError(node Node, fmtString string, args ...interface{}) *ParseError
func (*ParseError) Error ¶
func (p *ParseError) Error() string
func (*ParseError) Terminal ¶
func (p *ParseError) Terminal() *ParseError
type RangeNode ¶
type RangeNode struct {
Lower, Upper Node
Inclusive bool
// contains filtered or unexported fields
}
func (*RangeNode) TargetType ¶
type ReturnNode ¶
type ReturnNode struct { Val ArgsNode // contains filtered or unexported fields }
func (*ReturnNode) Copy ¶
func (n *ReturnNode) Copy() Node
func (*ReturnNode) LineNo ¶
func (n *ReturnNode) LineNo() int
func (*ReturnNode) SetType ¶
func (n *ReturnNode) SetType(t types.Type)
func (*ReturnNode) String ¶
func (n *ReturnNode) String() string
func (*ReturnNode) TargetType ¶
func (n *ReturnNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
func (*ReturnNode) Type ¶
func (n *ReturnNode) Type() types.Type
type Root ¶
type Root struct { State *Stack[State] ScopeChain ScopeChain Objects []Node Statements []Node Classes []*Class MethodSetStack *Stack[*MethodSet] Errors []error ExplicitReturns []*ReturnNode StringStack *Stack[*StringNode] Comments map[int]Comment TopLevelModules []*Module // contains filtered or unexported fields }
func ParseBytes ¶
func ParseString ¶
func (*Root) AddCall ¶
func (r *Root) AddCall(c *MethodCall)
func (*Root) AddComment ¶
func (*Root) AddReturn ¶
func (r *Root) AddReturn(n *ReturnNode)
func (*Root) AddStatement ¶
func (*Root) AnalyzeMethodSet ¶
func (*Root) ParseError ¶
func (*Root) PushModule ¶
type RubyLocal ¶
type RubyLocal struct { Calls []*MethodCall // contains filtered or unexported fields }
func (*RubyLocal) AddCall ¶
func (rl *RubyLocal) AddCall(c *MethodCall)
type ScopeAccessNode ¶
type ScopeAccessNode struct { Receiver Node Constant string // contains filtered or unexported fields }
func (*ScopeAccessNode) Copy ¶
func (n *ScopeAccessNode) Copy() Node
func (*ScopeAccessNode) LineNo ¶
func (n *ScopeAccessNode) LineNo() int
func (*ScopeAccessNode) Lookup ¶
func (n *ScopeAccessNode) Lookup(scope ScopeChain, outer, inner string) (Const, error)
func (*ScopeAccessNode) ReceiverName ¶
func (n *ScopeAccessNode) ReceiverName() string
func (*ScopeAccessNode) SetType ¶
func (n *ScopeAccessNode) SetType(t types.Type)
func (*ScopeAccessNode) String ¶
func (n *ScopeAccessNode) String() string
func (*ScopeAccessNode) TargetType ¶
func (n *ScopeAccessNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
func (*ScopeAccessNode) Type ¶
func (n *ScopeAccessNode) Type() types.Type
func (*ScopeAccessNode) Walk ¶
func (n *ScopeAccessNode) Walk(scope ScopeChain) (Const, error)
type ScopeChain ¶
type ScopeChain []Scope
func NewScopeChain ¶
func NewScopeChain() ScopeChain
func (ScopeChain) Current ¶
func (chain ScopeChain) Current() Scope
func (ScopeChain) Extend ¶
func (chain ScopeChain) Extend(scope Scope) ScopeChain
func (ScopeChain) MustGet ¶
func (chain ScopeChain) MustGet(name string) Local
func (ScopeChain) Name ¶
func (chain ScopeChain) Name() string
func (ScopeChain) Prefix ¶
func (chain ScopeChain) Prefix() string
func (ScopeChain) ResolveVar ¶
func (chain ScopeChain) ResolveVar(s string) Local
func (ScopeChain) Set ¶
func (chain ScopeChain) Set(name string, local Local)
type SelfNode ¶
type SelfNode struct {
// contains filtered or unexported fields
}
func (*SelfNode) TargetType ¶
type SimpleScope ¶
type SimpleScope struct {
// contains filtered or unexported fields
}
func NewScope ¶
func NewScope(name string) *SimpleScope
func (*SimpleScope) Name ¶
func (scope *SimpleScope) Name() string
func (*SimpleScope) Set ¶
func (scope *SimpleScope) Set(name string, local Local)
func (*SimpleScope) TakesConstants ¶
func (scope *SimpleScope) TakesConstants() bool
type StackState ¶
type StackState struct {
// contains filtered or unexported fields
}
func NewStackState ¶
func NewStackState(name string) *StackState
func (*StackState) Clear ¶
func (s *StackState) Clear() int
func (*StackState) IsActive ¶
func (s *StackState) IsActive() bool
func (*StackState) IsEmpty ¶
func (s *StackState) IsEmpty() bool
func (*StackState) Lexpop ¶
func (s *StackState) Lexpop() bool
func (*StackState) Pop ¶
func (s *StackState) Pop() bool
func (*StackState) Push ¶
func (s *StackState) Push(bit bool) bool
type Statements ¶
type Statements []Node
func (Statements) Copy ¶
func (stmts Statements) Copy() Node
func (Statements) LineNo ¶
func (stmts Statements) LineNo() int
func (Statements) SetType ¶
func (stmts Statements) SetType(t types.Type)
func (Statements) String ¶
func (stmts Statements) String() string
func (Statements) TargetType ¶
func (stmts Statements) TargetType(scope ScopeChain, class *Class) (types.Type, error)
func (Statements) Type ¶
func (stmts Statements) Type() types.Type
type StringKind ¶
type StringKind int
const ( DoubleQuote StringKind = iota SingleQuote Regexp Words RawWords Exec RawExec )
type StringNode ¶
type StringNode struct { BodySegments []string Interps map[int][]Node Kind StringKind // contains filtered or unexported fields }
func (*StringNode) Copy ¶
func (n *StringNode) Copy() Node
func (*StringNode) FmtString ¶
func (n *StringNode) FmtString(delim string) string
func (*StringNode) GoString ¶
func (n *StringNode) GoString() string
func (*StringNode) LineNo ¶
func (n *StringNode) LineNo() int
func (*StringNode) OrderedInterps ¶
func (n *StringNode) OrderedInterps() []Node
func (*StringNode) SetType ¶
func (n *StringNode) SetType(t types.Type)
func (*StringNode) String ¶
func (n *StringNode) String() string
func (*StringNode) TargetType ¶
func (n *StringNode) TargetType(scope ScopeChain, class *Class) (types.Type, error)
func (*StringNode) TranslateEscapes ¶
func (n *StringNode) TranslateEscapes(segment string) (string, error)
func (*StringNode) Type ¶
func (n *StringNode) Type() types.Type
type SuperNode ¶
type SuperNode struct { Args ArgsNode Method *Method Class *Class // contains filtered or unexported fields }
func (*SuperNode) Inline ¶
func (n *SuperNode) Inline() Statements
func (*SuperNode) TargetType ¶
type SymbolNode ¶
type SymbolNode struct { Val string // contains filtered or unexported fields }
func (*SymbolNode) Copy ¶
func (n *SymbolNode) Copy() Node
func (*SymbolNode) LineNo ¶
func (n *SymbolNode) LineNo() int
func (*SymbolNode) SetType ¶
func (n *SymbolNode) SetType(t types.Type)
func (*SymbolNode) String ¶
func (n *SymbolNode) String() string
func (*SymbolNode) TargetType ¶
func (n *SymbolNode) TargetType(locals ScopeChain, class *Class) (types.Type, error)
func (*SymbolNode) Type ¶
func (n *SymbolNode) Type() types.Type
type WhenNode ¶
type WhenNode struct { Conditions ArgsNode Statements Statements // contains filtered or unexported fields }
func (*WhenNode) TargetType ¶
type WhileNode ¶
type WhileNode struct { Condition Node Body Statements // contains filtered or unexported fields }
func (*WhileNode) TargetType ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.