config_parser

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseContext

func BaseContext(ctx interface{}) (baseCtx *antlr.BaseParserRuleContext)

Types

type ConsoleErrorListener

type ConsoleErrorListener struct {
	ErrorBuilder strings.Builder
}

func NewConsoleErrorListener

func NewConsoleErrorListener() *ConsoleErrorListener

func (*ConsoleErrorListener) ReportAmbiguity

func (d *ConsoleErrorListener) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ambigAlts *antlr.BitSet, configs antlr.ATNConfigSet)

func (*ConsoleErrorListener) ReportAttemptingFullContext

func (d *ConsoleErrorListener) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, conflictingAlts *antlr.BitSet, configs antlr.ATNConfigSet)

func (*ConsoleErrorListener) ReportContextSensitivity

func (d *ConsoleErrorListener) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, configs antlr.ATNConfigSet)

func (*ConsoleErrorListener) SyntaxError

func (d *ConsoleErrorListener) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, msg string, e antlr.RecognitionException)

type ErrorType

type ErrorType string
const (
	ErrorType_Unsupported ErrorType = "is not supported"
	ErrorType_NotSet      ErrorType = "is not set"
)

type Function

type Function struct {
	Name   string
	Not    bool
	Params []*Param
}

func (*Function) String

func (f *Function) String(compact bool, quoteVal bool, omitEmpty bool) string

type Item

type Item struct {
	Type  ItemType
	Value interface{}
}

func NewParamItem

func NewParamItem(param *Param) *Item

func NewRoutingRuleItem

func NewRoutingRuleItem(rule *RoutingRule) *Item

func NewSectionItem

func NewSectionItem(section *Section) *Item

func (*Item) String

func (i *Item) String(compact bool, quoteVal bool) string

type ItemType

type ItemType int
const (
	ItemType_RoutingRule ItemType = iota
	ItemType_Param
	ItemType_Section
)

func (ItemType) String

func (t ItemType) String() string

type Param

type Param struct {
	// Key may be empty.
	Key string

	// Either Val or AndFunctions is empty.
	Val          string
	AndFunctions []*Function

	// Annotation is optional
	Annotation []*Param
}

func (*Param) String

func (p *Param) String(compact bool, quoteVal bool) string

type RoutingRule

type RoutingRule struct {
	AndFunctions []*Function
	Outbound     Function
}

func (*RoutingRule) String

func (r *RoutingRule) String(replaceParamWithN bool, compact bool, quoteVal bool) string

type Section

type Section struct {
	Name  string
	Items []*Item
}

func Parse

func Parse(in string) (sections []*Section, err error)

func (*Section) String

func (s *Section) String(compact bool, quoteVal bool) string

type Walker

type Walker struct {
	*dae_config.Basedae_configListener

	Sections []*Section
	// contains filtered or unexported fields
}

func NewWalker

func NewWalker(parser antlr.Parser) *Walker

func (*Walker) EnterProgramStructureBlcok

func (w *Walker) EnterProgramStructureBlcok(ctx *dae_config.ProgramStructureBlcokContext)

func (*Walker) ReportError

func (w *Walker) ReportError(ctx interface{}, errorType ErrorType, target ...string)

func (*Walker) VisitErrorNode

func (w *Walker) VisitErrorNode(node antlr.ErrorNode)

Jump to

Keyboard shortcuts

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