Documentation ¶
Index ¶
- type AnnotationStmt
- type ArrayLiteral
- type AssignExpression
- type BlockStatement
- type Boolean
- type BreakExpression
- type CallExpression
- type CaseElseExpr
- type CaseExpr
- type CaseMatchExpr
- type CatchAllStmt
- type CatchStmt
- type ClassIndexerExpression
- type ClassLiteral
- type ClassStatement
- func (c *ClassStatement) Docs() string
- func (c *ClassStatement) End() token.Position
- func (c *ClassStatement) Pos() token.Position
- func (c *ClassStatement) SrcEnd() token.Position
- func (c *ClassStatement) SrcStart() token.Position
- func (c *ClassStatement) String() string
- func (c *ClassStatement) TokenLiteral() string
- type Comment
- type CommentGroup
- type ContinueExpression
- type DeferStmt
- type DoLoop
- type EnumLiteral
- type EnumStatement
- func (e *EnumStatement) Docs() string
- func (e *EnumStatement) End() token.Position
- func (e *EnumStatement) Pos() token.Position
- func (e *EnumStatement) SrcEnd() token.Position
- func (e *EnumStatement) SrcStart() token.Position
- func (e *EnumStatement) String() string
- func (e *EnumStatement) TokenLiteral() string
- type Expression
- type ExpressionStatement
- type FloatLiteral
- type ForEachArrayLoop
- type ForEachDotRange
- type ForEachMapLoop
- type ForEverLoop
- type ForLoop
- type FunctionLiteral
- type FunctionStatement
- func (f *FunctionStatement) Docs() string
- func (f *FunctionStatement) End() token.Position
- func (f *FunctionStatement) Pos() token.Position
- func (f *FunctionStatement) SrcEnd() token.Position
- func (f *FunctionStatement) SrcStart() token.Position
- func (f *FunctionStatement) String() string
- func (f *FunctionStatement) TokenLiteral() string
- type GetterStmt
- type GrepExpr
- type HashComprehension
- type HashLiteral
- type HashMapComprehension
- type HashRangeComprehension
- type Identifier
- type IfConditionExpr
- type IfExpression
- type IncludeStatement
- type IndexExpression
- type InfixExpression
- type IntegerLiteral
- type InterpolatedString
- type LetStatement
- func (ls *LetStatement) Docs() string
- func (ls *LetStatement) End() token.Position
- func (ls *LetStatement) Pos() token.Position
- func (ls *LetStatement) SrcEnd() token.Position
- func (ls *LetStatement) SrcStart() token.Position
- func (ls *LetStatement) String() string
- func (ls *LetStatement) TokenLiteral() string
- type ListComprehension
- type ListMapComprehension
- type ListRangeComprehension
- type MapExpr
- type MethodCallExpression
- type ModifierLevel
- type NewExpression
- type NilLiteral
- type Node
- type Pipe
- type PostfixExpression
- type PrefixExpression
- type Program
- type PropertyDeclStmt
- func (p *PropertyDeclStmt) Docs() string
- func (p *PropertyDeclStmt) End() token.Position
- func (p *PropertyDeclStmt) Pos() token.Position
- func (p *PropertyDeclStmt) SrcEnd() token.Position
- func (p *PropertyDeclStmt) SrcStart() token.Position
- func (p *PropertyDeclStmt) String() string
- func (p *PropertyDeclStmt) TokenLiteral() string
- type RegExLiteral
- type ReturnStatement
- type SetterStmt
- type SliceExpression
- type Source
- type SpawnStmt
- type Statement
- type StringLiteral
- type StructLiteral
- type TernaryExpression
- type ThrowStmt
- type TryStmt
- type TupleLiteral
- type UIntegerLiteral
- type UnlessExpression
- type UsingStmt
- type WhileLoop
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnnotationStmt ¶
type AnnotationStmt struct { Token token.Token Name *Identifier Attributes map[string]Expression }
/////////////////////////////////////////////////////////
ANNOTATIONS //
/////////////////////////////////////////////////////////
func (*AnnotationStmt) End ¶
func (anno *AnnotationStmt) End() token.Position
func (*AnnotationStmt) Pos ¶
func (anno *AnnotationStmt) Pos() token.Position
func (*AnnotationStmt) String ¶
func (anno *AnnotationStmt) String() string
func (*AnnotationStmt) TokenLiteral ¶
func (anno *AnnotationStmt) TokenLiteral() string
type ArrayLiteral ¶
type ArrayLiteral struct { Token token.Token Members []Expression CreationCount *IntegerLiteral }
/////////////////////////////////////////////////////////
ARRAY LITERAL //
/////////////////////////////////////////////////////////
func (*ArrayLiteral) End ¶
func (a *ArrayLiteral) End() token.Position
func (*ArrayLiteral) Pos ¶
func (a *ArrayLiteral) Pos() token.Position
func (*ArrayLiteral) String ¶
func (a *ArrayLiteral) String() string
func (*ArrayLiteral) TokenLiteral ¶
func (a *ArrayLiteral) TokenLiteral() string
type AssignExpression ¶
type AssignExpression struct { Token token.Token Name Expression Value Expression }
/////////////////////////////////////////////////////////
ASSIGN //
/////////////////////////////////////////////////////////
func (*AssignExpression) End ¶
func (ae *AssignExpression) End() token.Position
func (*AssignExpression) Pos ¶
func (ae *AssignExpression) Pos() token.Position
func (*AssignExpression) String ¶
func (ae *AssignExpression) String() string
func (*AssignExpression) TokenLiteral ¶
func (ae *AssignExpression) TokenLiteral() string
type BlockStatement ¶
func (*BlockStatement) End ¶
func (bs *BlockStatement) End() token.Position
func (*BlockStatement) Pos ¶
func (bs *BlockStatement) Pos() token.Position
func (*BlockStatement) String ¶
func (bs *BlockStatement) String() string
func (*BlockStatement) TokenLiteral ¶
func (bs *BlockStatement) TokenLiteral() string
type Boolean ¶
/////////////////////////////////////////////////////////
BOOLEAN LITERAL //
/////////////////////////////////////////////////////////
func (*Boolean) TokenLiteral ¶
type BreakExpression ¶
/////////////////////////////////////////////////////////
BREAK //
/////////////////////////////////////////////////////////
func (*BreakExpression) End ¶
func (be *BreakExpression) End() token.Position
func (*BreakExpression) Pos ¶
func (be *BreakExpression) Pos() token.Position
func (*BreakExpression) String ¶
func (be *BreakExpression) String() string
func (*BreakExpression) TokenLiteral ¶
func (be *BreakExpression) TokenLiteral() string
type CallExpression ¶
type CallExpression struct { Token token.Token Function Expression Arguments []Expression }
/////////////////////////////////////////////////////////
CALL //
/////////////////////////////////////////////////////////
func (*CallExpression) End ¶
func (ce *CallExpression) End() token.Position
func (*CallExpression) Pos ¶
func (ce *CallExpression) Pos() token.Position
func (*CallExpression) String ¶
func (ce *CallExpression) String() string
func (*CallExpression) TokenLiteral ¶
func (ce *CallExpression) TokenLiteral() string
type CaseElseExpr ¶
type CaseElseExpr struct { Token token.Token Block *BlockStatement }
func (*CaseElseExpr) End ¶
func (ce *CaseElseExpr) End() token.Position
func (*CaseElseExpr) Pos ¶
func (ce *CaseElseExpr) Pos() token.Position
func (*CaseElseExpr) String ¶
func (ce *CaseElseExpr) String() string
func (*CaseElseExpr) TokenLiteral ¶
func (ce *CaseElseExpr) TokenLiteral() string
type CaseExpr ¶
type CaseExpr struct { Token token.Token IsWholeMatch bool Expr Expression Matches []Expression }
/////////////////////////////////////////////////////////
CASE/ESLE //
/////////////////////////////////////////////////////////
func (*CaseExpr) TokenLiteral ¶
type CaseMatchExpr ¶
type CaseMatchExpr struct { Token token.Token Expr Expression Block *BlockStatement }
func (*CaseMatchExpr) End ¶
func (cm *CaseMatchExpr) End() token.Position
func (*CaseMatchExpr) Pos ¶
func (cm *CaseMatchExpr) Pos() token.Position
func (*CaseMatchExpr) String ¶
func (cm *CaseMatchExpr) String() string
func (*CaseMatchExpr) TokenLiteral ¶
func (cm *CaseMatchExpr) TokenLiteral() string
type CatchAllStmt ¶
type CatchAllStmt struct { Token token.Token Block *BlockStatement }
func (*CatchAllStmt) End ¶
func (ca *CatchAllStmt) End() token.Position
func (*CatchAllStmt) Pos ¶
func (ca *CatchAllStmt) Pos() token.Position
func (*CatchAllStmt) String ¶
func (ca *CatchAllStmt) String() string
func (*CatchAllStmt) TokenLiteral ¶
func (ca *CatchAllStmt) TokenLiteral() string
type CatchStmt ¶
type CatchStmt struct { Token token.Token Var string //maybe nil VarType int // 0:STRING, 1:IDENTIFIER Block *BlockStatement }
func (*CatchStmt) TokenLiteral ¶
type ClassIndexerExpression ¶
type ClassIndexerExpression struct { Token token.Token Parameters []Expression //indexer's parameters }
/////////////////////////////////////////////////////////
CLASS/INDEXER //
/////////////////////////////////////////////////////////
func (*ClassIndexerExpression) End ¶
func (ci *ClassIndexerExpression) End() token.Position
func (*ClassIndexerExpression) Pos ¶
func (ci *ClassIndexerExpression) Pos() token.Position
func (*ClassIndexerExpression) String ¶
func (ci *ClassIndexerExpression) String() string
func (*ClassIndexerExpression) TokenLiteral ¶
func (ci *ClassIndexerExpression) TokenLiteral() string
type ClassLiteral ¶
type ClassLiteral struct { Token token.Token Name string Parent string Members []*LetStatement //class's fields Properties map[string]*PropertyDeclStmt //class's properties Methods map[string]*FunctionStatement //class's methods Block *BlockStatement //mainly used for debugging purpose Modifier ModifierLevel //NOT IMPLEMENTED }
/////////////////////////////////////////////////////////
CLASS LITERAL //
///////////////////////////////////////////////////////// class : parentClass { block }
func (*ClassLiteral) End ¶
func (c *ClassLiteral) End() token.Position
func (*ClassLiteral) Pos ¶
func (c *ClassLiteral) Pos() token.Position
func (*ClassLiteral) String ¶
func (c *ClassLiteral) String() string
func (*ClassLiteral) TokenLiteral ¶
func (c *ClassLiteral) TokenLiteral() string
type ClassStatement ¶
type ClassStatement struct { Token token.Token Name *Identifier //Class name CategoryName *Identifier ClassLiteral *ClassLiteral IsAnnotation bool //class is a annotation class //Doc related Doc *CommentGroup // associated documentation; or nil SrcEndToken token.Token }
class classname : parentClass { block } class @classname: parentClass { block } //Annotation /////////////////////////////////////////////////////////
CLASS STATEMENT //
/////////////////////////////////////////////////////////
func (*ClassStatement) Docs ¶
func (c *ClassStatement) Docs() string
func (*ClassStatement) End ¶
func (c *ClassStatement) End() token.Position
func (*ClassStatement) Pos ¶
func (c *ClassStatement) Pos() token.Position
func (*ClassStatement) SrcEnd ¶
func (c *ClassStatement) SrcEnd() token.Position
func (*ClassStatement) SrcStart ¶
func (c *ClassStatement) SrcStart() token.Position
Below two methods implements 'Source' interface.
func (*ClassStatement) String ¶
func (c *ClassStatement) String() string
func (*ClassStatement) TokenLiteral ¶
func (c *ClassStatement) TokenLiteral() string
type CommentGroup ¶
type CommentGroup struct {
List []*Comment // len(List) > 0
}
A CommentGroup represents a sequence of comments with no other tokens and no empty lines between.
func (*CommentGroup) End ¶
func (g *CommentGroup) End() token.Position
func (*CommentGroup) Pos ¶
func (g *CommentGroup) Pos() token.Position
func (*CommentGroup) Text ¶
func (g *CommentGroup) Text() string
Text returns the text of the comment. Comment markers (//, /*, and */), the first space of a line comment, and leading and trailing empty lines are removed. Multiple empty lines are reduced to one, and trailing space on lines is trimmed. Unless the result is empty, it is newline-terminated.
type ContinueExpression ¶
/////////////////////////////////////////////////////////
CONTINUE //
/////////////////////////////////////////////////////////
func (*ContinueExpression) End ¶
func (ce *ContinueExpression) End() token.Position
func (*ContinueExpression) Pos ¶
func (ce *ContinueExpression) Pos() token.Position
func (*ContinueExpression) String ¶
func (ce *ContinueExpression) String() string
func (*ContinueExpression) TokenLiteral ¶
func (ce *ContinueExpression) TokenLiteral() string
type DeferStmt ¶
type DeferStmt struct { Token token.Token Call Expression }
/////////////////////////////////////////////////////////
DEFER STATEMENT //
/////////////////////////////////////////////////////////
func (*DeferStmt) TokenLiteral ¶
type DoLoop ¶
type DoLoop struct { Token token.Token Block *BlockStatement }
/////////////////////////////////////////////////////////
DO LOOP //
/////////////////////////////////////////////////////////
func (*DoLoop) TokenLiteral ¶
type EnumLiteral ¶
type EnumLiteral struct { Token token.Token Pairs map[Expression]Expression RBraceToken token.Token }
/////////////////////////////////////////////////////////
ENUM Literal //
/////////////////////////////////////////////////////////
func (*EnumLiteral) End ¶
func (e *EnumLiteral) End() token.Position
func (*EnumLiteral) Pos ¶
func (e *EnumLiteral) Pos() token.Position
func (*EnumLiteral) String ¶
func (e *EnumLiteral) String() string
func (*EnumLiteral) Text ¶
func (e *EnumLiteral) Text(name string) string
func (*EnumLiteral) TokenLiteral ¶
func (e *EnumLiteral) TokenLiteral() string
type EnumStatement ¶
type EnumStatement struct { Token token.Token Name *Identifier EnumLiteral *EnumLiteral //Doc related Doc *CommentGroup // associated documentation; or nil SrcEndToken token.Token }
/////////////////////////////////////////////////////////
ENUM STATEMENT //
/////////////////////////////////////////////////////////
func (*EnumStatement) Docs ¶
func (e *EnumStatement) Docs() string
func (*EnumStatement) End ¶
func (e *EnumStatement) End() token.Position
func (*EnumStatement) Pos ¶
func (e *EnumStatement) Pos() token.Position
func (*EnumStatement) SrcEnd ¶
func (e *EnumStatement) SrcEnd() token.Position
func (*EnumStatement) SrcStart ¶
func (e *EnumStatement) SrcStart() token.Position
Below two methods implements 'Source' interface.
func (*EnumStatement) String ¶
func (e *EnumStatement) String() string
func (*EnumStatement) TokenLiteral ¶
func (e *EnumStatement) TokenLiteral() string
type Expression ¶
type Expression interface { Node // contains filtered or unexported methods }
type ExpressionStatement ¶
type ExpressionStatement struct { Token token.Token Expression Expression }
/////////////////////////////////////////////////////////
EXPRESSION STATEMENT //
/////////////////////////////////////////////////////////
func (*ExpressionStatement) End ¶
func (es *ExpressionStatement) End() token.Position
func (*ExpressionStatement) Pos ¶
func (es *ExpressionStatement) Pos() token.Position
func (*ExpressionStatement) String ¶
func (es *ExpressionStatement) String() string
func (*ExpressionStatement) TokenLiteral ¶
func (es *ExpressionStatement) TokenLiteral() string
type FloatLiteral ¶
/////////////////////////////////////////////////////////
FLOAT LITERAL //
/////////////////////////////////////////////////////////
func (*FloatLiteral) End ¶
func (fl *FloatLiteral) End() token.Position
func (*FloatLiteral) Pos ¶
func (fl *FloatLiteral) Pos() token.Position
func (*FloatLiteral) String ¶
func (fl *FloatLiteral) String() string
func (*FloatLiteral) TokenLiteral ¶
func (fl *FloatLiteral) TokenLiteral() string
type ForEachArrayLoop ¶
type ForEachArrayLoop struct { Token token.Token Var string Value Expression //value to range over Cond Expression //conditional clause(nil if there is no 'WHERE' clause) Block *BlockStatement }
func (*ForEachArrayLoop) End ¶
func (fal *ForEachArrayLoop) End() token.Position
func (*ForEachArrayLoop) Pos ¶
func (fal *ForEachArrayLoop) Pos() token.Position
func (*ForEachArrayLoop) String ¶
func (fal *ForEachArrayLoop) String() string
func (*ForEachArrayLoop) TokenLiteral ¶
func (fal *ForEachArrayLoop) TokenLiteral() string
type ForEachDotRange ¶
type ForEachDotRange struct { Token token.Token Var string StartIdx Expression EndIdx Expression Cond Expression //conditional clause(nil if there is no 'WHERE' clause) Block *BlockStatement }
for i in start..end <where cond> { }
func (*ForEachDotRange) End ¶
func (fdr *ForEachDotRange) End() token.Position
func (*ForEachDotRange) Pos ¶
func (fdr *ForEachDotRange) Pos() token.Position
func (*ForEachDotRange) String ¶
func (fdr *ForEachDotRange) String() string
func (*ForEachDotRange) TokenLiteral ¶
func (fdr *ForEachDotRange) TokenLiteral() string
type ForEachMapLoop ¶
type ForEachMapLoop struct { Token token.Token Key string Value string X Expression //value to range over Cond Expression //Conditional clause(nil if there is no 'WHERE' clause) Block *BlockStatement }
func (*ForEachMapLoop) End ¶
func (fml *ForEachMapLoop) End() token.Position
func (*ForEachMapLoop) Pos ¶
func (fml *ForEachMapLoop) Pos() token.Position
func (*ForEachMapLoop) String ¶
func (fml *ForEachMapLoop) String() string
func (*ForEachMapLoop) TokenLiteral ¶
func (fml *ForEachMapLoop) TokenLiteral() string
type ForEverLoop ¶
type ForEverLoop struct { Token token.Token Block *BlockStatement }
func (*ForEverLoop) End ¶
func (fel *ForEverLoop) End() token.Position
func (*ForEverLoop) Pos ¶
func (fel *ForEverLoop) Pos() token.Position
func (*ForEverLoop) String ¶
func (fel *ForEverLoop) String() string
func (*ForEverLoop) TokenLiteral ¶
func (fel *ForEverLoop) TokenLiteral() string
type ForLoop ¶
type ForLoop struct { Token token.Token Init Expression Cond Expression Update Expression Block *BlockStatement }
/////////////////////////////////////////////////////////
FOR LOOP //
/////////////////////////////////////////////////////////
func (*ForLoop) TokenLiteral ¶
type FunctionLiteral ¶
type FunctionLiteral struct { Token token.Token Parameters []Expression Body *BlockStatement //Default values Values map[string]Expression Variadic bool StaticFlag bool ModifierLevel ModifierLevel //for 'class' use }
/////////////////////////////////////////////////////////
FUNCTION LITERAL //
/////////////////////////////////////////////////////////
func (*FunctionLiteral) End ¶
func (fl *FunctionLiteral) End() token.Position
func (*FunctionLiteral) Pos ¶
func (fl *FunctionLiteral) Pos() token.Position
func (*FunctionLiteral) String ¶
func (fl *FunctionLiteral) String() string
func (*FunctionLiteral) TokenLiteral ¶
func (fl *FunctionLiteral) TokenLiteral() string
type FunctionStatement ¶
type FunctionStatement struct { Token token.Token Name *Identifier FunctionLiteral *FunctionLiteral Annotations []*AnnotationStmt //Doc related Doc *CommentGroup // associated documentation; or nil SrcEndToken token.Token //used for printing source code }
/////////////////////////////////////////////////////////
FUNCTION STATEMENT //
/////////////////////////////////////////////////////////
func (*FunctionStatement) Docs ¶
func (f *FunctionStatement) Docs() string
func (*FunctionStatement) End ¶
func (f *FunctionStatement) End() token.Position
func (*FunctionStatement) Pos ¶
func (f *FunctionStatement) Pos() token.Position
func (*FunctionStatement) SrcEnd ¶
func (f *FunctionStatement) SrcEnd() token.Position
func (*FunctionStatement) SrcStart ¶
func (f *FunctionStatement) SrcStart() token.Position
Below two methods implements 'Source' interface.
func (*FunctionStatement) String ¶
func (f *FunctionStatement) String() string
func (*FunctionStatement) TokenLiteral ¶
func (f *FunctionStatement) TokenLiteral() string
type GetterStmt ¶
type GetterStmt struct { Token token.Token Body *BlockStatement }
property's getter statement
func (*GetterStmt) End ¶
func (g *GetterStmt) End() token.Position
func (*GetterStmt) Pos ¶
func (g *GetterStmt) Pos() token.Position
func (*GetterStmt) String ¶
func (g *GetterStmt) String() string
func (*GetterStmt) TokenLiteral ¶
func (g *GetterStmt) TokenLiteral() string
type GrepExpr ¶
type GrepExpr struct { Token token.Token Var string //Name is "$_" Value Expression //value to range over Block *BlockStatement //Grep Block, may be nil Expr Expression //Grep Expr, may be nil }
/////////////////////////////////////////////////////////
GREP //
/////////////////////////////////////////////////////////
func (*GrepExpr) TokenLiteral ¶
type HashComprehension ¶
type HashComprehension struct { Token token.Token Var string Value Expression //value(array or string) to range over Cond Expression //conditional clause(nil if there is no 'WHERE' clause) KeyExpr Expression //the result Key expression ValExpr Expression //the result Value expression }
/////////////////////////////////////////////////////////
Hash Comprehension(for array & string) //
///////////////////////////////////////////////////////// { KeyExpr:ValExpr for Var in Value <where Cond> } -->Value could be array or string
func (*HashComprehension) End ¶
func (hc *HashComprehension) End() token.Position
func (*HashComprehension) Pos ¶
func (hc *HashComprehension) Pos() token.Position
func (*HashComprehension) String ¶
func (hc *HashComprehension) String() string
func (*HashComprehension) TokenLiteral ¶
func (hc *HashComprehension) TokenLiteral() string
type HashLiteral ¶
type HashLiteral struct { Token token.Token Order []Expression //For keeping the order of the hash key Pairs map[Expression]Expression RBraceToken token.Token }
/////////////////////////////////////////////////////////
HASH LITERAL //
/////////////////////////////////////////////////////////
func (*HashLiteral) End ¶
func (h *HashLiteral) End() token.Position
func (*HashLiteral) Pos ¶
func (h *HashLiteral) Pos() token.Position
func (*HashLiteral) String ¶
func (h *HashLiteral) String() string
func (*HashLiteral) TokenLiteral ¶
func (h *HashLiteral) TokenLiteral() string
type HashMapComprehension ¶
type HashMapComprehension struct { Token token.Token Key string Value string X Expression //value(hash) to range over Cond Expression //Conditional clause(nil if there is no 'WHERE' clause) KeyExpr Expression //the result Key expression ValExpr Expression //the result Value expression }
/////////////////////////////////////////////////////////
Hash Map Comprehension //
///////////////////////////////////////////////////////// { KeyExpr:ValExpr for Key,Value in X <where Cond> }
func (*HashMapComprehension) End ¶
func (mc *HashMapComprehension) End() token.Position
func (*HashMapComprehension) Pos ¶
func (mc *HashMapComprehension) Pos() token.Position
func (*HashMapComprehension) String ¶
func (mc *HashMapComprehension) String() string
func (*HashMapComprehension) TokenLiteral ¶
func (mc *HashMapComprehension) TokenLiteral() string
type HashRangeComprehension ¶
type HashRangeComprehension struct { Token token.Token Var string StartIdx Expression EndIdx Expression Cond Expression //conditional clause(nil if there is no 'WHERE' clause) KeyExpr Expression //the result Key expression ValExpr Expression //the result Value expression }
/////////////////////////////////////////////////////////
Hash Comprehension(for range) //
///////////////////////////////////////////////////////// { KeyExp:ValExp for Var in StartIdx..EndIdx <where Cond> }
func (*HashRangeComprehension) End ¶
func (hc *HashRangeComprehension) End() token.Position
func (*HashRangeComprehension) Pos ¶
func (hc *HashRangeComprehension) Pos() token.Position
func (*HashRangeComprehension) String ¶
func (hc *HashRangeComprehension) String() string
func (*HashRangeComprehension) TokenLiteral ¶
func (hc *HashRangeComprehension) TokenLiteral() string
type Identifier ¶
/////////////////////////////////////////////////////////
IDENTIFIER //
/////////////////////////////////////////////////////////
func (*Identifier) End ¶
func (i *Identifier) End() token.Position
func (*Identifier) Pos ¶
func (i *Identifier) Pos() token.Position
func (*Identifier) String ¶
func (i *Identifier) String() string
func (*Identifier) TokenLiteral ¶
func (i *Identifier) TokenLiteral() string
type IfConditionExpr ¶
type IfConditionExpr struct { Token token.Token Cond Expression //condition Body Node //body(BlockStatement or single ExpressionStatement) }
if/else-if condition
func (*IfConditionExpr) End ¶
func (ic *IfConditionExpr) End() token.Position
func (*IfConditionExpr) Pos ¶
func (ic *IfConditionExpr) Pos() token.Position
func (*IfConditionExpr) String ¶
func (ic *IfConditionExpr) String() string
func (*IfConditionExpr) TokenLiteral ¶
func (ic *IfConditionExpr) TokenLiteral() string
type IfExpression ¶
type IfExpression struct { Token token.Token Conditions []*IfConditionExpr //if or elseif part Alternative Node //else part(BlockStatement or single ExpressionStatement) }
func (*IfExpression) End ¶
func (ifex *IfExpression) End() token.Position
func (*IfExpression) Pos ¶
func (ifex *IfExpression) Pos() token.Position
func (*IfExpression) String ¶
func (ifex *IfExpression) String() string
func (*IfExpression) TokenLiteral ¶
func (ifex *IfExpression) TokenLiteral() string
type IncludeStatement ¶
type IncludeStatement struct { Token token.Token IncludePath Expression Program *Program }
/////////////////////////////////////////////////////////
INCLUDE STATEMENT //
/////////////////////////////////////////////////////////
func (*IncludeStatement) End ¶
func (is *IncludeStatement) End() token.Position
func (*IncludeStatement) Pos ¶
func (is *IncludeStatement) Pos() token.Position
func (*IncludeStatement) String ¶
func (is *IncludeStatement) String() string
func (*IncludeStatement) TokenLiteral ¶
func (is *IncludeStatement) TokenLiteral() string
type IndexExpression ¶
type IndexExpression struct { Token token.Token Left Expression Index Expression }
func (*IndexExpression) End ¶
func (ie *IndexExpression) End() token.Position
func (*IndexExpression) Pos ¶
func (ie *IndexExpression) Pos() token.Position
func (*IndexExpression) String ¶
func (ie *IndexExpression) String() string
func (*IndexExpression) TokenLiteral ¶
func (ie *IndexExpression) TokenLiteral() string
type InfixExpression ¶
type InfixExpression struct { Token token.Token Operator string Right Expression Left Expression }
/////////////////////////////////////////////////////////
INFIX //
/////////////////////////////////////////////////////////
func (*InfixExpression) End ¶
func (ie *InfixExpression) End() token.Position
func (*InfixExpression) Pos ¶
func (ie *InfixExpression) Pos() token.Position
func (*InfixExpression) String ¶
func (ie *InfixExpression) String() string
func (*InfixExpression) TokenLiteral ¶
func (ie *InfixExpression) TokenLiteral() string
type IntegerLiteral ¶
/////////////////////////////////////////////////////////
INTEGER LITERAL //
/////////////////////////////////////////////////////////
func (*IntegerLiteral) End ¶
func (il *IntegerLiteral) End() token.Position
func (*IntegerLiteral) Pos ¶
func (il *IntegerLiteral) Pos() token.Position
func (*IntegerLiteral) String ¶
func (il *IntegerLiteral) String() string
func (*IntegerLiteral) TokenLiteral ¶
func (il *IntegerLiteral) TokenLiteral() string
type InterpolatedString ¶
type InterpolatedString struct { Token token.Token Value string ExprMap map[byte]Expression }
/////////////////////////////////////////////////////////
INTERPOLATED STRING //
/////////////////////////////////////////////////////////
func (*InterpolatedString) End ¶
func (is *InterpolatedString) End() token.Position
func (*InterpolatedString) Pos ¶
func (is *InterpolatedString) Pos() token.Position
func (*InterpolatedString) String ¶
func (is *InterpolatedString) String() string
func (*InterpolatedString) TokenLiteral ¶
func (is *InterpolatedString) TokenLiteral() string
type LetStatement ¶
type LetStatement struct { Token token.Token Names []*Identifier Values []Expression StaticFlag bool ModifierLevel ModifierLevel //used in 'class' Annotations []*AnnotationStmt //Doc related Doc *CommentGroup // associated documentation; or nil SrcEndToken token.Token //destructuring assigment flag DestructingFlag bool }
/////////////////////////////////////////////////////////
LET STATEMENT //
/////////////////////////////////////////////////////////
func (*LetStatement) Docs ¶
func (ls *LetStatement) Docs() string
func (*LetStatement) End ¶
func (ls *LetStatement) End() token.Position
func (*LetStatement) Pos ¶
func (ls *LetStatement) Pos() token.Position
func (*LetStatement) SrcEnd ¶
func (ls *LetStatement) SrcEnd() token.Position
func (*LetStatement) SrcStart ¶
func (ls *LetStatement) SrcStart() token.Position
Below two methods implements 'Source' interface.
func (*LetStatement) String ¶
func (ls *LetStatement) String() string
func (*LetStatement) TokenLiteral ¶
func (ls *LetStatement) TokenLiteral() string
type ListComprehension ¶
type ListComprehension struct { Token token.Token Var string Value Expression //value(array or string) to range over Cond Expression //conditional clause(nil if there is no 'WHERE' clause) Expr Expression //the result expression }
/////////////////////////////////////////////////////////
List Comprehension(for array & string) //
///////////////////////////////////////////////////////// [ Expr for Var in Value <where Cond> ] ---> Value could be array or string
func (*ListComprehension) End ¶
func (lc *ListComprehension) End() token.Position
func (*ListComprehension) Pos ¶
func (lc *ListComprehension) Pos() token.Position
func (*ListComprehension) String ¶
func (lc *ListComprehension) String() string
func (*ListComprehension) TokenLiteral ¶
func (lc *ListComprehension) TokenLiteral() string
type ListMapComprehension ¶
type ListMapComprehension struct { Token token.Token Key string Value string X Expression //value(hash) to range over Cond Expression //Conditional clause(nil if there is no 'WHERE' clause) Expr Expression //the result expression }
/////////////////////////////////////////////////////////
LIST Map Comprehension //
///////////////////////////////////////////////////////// [ Expr for Key,Value in X <where Cond>]
func (*ListMapComprehension) End ¶
func (mc *ListMapComprehension) End() token.Position
func (*ListMapComprehension) Pos ¶
func (mc *ListMapComprehension) Pos() token.Position
func (*ListMapComprehension) String ¶
func (mc *ListMapComprehension) String() string
func (*ListMapComprehension) TokenLiteral ¶
func (mc *ListMapComprehension) TokenLiteral() string
type ListRangeComprehension ¶
type ListRangeComprehension struct { Token token.Token Var string StartIdx Expression EndIdx Expression Cond Expression //conditional clause(nil if there is no 'WHERE' clause) Expr Expression //the result expression }
/////////////////////////////////////////////////////////
List Comprehension(for range) //
///////////////////////////////////////////////////////// [Expr for Var in StartIdx..EndIdx <where Cond>]
func (*ListRangeComprehension) End ¶
func (lc *ListRangeComprehension) End() token.Position
func (*ListRangeComprehension) Pos ¶
func (lc *ListRangeComprehension) Pos() token.Position
func (*ListRangeComprehension) String ¶
func (lc *ListRangeComprehension) String() string
func (*ListRangeComprehension) TokenLiteral ¶
func (lc *ListRangeComprehension) TokenLiteral() string
type MapExpr ¶
type MapExpr struct { Token token.Token Var string //Name is "$_" Value Expression //value to range over Block *BlockStatement //Grep Block, may be nil Expr Expression //Grep Expr, may be nil }
/////////////////////////////////////////////////////////
MAP //
/////////////////////////////////////////////////////////
func (*MapExpr) TokenLiteral ¶
type MethodCallExpression ¶
type MethodCallExpression struct { Token token.Token Object Expression Call Expression }
/////////////////////////////////////////////////////////
METHOD CALL //
/////////////////////////////////////////////////////////
func (*MethodCallExpression) End ¶
func (mc *MethodCallExpression) End() token.Position
func (*MethodCallExpression) Pos ¶
func (mc *MethodCallExpression) Pos() token.Position
func (*MethodCallExpression) String ¶
func (mc *MethodCallExpression) String() string
func (*MethodCallExpression) TokenLiteral ¶
func (mc *MethodCallExpression) TokenLiteral() string
type ModifierLevel ¶
type ModifierLevel int
class's method modifier
const ( ModifierDefault ModifierLevel = iota ModifierPrivate ModifierProtected ModifierPublic )
type NewExpression ¶
type NewExpression struct { Token token.Token Class Expression Arguments []Expression }
func (*NewExpression) End ¶
func (c *NewExpression) End() token.Position
func (*NewExpression) Pos ¶
func (c *NewExpression) Pos() token.Position
func (*NewExpression) String ¶
func (n *NewExpression) String() string
func (*NewExpression) TokenLiteral ¶
func (n *NewExpression) TokenLiteral() string
type NilLiteral ¶
/////////////////////////////////////////////////////////
NIL LITERAL //
/////////////////////////////////////////////////////////
func (*NilLiteral) End ¶
func (n *NilLiteral) End() token.Position
func (*NilLiteral) Pos ¶
func (n *NilLiteral) Pos() token.Position
func (*NilLiteral) String ¶
func (n *NilLiteral) String() string
func (*NilLiteral) TokenLiteral ¶
func (n *NilLiteral) TokenLiteral() string
type Pipe ¶
type Pipe struct { Token token.Token Left Expression Right Expression }
/////////////////////////////////////////////////////////
PIPE OPERATOR //
///////////////////////////////////////////////////////// Pipe operator.
func (*Pipe) TokenLiteral ¶
type PostfixExpression ¶
type PostfixExpression struct { Token token.Token Left Expression Operator string }
/////////////////////////////////////////////////////////
POSTFIX //
/////////////////////////////////////////////////////////
func (*PostfixExpression) End ¶
func (pe *PostfixExpression) End() token.Position
func (*PostfixExpression) Pos ¶
func (pe *PostfixExpression) Pos() token.Position
func (*PostfixExpression) String ¶
func (pe *PostfixExpression) String() string
func (*PostfixExpression) TokenLiteral ¶
func (pe *PostfixExpression) TokenLiteral() string
type PrefixExpression ¶
type PrefixExpression struct { Token token.Token Operator string Right Expression }
/////////////////////////////////////////////////////////
PREFIX //
/////////////////////////////////////////////////////////
func (*PrefixExpression) End ¶
func (pe *PrefixExpression) End() token.Position
func (*PrefixExpression) Pos ¶
func (pe *PrefixExpression) Pos() token.Position
func (*PrefixExpression) String ¶
func (pe *PrefixExpression) String() string
func (*PrefixExpression) TokenLiteral ¶
func (pe *PrefixExpression) TokenLiteral() string
type Program ¶
type Program struct { Statements []Statement Includes map[string]*IncludeStatement }
func (*Program) TokenLiteral ¶
type PropertyDeclStmt ¶
type PropertyDeclStmt struct { Token token.Token Name *Identifier //property name Getter *GetterStmt //getter Setter *SetterStmt //setter Indexes []*Identifier //only used in class's indexer StaticFlag bool ModifierLevel ModifierLevel //property's modifier Annotations []*AnnotationStmt Default Expression //Doc related Doc *CommentGroup // associated documentation; or nil SrcEndToken token.Token }
class's property declaration
func (*PropertyDeclStmt) Docs ¶
func (p *PropertyDeclStmt) Docs() string
func (*PropertyDeclStmt) End ¶
func (p *PropertyDeclStmt) End() token.Position
func (*PropertyDeclStmt) Pos ¶
func (p *PropertyDeclStmt) Pos() token.Position
func (*PropertyDeclStmt) SrcEnd ¶
func (p *PropertyDeclStmt) SrcEnd() token.Position
func (*PropertyDeclStmt) SrcStart ¶
func (p *PropertyDeclStmt) SrcStart() token.Position
Below two methods implements 'Source' interface.
func (*PropertyDeclStmt) String ¶
func (p *PropertyDeclStmt) String() string
func (*PropertyDeclStmt) TokenLiteral ¶
func (p *PropertyDeclStmt) TokenLiteral() string
type RegExLiteral ¶
/////////////////////////////////////////////////////////
REGEX LITERAL //
/////////////////////////////////////////////////////////
func (*RegExLiteral) End ¶
func (rel *RegExLiteral) End() token.Position
func (*RegExLiteral) Pos ¶
func (rel *RegExLiteral) Pos() token.Position
func (*RegExLiteral) String ¶
func (rel *RegExLiteral) String() string
func (*RegExLiteral) TokenLiteral ¶
func (rel *RegExLiteral) TokenLiteral() string
type ReturnStatement ¶
type ReturnStatement struct { Token token.Token ReturnValue Expression //for old campatibility ReturnValues []Expression }
/////////////////////////////////////////////////////////
RETURN STATEMENT //
/////////////////////////////////////////////////////////
func (*ReturnStatement) End ¶
func (rs *ReturnStatement) End() token.Position
func (*ReturnStatement) Pos ¶
func (rs *ReturnStatement) Pos() token.Position
func (*ReturnStatement) String ¶
func (rs *ReturnStatement) String() string
func (*ReturnStatement) TokenLiteral ¶
func (rs *ReturnStatement) TokenLiteral() string
type SetterStmt ¶
type SetterStmt struct { Token token.Token Body *BlockStatement }
property's setter statement setter variable is always 'value' like c#
func (*SetterStmt) End ¶
func (s *SetterStmt) End() token.Position
func (*SetterStmt) Pos ¶
func (s *SetterStmt) Pos() token.Position
func (*SetterStmt) String ¶
func (s *SetterStmt) String() string
func (*SetterStmt) TokenLiteral ¶
func (s *SetterStmt) TokenLiteral() string
type SliceExpression ¶
type SliceExpression struct { Token token.Token StartIndex Expression EndIndex Expression }
/////////////////////////////////////////////////////////
SLICE/INDEX //
/////////////////////////////////////////////////////////
func (*SliceExpression) End ¶
func (se *SliceExpression) End() token.Position
func (*SliceExpression) Pos ¶
func (se *SliceExpression) Pos() token.Position
func (*SliceExpression) String ¶
func (se *SliceExpression) String() string
func (*SliceExpression) TokenLiteral ¶
func (se *SliceExpression) TokenLiteral() string
type SpawnStmt ¶
type SpawnStmt struct { Token token.Token Call Expression }
/////////////////////////////////////////////////////////
SPAWN STATEMENT //
/////////////////////////////////////////////////////////
func (*SpawnStmt) TokenLiteral ¶
type StringLiteral ¶
/////////////////////////////////////////////////////////
STRING LITERAL //
/////////////////////////////////////////////////////////
func (*StringLiteral) End ¶
func (s *StringLiteral) End() token.Position
func (*StringLiteral) Pos ¶
func (s *StringLiteral) Pos() token.Position
func (*StringLiteral) String ¶
func (s *StringLiteral) String() string
func (*StringLiteral) TokenLiteral ¶
func (s *StringLiteral) TokenLiteral() string
type StructLiteral ¶
type StructLiteral struct { Token token.Token Pairs map[Expression]Expression RBraceToken token.Token }
/////////////////////////////////////////////////////////
STRUCT LITERAL //
/////////////////////////////////////////////////////////
func (*StructLiteral) End ¶
func (s *StructLiteral) End() token.Position
func (*StructLiteral) Pos ¶
func (s *StructLiteral) Pos() token.Position
func (*StructLiteral) String ¶
func (s *StructLiteral) String() string
func (*StructLiteral) TokenLiteral ¶
func (s *StructLiteral) TokenLiteral() string
type TernaryExpression ¶
type TernaryExpression struct { Token token.Token Condition Expression IfTrue Expression IfFalse Expression }
/////////////////////////////////////////////////////////
TERNARY //
/////////////////////////////////////////////////////////
func (*TernaryExpression) End ¶
func (te *TernaryExpression) End() token.Position
func (*TernaryExpression) Pos ¶
func (te *TernaryExpression) Pos() token.Position
func (*TernaryExpression) String ¶
func (te *TernaryExpression) String() string
func (*TernaryExpression) TokenLiteral ¶
func (te *TernaryExpression) TokenLiteral() string
type ThrowStmt ¶
type ThrowStmt struct { Token token.Token Expr Expression }
ThrowStmt provide "throw" expression statement. Note: only support throwing "String" object
func (*ThrowStmt) TokenLiteral ¶
type TryStmt ¶
type TryStmt struct { Token token.Token Block *BlockStatement Catches []Expression //catch Finally *BlockStatement }
/////////////////////////////////////////////////////////
TRY/CATCH/FINALLY //
///////////////////////////////////////////////////////// TryStmt provide "try/catch/finally" statement.
func (*TryStmt) TokenLiteral ¶
type TupleLiteral ¶
type TupleLiteral struct { Token token.Token Members []Expression RParenToken token.Token }
/////////////////////////////////////////////////////////
Tuple LITERAL //
/////////////////////////////////////////////////////////
func (*TupleLiteral) End ¶
func (t *TupleLiteral) End() token.Position
func (*TupleLiteral) Pos ¶
func (t *TupleLiteral) Pos() token.Position
func (*TupleLiteral) String ¶
func (t *TupleLiteral) String() string
func (*TupleLiteral) TokenLiteral ¶
func (t *TupleLiteral) TokenLiteral() string
type UIntegerLiteral ¶
/////////////////////////////////////////////////////////
UNSIGNED INTEGER LITERAL //
/////////////////////////////////////////////////////////
func (*UIntegerLiteral) End ¶
func (il *UIntegerLiteral) End() token.Position
func (*UIntegerLiteral) Pos ¶
func (il *UIntegerLiteral) Pos() token.Position
func (*UIntegerLiteral) String ¶
func (il *UIntegerLiteral) String() string
func (*UIntegerLiteral) TokenLiteral ¶
func (il *UIntegerLiteral) TokenLiteral() string
type UnlessExpression ¶
type UnlessExpression struct { Token token.Token Condition Expression Consequence *BlockStatement Alternative *BlockStatement }
/////////////////////////////////////////////////////////
UNLESS-ELSE //
/////////////////////////////////////////////////////////
func (*UnlessExpression) End ¶
func (ul *UnlessExpression) End() token.Position
func (*UnlessExpression) Pos ¶
func (ul *UnlessExpression) Pos() token.Position
func (*UnlessExpression) String ¶
func (ul *UnlessExpression) String() string
func (*UnlessExpression) TokenLiteral ¶
func (ul *UnlessExpression) TokenLiteral() string
type UsingStmt ¶
type UsingStmt struct { Token token.Token Expr *AssignExpression Block *BlockStatement }
/////////////////////////////////////////////////////////
USING //
/////////////////////////////////////////////////////////
func (*UsingStmt) TokenLiteral ¶
type WhileLoop ¶
type WhileLoop struct { Token token.Token Condition Expression Block *BlockStatement }
/////////////////////////////////////////////////////////
WHILE LOOP //
/////////////////////////////////////////////////////////