parser

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ATCommand

type ATCommand interface {
	// contains filtered or unexported methods
}

type ATCommands

type ATCommands struct {
	AT       string      `@AT`
	Commands []ATCommand `( @@ ( CommandSeparator @@ )* )?`
}

type ATExecuteCommand

type ATExecuteCommand struct {
	CommandName string `@CommandName`
}

type ATReadCommand

type ATReadCommand struct {
	CommandName  string `@CommandName`
	ReadModifier string `@ReadModifier`
}

type ATSetCommand

type ATSetCommand struct {
	CommandName string   `@CommandName`
	SetModifier string   `@SetModifier`
	Values      []String `(@@ (ValueSeparator @@)*)?`
}

type ATTestCommand

type ATTestCommand struct {
	CommandName  string `@CommandName`
	TestModifier string `@TestModifier`
}

type Fragment

type Fragment struct {
	Escaped string `(  (@Escaped | @QuotedEscaped )`
	Text    string ` | (@Chars | @QuotedChars) )`
}

func (Fragment) String

func (f Fragment) String() string

type Parser

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

func NewParser

func NewParser() (*Parser, error)

func (*Parser) DumpTokens added in v0.3.0

func (p *Parser) DumpTokens(text string) error

func (*Parser) Lex added in v0.3.0

func (p *Parser) Lex(text string) ([]lexer.Token, error)

func (*Parser) LexerSymbolMap added in v0.3.0

func (p *Parser) LexerSymbolMap() map[lexer.TokenType]string

func (*Parser) Parse

func (p *Parser) Parse(text string) (*ATCommands, error)

type String

type String struct {
	Fragments []Fragment `@@*`
}

func (String) String

func (s String) String() string

Jump to

Keyboard shortcuts

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