definitions

package
v0.0.0-...-e95280a Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	ToDefinition(parsed parsers.LanguageDefinition) (Definition, error)
}

Adapter represents a language adapter

func NewAdapter

func NewAdapter() Adapter

NewAdapter creates a new adapter instance

type Builder

type Builder interface {
	Create() Builder
	WithRoot(root string) Builder
	WithTokensPath(tokens string) Builder
	WithChannelsPath(channels string) Builder
	WithRulesPath(rules string) Builder
	WithLogicsPath(logics string) Builder
	WithPatternMatches(patternMatches []PatternMatch) Builder
	WithInputVariable(input string) Builder
	WithExtends(extends []string) Builder
	Now() (Definition, error)
}

Builder represents a language builder

func NewBuilder

func NewBuilder() Builder

NewBuilder creates a new builder instance

type Definition

type Definition interface {
	Root() string
	TokensPath() string
	RulesPath() string
	LogicsPath() string
	PatternMatches() []PatternMatch
	InputVariable() string
	HasChannelsPath() bool
	ChannelsPath() string
	HasExtends() bool
	Extends() []string
}

Definition represents a language definition

type PatternMatch

type PatternMatch interface {
	Pattern() string
	HasEnterLabel() bool
	EnterLabel() string
	HasExitLabel() bool
	ExitLabel() string
}

PatternMatch represents a pattern match

type PatternMatchAdapter

type PatternMatchAdapter interface {
	ToPatternMatch(parsed parsers.PatternMatch) (PatternMatch, error)
	ToPatternMatches(parsed []parsers.PatternMatch) ([]PatternMatch, error)
}

PatternMatchAdapter represents a pattern match adapter

func NewPatternMatchAdapter

func NewPatternMatchAdapter() PatternMatchAdapter

NewPatternMatchAdapter creates a new pattern match adapter instance

type PatternMatchBuilder

type PatternMatchBuilder interface {
	Create() PatternMatchBuilder
	WithPattern(pattern string) PatternMatchBuilder
	WithEnterLabel(enter string) PatternMatchBuilder
	WithExitLabel(exit string) PatternMatchBuilder
	Now() (PatternMatch, error)
}

PatternMatchBuilder represents a patternMatch builder

func NewPatternMatchBuilder

func NewPatternMatchBuilder() PatternMatchBuilder

NewPatternMatchBuilder creates a new pattern match builder

Jump to

Keyboard shortcuts

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