ast

package
v0.0.0-...-f7e72b4 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2019 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 BaseStmt

type BaseStmt struct {
	Label Label
}

func (*BaseStmt) Line

func (s *BaseStmt) Line() int64

type BinaryExpr

type BinaryExpr struct {
	Op   Token
	X, Y Expr
}

type ElseStmt

type ElseStmt struct {
	BaseStmt
	Else Token
	Body Stmt
}

type EndStmt

type EndStmt struct {
	BaseStmt
	End Token
}

type Error

type Error struct {
	Pos scanner.Position
	Err error
}

func (*Error) Error

func (e *Error) Error() string

type Expr

type Expr interface{}

type ForStmt

type ForStmt struct {
	BaseStmt
	For   Token
	Var   Variable
	Start Expr
	To    Token
	End   Expr
}

type GosubStmt

type GosubStmt struct {
	BaseStmt
	Gosub    Token
	Location Number
}

type GotoStmt

type GotoStmt struct {
	BaseStmt
	Goto     Token
	Location Number
}

type IfStmt

type IfStmt struct {
	BaseStmt
	If   Token
	Cond Expr
	Then Token
	Body Stmt
	Else *ElseStmt
}

type Label

type Label Number

func (Label) String

func (l Label) String() string

type LetStmt

type LetStmt struct {
	BaseStmt
	Let   Token
	Var   Variable
	Value Expr
}

type NextStmt

type NextStmt struct {
	BaseStmt
	Next Token
	Var  Variable
}

type Number

type Number struct {
	Pos   scanner.Position
	Value int64
}

type ParenExpr

type ParenExpr struct {
	Lparen Token
	X      Expr
	Rparen Token
}

type PeekStmt

type PeekStmt struct {
	BaseStmt
	Peek Token
	Addr Expr
	Var  Variable
}

type PokeStmt

type PokeStmt struct {
	BaseStmt
	Poke  Token
	Addr  Expr
	Value Expr
}

type PrintStmt

type PrintStmt struct {
	BaseStmt
	Print Token
	Args  []Expr
}

type Punct

type Punct struct {
	Pos  scanner.Position
	Type lex.Token
}

type ReturnStmt

type ReturnStmt struct {
	BaseStmt
	Return Token
}

type Stmt

type Stmt interface {
	Line() int64
}

type String

type String struct {
	Pos   scanner.Position
	Value string
}

type Token

type Token struct {
	Pos  scanner.Position
	Type lex.Token
	Text string
}

type Variable

type Variable struct {
	Pos  scanner.Position
	Name string
}

Jump to

Keyboard shortcuts

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