script_go

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ExpectedPipelineStepError = "Expected pipeline step (identifier, string or '{')"
View Source
const MultiplexForkName = "multiplex"

Variables

View Source
var (
	ErrorMissingQuote = "Unexpected EOF, missing closing %v quote"
)

Functions

This section is empty.

Types

type Fork

type Fork struct {
	Step
	Pipelines Pipelines
}

func (Fork) Pos

func (f Fork) Pos() Token

type Input

type Input []Token

Data input (file, console, TCP, ...) Inside a Fork, this identifies the pipeline.

func (Input) Pos

func (p Input) Pos() (res Token)

type MultiInput

type MultiInput struct {
	Pipelines
}

type Node

type Node interface {
	Pos() Token
}

type Output

type Output Token

Data output (file, console, TCP, ...)

func (Output) Pos

func (p Output) Pos() Token

type Parser

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

func NewParser

func NewParser(r io.Reader) *Parser

func (*Parser) Parse

func (p *Parser) Parse() (Pipeline, error)

type ParserError

type ParserError struct {
	Pos     Token
	Message string
}

func (ParserError) Error

func (e ParserError) Error() string

type Pipeline

type Pipeline []PipelineStep

Depending on their context, pipelines may contain different elements. Any element can be Output, Step, Fork or Pipelines. The first element depends on the context:

  • if the pipeline has no predecessor (does not receive data from another pipeline or step), it can start with anything, including an Input or Inputs
  • if the pipeline is inside a Fork, it must start with Input or Inputs
  • if the pipeline is inside a multiplex fork (a Pipelines without a surrounding Fork, that also has a predecessor), it cannot start with an Input or Inputs

func (Pipeline) Pos

func (p Pipeline) Pos() (res Token)

func (Pipeline) Transform

func (p Pipeline) Transform(verify PipelineVerification) (Pipeline, error)

func (Pipeline) Validate

func (p Pipeline) Validate(isInput bool, isFork bool) error

type PipelineBuilder

type PipelineBuilder struct {
	reg.ProcessorRegistry
}

func (PipelineBuilder) MakePipeline

func (b PipelineBuilder) MakePipeline(pipe Pipeline) (*bitflow.SamplePipeline, error)

func (PipelineBuilder) VerifyFork

func (b PipelineBuilder) VerifyFork(name Token, params map[string]string) error

func (PipelineBuilder) VerifyInput

func (b PipelineBuilder) VerifyInput(inputs []string) error

func (PipelineBuilder) VerifyOutput

func (b PipelineBuilder) VerifyOutput(output string) error

func (PipelineBuilder) VerifyStep

func (b PipelineBuilder) VerifyStep(name Token, params map[string]string) error

type PipelineStep

type PipelineStep interface {
	Node
}

type PipelineVerification

type PipelineVerification interface {
	VerifyInput(inputs []string) error
	VerifyOutput(output string) error
	VerifyStep(name Token, params map[string]string) error
	VerifyFork(name Token, params map[string]string) error
}

type Pipelines

type Pipelines []Pipeline

func (Pipelines) Pos

func (p Pipelines) Pos() (res Token)

type Scanner

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

func NewScanner

func NewScanner(r io.Reader) *Scanner

func (*Scanner) Scan

func (s *Scanner) Scan() (Token, error)

type Step

type Step struct {
	Name   Token
	Params map[Token]Token
}

func (Step) ParamsMap

func (step Step) ParamsMap() map[string]string

func (Step) Pos

func (step Step) Pos() Token

type Token

type Token struct {
	Type  TokenType
	Lit   string
	Start int
	End   int
}

func (Token) Content

func (tok Token) Content() string

func (Token) String

func (tok Token) String() string

type TokenType

type TokenType int
const (
	// Special
	ILLEGAL TokenType = iota
	EOF
	WS
	COMMENT

	// Literals
	STR
	QUOT_STR // Surrounded by one of: " ' `

	// Parameters
	PARAM_OPEN  // (
	PARAM_CLOSE // )
	PARAM_SEP   // ,
	PARAM_EQ    // =

	// Misc & operators
	SEP           // ;
	NEXT          // ->
	OPEN          // {
	CLOSE         // }
	BRACKET_OPEN  // [
	BRACKET_CLOSE // ]

)

func (TokenType) String

func (t TokenType) String() (s string)

Jump to

Keyboard shortcuts

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