ast

package
v0.0.0-...-34d69fc Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayLiteral

type ArrayLiteral struct {
	Token    token.Token
	Size     Expression // MEMO: nilかINTしか入らないから型で縛った方が良さそう
	Elements []Expression
}

func (*ArrayLiteral) String

func (al *ArrayLiteral) String() string

func (*ArrayLiteral) TokenLiteral

func (al *ArrayLiteral) TokenLiteral() string

type AssignmentExpression

type AssignmentExpression struct {
	Token token.Token
	Left  Expression
	Value Expression
}

func (*AssignmentExpression) String

func (ae *AssignmentExpression) String() string

func (*AssignmentExpression) TokenLiteral

func (ae *AssignmentExpression) TokenLiteral() string

type BlockStatement

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

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
}

func (*Boolean) String

func (b *Boolean) String() string

func (*Boolean) TokenLiteral

func (b *Boolean) TokenLiteral() string

type BreakStatement

type BreakStatement struct {
	Token token.Token
}

func (*BreakStatement) String

func (bs *BreakStatement) String() string

func (*BreakStatement) TokenLiteral

func (bs *BreakStatement) TokenLiteral() string

type CallExpression

type CallExpression struct {
	Token     token.Token // '('トークン
	Function  Expression  // Identifier
	Arguments []Expression
}

func (*CallExpression) String

func (ce *CallExpression) String() string

func (*CallExpression) TokenLiteral

func (ce *CallExpression) TokenLiteral() string

type ConstStatement

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

func (*ConstStatement) String

func (cs *ConstStatement) String() string

func (*ConstStatement) TokenLiteral

func (cs *ConstStatement) TokenLiteral() string

type ContinueStatement

type ContinueStatement struct {
	Token token.Token
}

func (*ContinueStatement) String

func (cs *ContinueStatement) String() string

func (*ContinueStatement) TokenLiteral

func (cs *ContinueStatement) TokenLiteral() string

type DimStatement

type DimStatement struct {
	Token token.Token
	Name  *Identifier
	Value Expression
}

///////////// Statement

func (*DimStatement) String

func (ds *DimStatement) String() string

func (*DimStatement) TokenLiteral

func (ds *DimStatement) TokenLiteral() string

type Empty

type Empty struct {
	Token token.Token
}

func (*Empty) String

func (e *Empty) String() string

func (*Empty) TokenLiteral

func (e *Empty) TokenLiteral() string

type EmptyArgument

type EmptyArgument struct {
	Token token.Token
}

func (*EmptyArgument) String

func (ea *EmptyArgument) String() string

func (*EmptyArgument) TokenLiteral

func (ea *EmptyArgument) TokenLiteral() string

type Expression

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

type ExpressionStatement

type ExpressionStatement struct {
	Token token.Token // 式の最初のトークン
	Expression
}

func (*ExpressionStatement) String

func (es *ExpressionStatement) String() string

func (*ExpressionStatement) TokenLiteral

func (es *ExpressionStatement) TokenLiteral() string

type ForInStatement

type ForInStatement struct {
	Token      token.Token
	LoopVar    *Identifier
	Collection Expression
	Block      *BlockStatement
}

func (*ForInStatement) String

func (fis *ForInStatement) String() string

func (*ForInStatement) TokenLiteral

func (fis *ForInStatement) TokenLiteral() string

type ForToStepStatement

type ForToStepStatement struct {
	Token   token.Token
	LoopVar *Identifier
	From    Expression
	To      Expression
	Step    Expression
	Block   *BlockStatement
}

func (*ForToStepStatement) String

func (ftss *ForToStepStatement) String() string

func (*ForToStepStatement) TokenLiteral

func (ftss *ForToStepStatement) TokenLiteral() string

type FunctionStatement

type FunctionStatement struct {
	Token      token.Token
	Name       *Identifier
	Parameters []*Identifier
	Body       *BlockStatement
	IsProc     bool
}

func (*FunctionStatement) String

func (fs *FunctionStatement) String() string

func (*FunctionStatement) TokenLiteral

func (fs *FunctionStatement) TokenLiteral() string

type HashTableStatement

type HashTableStatement struct {
	Token token.Token
	Name  *Identifier
	Value Expression
}

func (*HashTableStatement) String

func (hts *HashTableStatement) String() string

func (*HashTableStatement) TokenLiteral

func (hts *HashTableStatement) TokenLiteral() string

type Identifier

type Identifier struct {
	Token token.Token // token.IDENT
	Value string
}

///////////// Expression

func (*Identifier) String

func (i *Identifier) String() string

func (*Identifier) TokenLiteral

func (i *Identifier) TokenLiteral() string

type IfStatement

type IfStatement struct {
	Token       token.Token // 'if'トークン
	Condition   Expression
	Consequence Statement
	Alternative Statement
}

func (*IfStatement) String

func (is *IfStatement) String() string

func (*IfStatement) TokenLiteral

func (is *IfStatement) TokenLiteral() string

type IfbStatement

type IfbStatement struct {
	Token       token.Token // 'if'トークン
	Condition   Expression
	Consequence *BlockStatement
	Alternative Statement // *IfStatement(ELSEIF) or *BlockStatement(ELSE) or nil
}

func (*IfbStatement) String

func (is *IfbStatement) String() string

func (*IfbStatement) TokenLiteral

func (is *IfbStatement) TokenLiteral() string

type IndexExpression

type IndexExpression struct {
	Token  token.Token // '[' トークン
	Left   Expression
	Index  Expression
	Option Expression
}

func (*IndexExpression) String

func (ie *IndexExpression) String() string

func (*IndexExpression) TokenLiteral

func (ie *IndexExpression) TokenLiteral() string

type InfixExpression

type InfixExpression struct {
	Token    token.Token // 演算子トークン 、「+」など
	Left     Expression
	Operator string
	Right    Expression
}

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
}

func (*IntegerLiteral) String

func (il *IntegerLiteral) String() string

func (*IntegerLiteral) TokenLiteral

func (il *IntegerLiteral) TokenLiteral() string

type Node

type Node interface {
	// デバッグ or テスト用
	TokenLiteral() string
	String() string
}

type PrefixExpression

type PrefixExpression struct {
	Token    token.Token // 前置トークン 、「!」など
	Operator string
	Right    Expression
}

func (*PrefixExpression) String

func (pe *PrefixExpression) String() string

func (*PrefixExpression) TokenLiteral

func (pe *PrefixExpression) TokenLiteral() string

type Program

type Program struct {
	Statements []Statement
}

///////////// Root

func (*Program) String

func (p *Program) String() string

func (*Program) TokenLiteral

func (p *Program) TokenLiteral() string

type ResultStatement

type ResultStatement struct {
	Token       token.Token // 'RESULT'トークン
	ResultValue Expression
}

func (*ResultStatement) String

func (rs *ResultStatement) String() string

func (*ResultStatement) TokenLiteral

func (rs *ResultStatement) TokenLiteral() string

type Statement

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

type StringLiteral

type StringLiteral struct {
	Token token.Token
	Value string
}

func (*StringLiteral) String

func (sl *StringLiteral) String() string

func (*StringLiteral) TokenLiteral

func (sl *StringLiteral) TokenLiteral() string

Jump to

Keyboard shortcuts

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