parser

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

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

Go to latest
Published: Sep 17, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	Scanner Scanner
}

func NewParser

func NewParser(input string) *Parser

func (*Parser) Parse

func (p *Parser) Parse() command_args.CommandArgument

type Scanner

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

Lexical scanner

func NewScanner

func NewScanner(r io.Reader) *Scanner

func (*Scanner) Advance

func (s *Scanner) Advance() TokenStruct

func (*Scanner) Expect

func (s *Scanner) Expect(token Token) bool

func (*Scanner) OptionalConsume

func (s *Scanner) OptionalConsume(token Token)

func (*Scanner) Peek

func (s *Scanner) Peek(offset uint32) TokenStruct

func (*Scanner) Read

func (s *Scanner) Read() TokenStruct

type Token

type Token int
const (
	ILLEGAL Token = iota
	EOF
	EOL
	WS
	IDENT      // Command name, parameter
	STR        // String encased in quotes
	DASH       // Indication of a short command
	DDASH      // Indication of a long command
	ASSIGNMENT // =
)

Tokens

type TokenStruct

type TokenStruct struct {
	Tok Token
	Val string
}

Jump to

Keyboard shortcuts

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