parser

package
v0.0.0-...-fbe25eb Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddExpr

type AddExpr BinaryExpr

type AndExpr

type AndExpr BinaryExpr

type AssignStmt

type AssignStmt struct {
	StmtBase
	Ident string
	Rhs   Expression
}

type AtExpr

type AtExpr UnaryExpr

type BinaryExpr

type BinaryExpr struct {
	Left  Expression
	Right Expression
}

type ConcatExpr

type ConcatExpr BinaryExpr

type DeclStmt

type DeclStmt struct {
	StmtBase
	Ident string
	Rhs   Expression
}

type DivExpr

type DivExpr BinaryExpr

type EqExpr

type EqExpr BinaryExpr

type Expression

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

type ForRangeStmt

type ForRangeStmt struct {
	StmtBase
	Ident string
	Lower Expression
	Upper Expression
	Step  Expression
	Stmts []Statement
}

type ForStmt

type ForStmt struct {
	StmtBase
	Ident      string
	Collection Expression
	Stmts      []Statement
}

type FunctionExpr

type FunctionExpr struct {
	ParameterNames []string
	Body           []Statement
}

type GeExpr

type GeExpr BinaryExpr

type GtExpr

type GtExpr BinaryExpr

type HashEntryExpr

type HashEntryExpr struct {
	Key   Expression
	Value Expression
}

type HashMapExpr

type HashMapExpr struct {
	Entries []HashEntryExpr
}

type IdentExpr

type IdentExpr string

type IfStmt

type IfStmt struct {
	StmtBase
	Cond       Expression
	TrueStmts  []Statement
	FalseStmts []Statement // nillable
}

type InExpr

type InExpr BinaryExpr

type IndexExpr

type IndexExpr struct {
	Recvr Expression
	Index Expression
}

type IndexRangeExpr

type IndexRangeExpr struct {
	Recvr Expression
	Lower Expression
	Upper Expression
}

type IndexedAssignStmt

type IndexedAssignStmt struct {
	StmtBase
	Ident string
	Index Expression
	Rhs   Expression
}

type InvocationStmt

type InvocationStmt struct {
	StmtBase
	Invocation Expression
}

type InvokeExpr

type InvokeExpr struct {
	FuncName string
	Args     []Expression
}

type KernelExpr

type KernelExpr struct {
	Elements []Expression
}

type LeExpr

type LeExpr BinaryExpr

type ListExpr

type ListExpr struct {
	Elements []Expression
}

type LogStmt

type LogStmt struct {
	StmtBase
	Args []Expression
}

type LtExpr

type LtExpr BinaryExpr

type MemberExpr

type MemberExpr struct {
	Recvr  Expression
	Member string
}

type ModExpr

type ModExpr BinaryExpr

type MulExpr

type MulExpr BinaryExpr

type NegExpr

type NegExpr UnaryExpr

type NeqExpr

type NeqExpr BinaryExpr

type NotExpr

type NotExpr UnaryExpr

type OrExpr

type OrExpr BinaryExpr

type PipelineExpr

type PipelineExpr BinaryExpr

type PixelAssignStmt

type PixelAssignStmt struct {
	StmtBase
	Lhs Expression
	Rhs Expression
}

type PosExpr

type PosExpr struct {
	X Expression
	Y Expression
}

type Program

type Program struct {
	Stmts []Statement
}

Program is the complete, parsed ylang program.

func Parse

func Parse(input []lexer.Token, omitTokenInfo bool) (Program, error)

type ReturnStmt

type ReturnStmt struct {
	StmtBase
	Result Expression
}

type Statement

type Statement interface {
	Token() lexer.Token
	// contains filtered or unexported methods
}

type StmtBase

type StmtBase struct {
	// contains filtered or unexported fields
}

func (StmtBase) Token

func (stmt StmtBase) Token() lexer.Token

type SubExpr

type SubExpr BinaryExpr

type TernaryExpr

type TernaryExpr struct {
	Cond        Expression
	TrueResult  Expression
	FalseResult Expression
}

type UnaryExpr

type UnaryExpr struct {
	Inner Expression
}

type WhileStmt

type WhileStmt struct {
	StmtBase
	Cond  Expression
	Stmts []Statement
}

type YieldStmt

type YieldStmt struct {
	StmtBase
	Result Expression
}

Jump to

Keyboard shortcuts

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