pigeon

package
v0.0.0-...-f8f9fbc Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignmentStatement

type AssignmentStatement struct {
	LineNumber int
	Column     int
	Target     string
	Value      Expression
}

func (AssignmentStatement) Line

func (t AssignmentStatement) Line() int

func (AssignmentStatement) Statement

func (t AssignmentStatement) Statement()

type BreakStatement

type BreakStatement struct {
	LineNumber int
	Column     int
}

func (BreakStatement) Line

func (t BreakStatement) Line() int

func (BreakStatement) Statement

func (t BreakStatement) Statement()

type ContinueStatement

type ContinueStatement struct {
	LineNumber int
	Column     int
}

func (ContinueStatement) Line

func (t ContinueStatement) Line() int

func (ContinueStatement) Statement

func (t ContinueStatement) Statement()

type Definition

type Definition interface {
	Definition()
	Line() int
}

type ElseClause

type ElseClause struct {
	LineNumber int
	Column     int
	Body       []Statement
}

type ElseifClause

type ElseifClause struct {
	LineNumber int
	Column     int
	Condition  Expression
	Body       []Statement
}

type Expression

type Expression interface {
	Expression()
	Line() int
}

type ForeachStatement

type ForeachStatement struct {
	LineNumber int
	Column     int
	IndexName  string
	ValName    string
	Collection Expression
	Body       []Statement
}

func (ForeachStatement) Line

func (t ForeachStatement) Line() int

func (ForeachStatement) Statement

func (t ForeachStatement) Statement()

type ForincStatement

type ForincStatement struct {
	LineNumber int
	Column     int
	IndexName  string
	StartVal   Expression
	EndVal     Expression
	Body       []Statement
	Dec        bool
}

func (ForincStatement) Line

func (t ForincStatement) Line() int

func (ForincStatement) Statement

func (t ForincStatement) Statement()

type FunctionCall

type FunctionCall struct {
	LineNumber int
	Column     int
	Function   Expression // either an identifier or another function/operator call
	Arguments  []Expression
}

func (FunctionCall) Expression

func (t FunctionCall) Expression()

func (FunctionCall) Line

func (t FunctionCall) Line() int

func (FunctionCall) Statement

func (t FunctionCall) Statement()

type FunctionDefinition

type FunctionDefinition struct {
	LineNumber int
	Column     int
	Name       string
	Parameters []string
	Body       []Statement
	Pkg        *Package
}

func (FunctionDefinition) Definition

func (t FunctionDefinition) Definition()

func (FunctionDefinition) Line

func (t FunctionDefinition) Line() int

type GlobalDefinition

type GlobalDefinition struct {
	LineNumber int
	Column     int
	Name       string
	Value      Expression
	Pkg        *Package
}

func (GlobalDefinition) Definition

func (t GlobalDefinition) Definition()

func (GlobalDefinition) Line

func (t GlobalDefinition) Line() int

type IfStatement

type IfStatement struct {
	LineNumber int
	Column     int
	Condition  Expression
	Body       []Statement
	Elifs      []ElseifClause
	Else       ElseClause
}

func (IfStatement) Line

func (t IfStatement) Line() int

func (IfStatement) Statement

func (t IfStatement) Statement()

type LocalsStatement

type LocalsStatement struct {
	LineNumber int
	Column     int
	Vars       []string
}

func (LocalsStatement) Line

func (t LocalsStatement) Line() int

func (LocalsStatement) Statement

func (t LocalsStatement) Statement()

type MethodCall

type MethodCall struct {
	LineNumber int
	Column     int
	MethodName string // either an identifier or another function/operator call
	Receiver   Expression
	Arguments  []Expression
}

type Operation

type Operation struct {
	LineNumber int
	Column     int
	Operator   string
	Operands   []Expression
}

func (Operation) Expression

func (t Operation) Expression()

func (Operation) Line

func (t Operation) Line() int

func (Operation) Statement

func (t Operation) Statement()

type Package

type Package struct {
	Globals          map[string]GlobalDefinition
	ValidBreakpoints map[string]bool
	Funcs            map[string]FunctionDefinition
	Code             string
}

func Compile

func Compile(filename string, outputDir string) (*Package, error)

type ReturnStatement

type ReturnStatement struct {
	LineNumber int
	Column     int
	Value      Expression
}

func (ReturnStatement) Line

func (t ReturnStatement) Line() int

func (ReturnStatement) Statement

func (t ReturnStatement) Statement()

type Statement

type Statement interface {
	Statement()
	Line() int
}

type Token

type Token struct {
	Type       TokenType
	Content    string // the token itself, e.g. a number 3.7 is stored here as "3.7"
	LineNumber int    // first line is line 1
	Column     int    // first character of a line is in column 1
}

func (Token) Expression

func (t Token) Expression()

func (Token) Line

func (t Token) Line() int

type TokenType

type TokenType int
const (
	ReservedWord TokenType = iota
	OperatorWord
	IdentifierWord
	Newline
	Indentation
	OpenParen
	CloseParen
	NumberLiteral
	StringLiteral
	BooleanLiteral
	NilLiteral
	OpenSquare
	CloseSquare
	Dot
	Space
	TypeName
	OpenAngle
	CloseAngle
	Comma
)

type WhileStatement

type WhileStatement struct {
	LineNumber int
	Column     int
	Condition  Expression
	Body       []Statement
}

func (WhileStatement) Line

func (t WhileStatement) Line() int

func (WhileStatement) Statement

func (t WhileStatement) Statement()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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