ast

package
v0.0.0-...-0e7933b Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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 AwaitExpr

type AwaitExpr struct {
	Token token.Token
	Call  Expression
}

result = await add(1, 2) await hello()

func (*AwaitExpr) End

func (aw *AwaitExpr) End() token.Position

func (*AwaitExpr) Pos

func (aw *AwaitExpr) Pos() token.Position

func (*AwaitExpr) String

func (aw *AwaitExpr) String() string

func (*AwaitExpr) TokenLiteral

func (aw *AwaitExpr) TokenLiteral() string

type BlockStatement

type BlockStatement struct {
	Token       token.Token
	Statements  []Statement
	RBraceToken token.Token
}

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

type Boolean struct {
	Token token.Token
	Value bool
}

/////////////////////////////////////////////////////////

BOOLEAN LITERAL                   //

/////////////////////////////////////////////////////////

func (*Boolean) End

func (b *Boolean) End() token.Position

func (*Boolean) Pos

func (b *Boolean) Pos() token.Position

func (*Boolean) String

func (b *Boolean) String() string

func (*Boolean) TokenLiteral

func (b *Boolean) TokenLiteral() string

type BreakExpression

type BreakExpression struct {
	Token token.Token
}

/////////////////////////////////////////////////////////

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
	Awaited   bool // if it is an awaited call
}

/////////////////////////////////////////////////////////

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) End

func (c *CaseExpr) End() token.Position

func (*CaseExpr) Pos

func (c *CaseExpr) Pos() token.Position

func (*CaseExpr) String

func (c *CaseExpr) String() string

func (*CaseExpr) TokenLiteral

func (c *CaseExpr) TokenLiteral() string

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 ClassIndexerExpression

type ClassIndexerExpression struct {
	Token      token.Token
	Parameters []Expression //indexer's parameters
}

/////////////////////////////////////////////////////////

CLASS/INDEXER                     //

/////////////////////////////////////////////////////////

func (*ClassIndexerExpression) End

func (*ClassIndexerExpression) Pos

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 CmdExpression

type CmdExpression struct {
	Token token.Token
	Value string
}

/////////////////////////////////////////////////////////

COMMAND                        //

/////////////////////////////////////////////////////////

func (*CmdExpression) End

func (c *CmdExpression) End() token.Position

func (*CmdExpression) Pos

func (c *CmdExpression) Pos() token.Position

func (*CmdExpression) String

func (c *CmdExpression) String() string

func (*CmdExpression) TokenLiteral

func (c *CmdExpression) TokenLiteral() string

type Comment

type Comment struct {
	Token token.Token
	Text  string // comment text
}

A Comment node represents a single //-style or /*-style comment.

func (*Comment) End

func (c *Comment) End() token.Position

func (*Comment) Pos

func (c *Comment) Pos() token.Position

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 ConstStatement

type ConstStatement struct {
	Token token.Token
	Name  []*Identifier
	Value []Expression

	StaticFlag    bool
	ModifierLevel ModifierLevel //used in 'class'
	Annotations   []*AnnotationStmt

	//Doc related
	Doc         *CommentGroup // associated documentation; or nil
	SrcEndToken token.Token
}

/////////////////////////////////////////////////////////

CONST STATEMENT                    //

/////////////////////////////////////////////////////////

func (*ConstStatement) Docs

func (cs *ConstStatement) Docs() string

func (*ConstStatement) End

func (cs *ConstStatement) End() token.Position

func (*ConstStatement) Pos

func (cs *ConstStatement) Pos() token.Position

func (*ConstStatement) SrcEnd

func (cs *ConstStatement) SrcEnd() token.Position

func (*ConstStatement) SrcStart

func (cs *ConstStatement) SrcStart() token.Position

Below two methods implements 'Source' interface.

func (*ConstStatement) String

func (cs *ConstStatement) String() string

func (*ConstStatement) TokenLiteral

func (cs *ConstStatement) TokenLiteral() string

type ContinueExpression

type ContinueExpression struct {
	Token token.Token
}

/////////////////////////////////////////////////////////

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 DateTimeExpr

type DateTimeExpr struct {
	Token   token.Token
	Pattern *InterpolatedString // pattern string
}

/////////////////////////////////////////////////////////

DateTime Expression                 //

/////////////////////////////////////////////////////////

func (*DateTimeExpr) End

func (dt *DateTimeExpr) End() token.Position

func (*DateTimeExpr) Pos

func (dt *DateTimeExpr) Pos() token.Position

func (*DateTimeExpr) String

func (dt *DateTimeExpr) String() string

func (*DateTimeExpr) TokenLiteral

func (dt *DateTimeExpr) TokenLiteral() string

type DeferStmt

type DeferStmt struct {
	Token token.Token
	Call  Expression
}

/////////////////////////////////////////////////////////

DEFER STATEMENT                   //

/////////////////////////////////////////////////////////

func (*DeferStmt) End

func (ds *DeferStmt) End() token.Position

func (*DeferStmt) Pos

func (ds *DeferStmt) Pos() token.Position

func (*DeferStmt) String

func (ds *DeferStmt) String() string

func (*DeferStmt) TokenLiteral

func (ds *DeferStmt) TokenLiteral() string

type DiamondExpr

type DiamondExpr struct {
	Token token.Token
	Value string
}

/////////////////////////////////////////////////////////

Diamond                       //

/////////////////////////////////////////////////////////

func (*DiamondExpr) End

func (d *DiamondExpr) End() token.Position

func (*DiamondExpr) Pos

func (d *DiamondExpr) Pos() token.Position

func (*DiamondExpr) String

func (d *DiamondExpr) String() string

func (*DiamondExpr) TokenLiteral

func (d *DiamondExpr) TokenLiteral() string

type DoLoop

type DoLoop struct {
	Token token.Token
	Block *BlockStatement
}

/////////////////////////////////////////////////////////

DO LOOP                       //

/////////////////////////////////////////////////////////

func (*DoLoop) End

func (dl *DoLoop) End() token.Position

func (*DoLoop) Pos

func (dl *DoLoop) Pos() token.Position

func (*DoLoop) String

func (dl *DoLoop) String() string

func (*DoLoop) TokenLiteral

func (dl *DoLoop) TokenLiteral() string

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 (*ExpressionStatement) Pos

func (*ExpressionStatement) String

func (es *ExpressionStatement) String() string

func (*ExpressionStatement) TokenLiteral

func (es *ExpressionStatement) TokenLiteral() string

type FloatLiteral

type FloatLiteral struct {
	Token token.Token
	Value float64
}

/////////////////////////////////////////////////////////

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 Node       //BlockStatement or single expression
}

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    Node       //BlockStatement or single expression
}

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 Node       //BlockStatement or single expression
}

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  Node //BlockStatement or single expression
}

/////////////////////////////////////////////////////////

FOR LOOP                       //

/////////////////////////////////////////////////////////

func (*ForLoop) End

func (fl *ForLoop) End() token.Position

func (*ForLoop) Pos

func (fl *ForLoop) Pos() token.Position

func (*ForLoop) String

func (fl *ForLoop) String() string

func (*ForLoop) TokenLiteral

func (fl *ForLoop) TokenLiteral() string

type FromExpr

type FromExpr struct {
	Token token.Token //from
	Var   string      //identifier
	Expr  Expression
}

from_clause : FROM identifier IN expression

func (*FromExpr) End

func (f *FromExpr) End() token.Position

func (*FromExpr) Pos

func (f *FromExpr) Pos() token.Position

func (*FromExpr) String

func (f *FromExpr) String() string

func (*FromExpr) TokenLiteral

func (f *FromExpr) TokenLiteral() string

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

	//If the function is async or not
	Async bool
}

/////////////////////////////////////////////////////////

FUNCTION LITERAL                  //

/////////////////////////////////////////////////////////

func (*FunctionLiteral) End

func (fl *FunctionLiteral) End() token.Position

func (*FunctionLiteral) Pos

func (fl *FunctionLiteral) Pos() token.Position

func (*FunctionLiteral) StmtPos

func (fl *FunctionLiteral) StmtPos() token.Position

For debugger use

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
	IsServiceAnno   bool //service annotation(@route) is processed differently
	//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) End

func (ge *GrepExpr) End() token.Position

func (*GrepExpr) Pos

func (ge *GrepExpr) Pos() token.Position

func (*GrepExpr) String

func (ge *GrepExpr) String() string

func (*GrepExpr) TokenLiteral

func (ge *GrepExpr) TokenLiteral() string

type GroupExpr

type GroupExpr struct {
	Token   token.Token //'group'
	GrpExpr Expression
	ByExpr  Expression
}

GROUP expression BY expression

func (*GroupExpr) End

func (g *GroupExpr) End() token.Position

func (*GroupExpr) Pos

func (g *GroupExpr) Pos() token.Position

func (*GroupExpr) String

func (g *GroupExpr) String() string

func (*GroupExpr) TokenLiteral

func (g *GroupExpr) TokenLiteral() string

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 (*HashMapComprehension) Pos

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 (*HashRangeComprehension) Pos

func (*HashRangeComprehension) String

func (hc *HashRangeComprehension) String() string

func (*HashRangeComprehension) TokenLiteral

func (hc *HashRangeComprehension) TokenLiteral() string

type Identifier

type Identifier struct {
	Token token.Token
	Value string
}

/////////////////////////////////////////////////////////

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 elif 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 IfMacroStatement

type IfMacroStatement struct {
	Token        token.Token
	Condition    bool
	ConditionStr string
	Consequence  *BlockStatement
	Alternative  *BlockStatement
}

/////////////////////////////////////////////////////////

IFELSE MACRO  STATEMENT                //

/////////////////////////////////////////////////////////

func (*IfMacroStatement) End

func (ifex *IfMacroStatement) End() token.Position

func (*IfMacroStatement) Pos

func (ifex *IfMacroStatement) Pos() token.Position

func (*IfMacroStatement) String

func (ifex *IfMacroStatement) String() string

func (*IfMacroStatement) TokenLiteral

func (ifex *IfMacroStatement) TokenLiteral() string

type ImportStatement

type ImportStatement struct {
	Token      token.Token
	ImportPath string
	Program    *Program
	Functions  map[string]*FunctionLiteral //for debugger usage
}

/////////////////////////////////////////////////////////

IMPORT STATEMENT                //

/////////////////////////////////////////////////////////

func (*ImportStatement) End

func (is *ImportStatement) End() token.Position

func (*ImportStatement) Pos

func (is *ImportStatement) Pos() token.Position

func (*ImportStatement) String

func (is *ImportStatement) String() string

func (*ImportStatement) TokenLiteral

func (is *ImportStatement) 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

type IntegerLiteral struct {
	Token token.Token
	Value int64
}

/////////////////////////////////////////////////////////

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 JoinExpr

type JoinExpr struct {
	Token     token.Token //'join'
	JoinVar   string      //identifier
	InExpr    Expression
	OnExpr    Expression
	EqualExpr Expression
	IntoVar   *Identifier //why IntoVar's type is '*Identifier', not 'string'? because we need it in 'End()' function.
}

combined_join_clause : JOIN identifier IN expression ON expression EQUALS expression (INTO identifier)?

func (*JoinExpr) End

func (j *JoinExpr) End() token.Position

func (*JoinExpr) Pos

func (j *JoinExpr) Pos() token.Position

func (*JoinExpr) String

func (j *JoinExpr) String() string

func (*JoinExpr) TokenLiteral

func (j *JoinExpr) 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

	//For debugger use, If the LetStatement is in a class declaration,
	//we do not want the debugger to stop at it.
	InClass bool //true if the LetStatement is in a Class declaration
}

/////////////////////////////////////////////////////////

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 (*ListMapComprehension) Pos

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 (*ListRangeComprehension) Pos

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) End

func (me *MapExpr) End() token.Position

func (*MapExpr) Pos

func (me *MapExpr) Pos() token.Position

func (*MapExpr) String

func (me *MapExpr) String() string

func (*MapExpr) TokenLiteral

func (me *MapExpr) TokenLiteral() string

type MethodCallExpression

type MethodCallExpression struct {
	Token  token.Token
	Object Expression
	Call   Expression
}

/////////////////////////////////////////////////////////

METHOD  CALL                      //

/////////////////////////////////////////////////////////

func (*MethodCallExpression) End

func (*MethodCallExpression) Pos

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
)

func (ModifierLevel) String

func (m ModifierLevel) String() string

for debug purpose

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

type NilLiteral struct {
	Token token.Token
}

/////////////////////////////////////////////////////////

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 Node

type Node interface {
	Pos() token.Position // position of first character belonging to the node
	End() token.Position // position of first character immediately after the node

	TokenLiteral() string
	String() string
}

type OrderExpr

type OrderExpr struct {
	Token    token.Token  //'orderby'
	Ordering []Expression //[]*OrderingExpr
}

orderby_clause : ORDERBY ordering (',' ordering)*

func (*OrderExpr) End

func (o *OrderExpr) End() token.Position

func (*OrderExpr) Pos

func (o *OrderExpr) Pos() token.Position

func (*OrderExpr) String

func (o *OrderExpr) String() string

func (*OrderExpr) TokenLiteral

func (o *OrderExpr) TokenLiteral() string

type OrderingExpr

type OrderingExpr struct {
	Expr         Expression
	IsAscending  bool // if there is no 'ASCENDING or 'DESCENDING', it's default to 'ASCENDING'
	HasSortOrder bool
	OrderToken   token.Token //'ascending' or 'descending'
	Var          string
}

ordering : expression (ASCENDING | DESCENDING)?

func (*OrderingExpr) End

func (o *OrderingExpr) End() token.Position

func (*OrderingExpr) Pos

func (o *OrderingExpr) Pos() token.Position

func (*OrderingExpr) String

func (o *OrderingExpr) String() string

func (*OrderingExpr) TokenLiteral

func (o *OrderingExpr) TokenLiteral() string

type Pipe

type Pipe struct {
	Token token.Token
	Left  Expression
	Right Expression
}

/////////////////////////////////////////////////////////

PIPE OPERATOR                        //

///////////////////////////////////////////////////////// Pipe operator.

func (*Pipe) End

func (p *Pipe) End() token.Position

func (*Pipe) Pos

func (p *Pipe) Pos() token.Position

func (*Pipe) String

func (p *Pipe) String() string

func (*Pipe) TokenLiteral

func (p *Pipe) TokenLiteral() string

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
	Imports    map[string]*ImportStatement
}

func (*Program) End

func (p *Program) End() token.Position

func (*Program) Pos

func (p *Program) Pos() token.Position

func (*Program) String

func (p *Program) String() string

func (*Program) TokenLiteral

func (p *Program) TokenLiteral() string

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 QueryBodyClauseExpr

type QueryBodyClauseExpr struct {
	Expr Expression
}

query_body_clause: from_clause | let_clause | where_clause | combined_join_clause | orderby_clause

func (*QueryBodyClauseExpr) End

func (*QueryBodyClauseExpr) Pos

func (*QueryBodyClauseExpr) String

func (q *QueryBodyClauseExpr) String() string

func (*QueryBodyClauseExpr) TokenLiteral

func (q *QueryBodyClauseExpr) TokenLiteral() string

type QueryBodyExpr

type QueryBodyExpr struct {
	QueryBody         []Expression //QueryBodyClauseExpr
	Expr              Expression   //SelectExpr or GroupExpr
	QueryContinuation Expression   //QueryContinuationExpr
}

query_body : query_body_clause* select_or_group_clause query_continuation?

func (*QueryBodyExpr) End

func (q *QueryBodyExpr) End() token.Position

func (*QueryBodyExpr) Pos

func (q *QueryBodyExpr) Pos() token.Position

func (*QueryBodyExpr) String

func (q *QueryBodyExpr) String() string

func (*QueryBodyExpr) TokenLiteral

func (q *QueryBodyExpr) TokenLiteral() string

type QueryContinuationExpr

type QueryContinuationExpr struct {
	Token token.Token // 'into'
	Var   string
	Expr  Expression //QueryBodyExpr
}

query_continuation : INTO identifier query_body

func (*QueryContinuationExpr) End

func (*QueryContinuationExpr) Pos

func (*QueryContinuationExpr) String

func (q *QueryContinuationExpr) String() string

func (*QueryContinuationExpr) TokenLiteral

func (q *QueryContinuationExpr) TokenLiteral() string

type QueryExpr

type QueryExpr struct {
	Token     token.Token //'from'
	From      Expression  //FromExpr
	QueryBody Expression  //QueryBodyExpr
}

query_expression : from_clause query_body

func (*QueryExpr) End

func (q *QueryExpr) End() token.Position

func (*QueryExpr) Pos

func (q *QueryExpr) Pos() token.Position

func (*QueryExpr) String

func (q *QueryExpr) String() string

func (*QueryExpr) TokenLiteral

func (q *QueryExpr) TokenLiteral() string

type RangeLiteral

type RangeLiteral struct {
	Token    token.Token
	StartIdx Expression
	EndIdx   Expression
}

///////////////////////////////////////////////////////

RANGE LITERAL(..)                //

///////////////////////////////////////////////////////

func (*RangeLiteral) End

func (r *RangeLiteral) End() token.Position

func (*RangeLiteral) Pos

func (r *RangeLiteral) Pos() token.Position

func (*RangeLiteral) String

func (r *RangeLiteral) String() string

func (*RangeLiteral) TokenLiteral

func (r *RangeLiteral) TokenLiteral() string

type RegExLiteral

type RegExLiteral struct {
	Token token.Token
	Value string
}

/////////////////////////////////////////////////////////

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 SelectExpr

type SelectExpr struct {
	Token token.Token //'select'
	Expr  Expression
}

select_or_group_clause : SELECT expression | GROUP expression BY expression SELECT expression

func (*SelectExpr) End

func (s *SelectExpr) End() token.Position

func (*SelectExpr) Pos

func (s *SelectExpr) Pos() token.Position

func (*SelectExpr) String

func (s *SelectExpr) String() string

func (*SelectExpr) TokenLiteral

func (s *SelectExpr) TokenLiteral() string

type ServiceStatement

type ServiceStatement struct {
	Token   token.Token
	Name    *Identifier //Service name
	Addr    string
	Debug   bool
	Methods map[string]*FunctionStatement //service's methods
	Block   *BlockStatement               //mainly used for debugging purpose

	//Doc related
	Doc         *CommentGroup // associated documentation; or nil
	SrcEndToken token.Token
}

service servicename on addrs { block } /////////////////////////////////////////////////////////

Service STATEMENT                 //

/////////////////////////////////////////////////////////

func (*ServiceStatement) Docs

func (s *ServiceStatement) Docs() string

func (*ServiceStatement) End

func (s *ServiceStatement) End() token.Position

func (*ServiceStatement) Pos

func (s *ServiceStatement) Pos() token.Position

func (*ServiceStatement) SrcEnd

func (s *ServiceStatement) SrcEnd() token.Position

func (*ServiceStatement) SrcStart

func (s *ServiceStatement) SrcStart() token.Position

Below two methods implements 'Source' interface.

func (*ServiceStatement) String

func (s *ServiceStatement) String() string

func (*ServiceStatement) TokenLiteral

func (s *ServiceStatement) 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 Source

type Source interface {
	SrcStart() token.Position
	SrcEnd() token.Position
}

Source interface is used in documentation for printing source code.

type SpawnStmt

type SpawnStmt struct {
	Token token.Token
	Call  Expression
}

/////////////////////////////////////////////////////////

SPAWN STATEMENT                   //

/////////////////////////////////////////////////////////

func (*SpawnStmt) End

func (ss *SpawnStmt) End() token.Position

func (*SpawnStmt) Pos

func (ss *SpawnStmt) Pos() token.Position

func (*SpawnStmt) String

func (ss *SpawnStmt) String() string

func (*SpawnStmt) TokenLiteral

func (ss *SpawnStmt) TokenLiteral() string

type Statement

type Statement interface {
	Node
	// contains filtered or unexported methods
}

type StringLiteral

type StringLiteral struct {
	Token token.Token
	Value string
}

/////////////////////////////////////////////////////////

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
}

throw <expression>

func (*ThrowStmt) End

func (ts *ThrowStmt) End() token.Position

func (*ThrowStmt) Pos

func (ts *ThrowStmt) Pos() token.Position

func (*ThrowStmt) String

func (ts *ThrowStmt) String() string

func (*ThrowStmt) TokenLiteral

func (ts *ThrowStmt) TokenLiteral() string

type TryStmt

type TryStmt struct {
	Token   token.Token
	Try     *BlockStatement
	Var     string
	Catch   *BlockStatement
	Finally *BlockStatement
}

/////////////////////////////////////////////////////////

TRY/CATCH/FINALLY                  //

///////////////////////////////////////////////////////// TryStmt provide "try/catch/finally" statement.

func (*TryStmt) End

func (t *TryStmt) End() token.Position

func (*TryStmt) Pos

func (t *TryStmt) Pos() token.Position

func (*TryStmt) String

func (t *TryStmt) String() string

func (*TryStmt) TokenLiteral

func (t *TryStmt) TokenLiteral() string

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

type UIntegerLiteral struct {
	Token token.Token
	Value uint64
}

/////////////////////////////////////////////////////////

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) End

func (u *UsingStmt) End() token.Position

func (*UsingStmt) Pos

func (u *UsingStmt) Pos() token.Position

func (*UsingStmt) String

func (u *UsingStmt) String() string

func (*UsingStmt) TokenLiteral

func (u *UsingStmt) TokenLiteral() string

type WhereExpr

type WhereExpr struct {
	Token token.Token //'where'
	Expr  Expression
}

where_clause : WHERE expression

func (*WhereExpr) End

func (w *WhereExpr) End() token.Position

func (*WhereExpr) Pos

func (w *WhereExpr) Pos() token.Position

func (*WhereExpr) String

func (w *WhereExpr) String() string

func (*WhereExpr) TokenLiteral

func (w *WhereExpr) TokenLiteral() string

type WhileLoop

type WhileLoop struct {
	Token     token.Token
	Condition Expression
	Block     Node //BlockStatement or single expression
}

/////////////////////////////////////////////////////////

WHILE LOOP                     //

/////////////////////////////////////////////////////////

func (*WhileLoop) End

func (wl *WhileLoop) End() token.Position

func (*WhileLoop) Pos

func (wl *WhileLoop) Pos() token.Position

func (*WhileLoop) String

func (wl *WhileLoop) String() string

func (*WhileLoop) TokenLiteral

func (wl *WhileLoop) TokenLiteral() string

Jump to

Keyboard shortcuts

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