parser

package
v0.0.0-...-83d1973 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package parser implements a parser for kl source files.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrArrayAssignNotSupported = errors.New("array not supported in assigns")
	ErrArrayEmpty              = errors.New("empty array")
	ErrArrayTypeNotSupported   = errors.New("array not supported for this type")
	ErrCannotEmbed             = errors.New("can only embed in globals")
	ErrDanglingSwitchCase      = errors.New("dangling switch case")
	ErrDanglingEndFor          = errors.New("dangling endfor")
	ErrDanglingElse            = errors.New("dangling else")
	ErrDanglingEndIf           = errors.New("dangling endif")
	ErrDanglingEndSwitch       = errors.New("dangling endswitch")
	ErrDanglingEndWhile        = errors.New("dangling endwhile")
	ErrDuplicateGlobalTag      = errors.New("duplicate global tag")
	ErrDuplicateLabelTag       = errors.New("duplicate label tag")
	ErrInvalidArgument         = errors.New("invalid argument")
	ErrInvalidArrayIndex       = errors.New("invalid array index")
	ErrInvalidArraySize        = errors.New("invalid array size")
	ErrInvalidCharValue        = errors.New("invalid character value")
	ErrInvalidDeref            = errors.New("invalid deref need variable or address")
	ErrInvalidEmbed            = errors.New("invalid embed file")
	ErrInvalidGlobalName       = errors.New("invalid global name")
	ErrInvalidLabelState       = errors.New("invalid label tag")
	ErrInvalidLenNonString     = errors.New("cannot take length of non string")
	ErrInvalidToken            = errors.New("invalid token")
	ErrInvalidPanicValue       = errors.New("invalid value for panic")
	ErrInvalidValue            = errors.New("invalid value")
	ErrMissingAssign           = errors.New("missing assign operator")
	ErrMissingCharQuote        = errors.New("missing closing quote for char")
	ErrMissingDivOp            = errors.New("missing div operator")
	ErrMissingEndfor           = errors.New("missing endfor")
	ErrMissingEndif            = errors.New("missing endif")
	ErrMissingEndswitch        = errors.New("missing switch")
	ErrMissingForComposite     = errors.New("missing for loop composite")
	ErrMissingForIndex         = errors.New("missing or invalid for loop index (must be var)")
	ErrMissingForValue         = errors.New("missing or invalid for loop value (must be var)")
	ErrMissingIdentifier       = errors.New("missing identifier")
	ErrMissingLogicalOp        = errors.New("missing logical operator")
	ErrMissingRightBracket     = errors.New("missing closing bracket")
	ErrMissingSizeOperand      = errors.New("missing size operand")
	ErrMissingSwitchCaseSep    = errors.New("missing switch case separator")
	ErrMissingType             = errors.New("missing type")
	ErrMissingValues           = errors.New("missing values")
	ErrMissingVar              = errors.New("missing variable")
	ErrNeedSignedType          = errors.New("need signed type")
	ErrNeedUnsignedType        = errors.New("need unsigned type")
)

Functions

This section is empty.

Types

type Parser

type Parser struct {
	Globals    []ast.StmtGlobal
	Statements []ast.Stmt
	// contains filtered or unexported fields
}

func (*Parser) Init

func (p *Parser) Init(file string, src io.Reader)

func (*Parser) Parse

func (p *Parser) Parse() error

func (*Parser) Reset

func (p *Parser) Reset(file string, src io.Reader)

Jump to

Keyboard shortcuts

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