rawparser

package
v0.0.0-...-77fca55 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockContent

type BlockContent struct {
	Entries []*Entry `@@*`
}

type BlockDirective

type BlockDirective struct {
	Identifier string        `@Ident`
	Parameters []*Value      `@@*`
	Content    *BlockContent `"{" @@ "}"`
}

func (*BlockDirective) FindEntriesWithIdentifier

func (b *BlockDirective) FindEntriesWithIdentifier(identifier string) []*Entry

func (*BlockDirective) GetEntries

func (b *BlockDirective) GetEntries() []*Entry

func (*BlockDirective) GetEntriesByIdentifier

func (b *BlockDirective) GetEntriesByIdentifier(identifier string) []*Entry

func (*BlockDirective) GetParametersExpressions

func (b *BlockDirective) GetParametersExpressions() []string

func (*BlockDirective) SetEntries

func (b *BlockDirective) SetEntries(entries []*Entry)

func (*BlockDirective) SetParameters

func (b *BlockDirective) SetParameters(parameters []string)

type Comment

type Comment struct {
	Value string `@Comment`
}

type Config

type Config struct {
	Entries []*Entry `@@*`
}

func (*Config) GetEntries

func (c *Config) GetEntries() []*Entry

func (*Config) SetEntries

func (c *Config) SetEntries(entries []*Entry)

type Directive

type Directive struct {
	Identifier string   `@Ident`
	Values     []*Value `@@*";"`
}

func (*Directive) GetExpressions

func (d *Directive) GetExpressions() []string

func (*Directive) GetFirstValueStr

func (d *Directive) GetFirstValueStr() string

func (*Directive) GetValues

func (d *Directive) GetValues() []*Value

func (*Directive) SetValues

func (d *Directive) SetValues(expressions []string)

type Entry

type Entry struct {
	StartNewLines  []string        `@NewLine*`
	Comment        *Comment        `( @@`
	Directive      *Directive      `| @@`
	BlockDirective *BlockDirective `| @@ )`
	EndNewLines    []string        `@NewLine*`
}

func (*Entry) GetIdentifier

func (e *Entry) GetIdentifier() string

type RawParser

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

func GetRawParser

func GetRawParser() (*RawParser, error)

func (*RawParser) Parse

func (p *RawParser) Parse(content string) (*Config, error)

type Value

type Value struct {
	Expression string `@Expression | @StringDoubleQuoted | @StringSingleQuoted`
}

Jump to

Keyboard shortcuts

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