Help us shape the future of Go! Take the 2026 Go Developer Survey

parse

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 8 Imported by: 276

Documentation

Index

Constants

View Source
const EOF = -1
View Source
const T2Colon = 57374
View Source
const T2Comma = 57372
View Source
const T3Comma = 57373
View Source
const TAnd = 57346
View Source
const TBreak = 57347
View Source
const TDo = 57348
View Source
const TElse = 57349
View Source
const TElseIf = 57350
View Source
const TEnd = 57351
View Source
const TEqeq = 57368
View Source
const TFalse = 57352
View Source
const TFor = 57353
View Source
const TFunction = 57354
View Source
const TGoto = 57367
View Source
const TGte = 57371
View Source
const TIdent = 57375
View Source
const TIf = 57355
View Source
const TIn = 57356
View Source
const TLocal = 57357
View Source
const TLte = 57370
View Source
const TNeq = 57369
View Source
const TNil = 57358
View Source
const TNot = 57359
View Source
const TNumber = 57376
View Source
const TOr = 57360
View Source
const TRepeat = 57362
View Source
const TReturn = 57361
View Source
const TString = 57377
View Source
const TThen = 57363
View Source
const TTrue = 57364
View Source
const TUntil = 57365
View Source
const TWhile = 57366
View Source
const UNARY = 57378

Variables

This section is empty.

Functions

func Dump

func Dump(chunk []ast.Stmt) string

func Parse

func Parse(reader io.Reader, name string) (chunk []ast.Stmt, err error)

func TokenName

func TokenName(c int) string

Types

type Error

type Error struct {
	Pos     ast.Position
	Message string
	Token   string
}

func (*Error) Error

func (e *Error) Error() string

type Lexer

type Lexer struct {
	Stmts         []ast.Stmt
	PNewLine      bool
	Token         ast.Token
	PrevTokenType int
	// contains filtered or unexported fields
}

func (*Lexer) Error

func (lx *Lexer) Error(message string)

func (*Lexer) Lex

func (lx *Lexer) Lex(lval *yySymType) int

func (*Lexer) TokenError

func (lx *Lexer) TokenError(tok ast.Token, message string)

type Scanner

type Scanner struct {
	Pos ast.Position
	// contains filtered or unexported fields
}

func NewScanner

func NewScanner(reader io.Reader, source string) *Scanner

func (*Scanner) Error

func (sc *Scanner) Error(tok string, msg string) *Error

func (*Scanner) Newline

func (sc *Scanner) Newline(ch int)

func (*Scanner) Next

func (sc *Scanner) Next() int

func (*Scanner) Peek

func (sc *Scanner) Peek() int

func (*Scanner) Scan

func (sc *Scanner) Scan(lexer *Lexer) (ast.Token, error)

func (*Scanner) TokenError

func (sc *Scanner) TokenError(tok ast.Token, msg string) *Error

Jump to

Keyboard shortcuts

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