lexparse

package
v0.0.0-...-9bbed00 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LexerRuneEOF   rune = -1
	LexerRuneError rune = -2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseLexer

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

func (*BaseLexer) Err

func (l *BaseLexer) Err() error

func (*BaseLexer) Init

func (l *BaseLexer) Init(s string)

func (*BaseLexer) Peek

func (l *BaseLexer) Peek() rune

func (*BaseLexer) Read

func (l *BaseLexer) Read() rune

func (*BaseLexer) Unread

func (l *BaseLexer) Unread(r rune)

type BaseParser

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

func (*BaseParser) Complete

func (p *BaseParser) Complete() error

func (*BaseParser) Expect

func (p *BaseParser) Expect(tt TokenType) Token

func (*BaseParser) Init

func (p *BaseParser) Init(lexer Lexer)

func (*BaseParser) PeekTokenType

func (p *BaseParser) PeekTokenType() TokenType

func (*BaseParser) Unexpected

func (p *BaseParser) Unexpected() error

func (*BaseParser) Unread

func (p *BaseParser) Unread(t Token)

type Lexer

type Lexer interface {
	Next() (Token, error)
}

type Token

type Token struct {
	TokenType TokenType
	Value     string
}

type TokenType

type TokenType int
const (
	TokenTypeEOF   TokenType = -1
	TokenTypeError           = -2
)

Jump to

Keyboard shortcuts

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