lexer

package
v6.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2024 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package lexer contains source code autogenerated by GOCC from the Miller DSL's grammar file pkg/parsing/mlr.bnf.

Index

Constants

View Source
const (
	NoState    = -1
	NumStates  = 336
	NumSymbols = 653
)

Variables

View Source
var ActTab = ActionTable{}/* 336 elements not displayed */
View Source
var TransTab = TransitionTable{}/* 336 elements not displayed */

Functions

This section is empty.

Types

type ActionRow

type ActionRow struct {
	Accept token.Type
	Ignore string
}

func (ActionRow) String

func (a ActionRow) String() string

type ActionTable

type ActionTable [NumStates]ActionRow

type Lexer

type Lexer struct {
	Context token.Context
	// contains filtered or unexported fields
}

func NewLexer

func NewLexer(src []byte) *Lexer

func NewLexerFile

func NewLexerFile(fpath string) (*Lexer, error)

func (*Lexer) Reset

func (l *Lexer) Reset()

func (*Lexer) Scan

func (l *Lexer) Scan() (tok *token.Token)

type SourceContext

type SourceContext struct {
	Filepath string
}

SourceContext is a simple instance of a token.Context which contains the name of the source file.

func (*SourceContext) Source

func (s *SourceContext) Source() string

type TransitionTable

type TransitionTable [NumStates]func(rune) int

Let s be the current state Let r be the current input rune transitionTable[s](r) returns the next state.

Jump to

Keyboard shortcuts

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