tfbparser

package
v0.0.0-...-aceb476 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrInternal means something went wrong and it's the transpiler's fault
	ErrInternal = errors.New("An internal error occured")

	//ErrUnexpectedEOF means the document ended unexpectedly
	ErrUnexpectedEOF = errors.New("Unexpected EOF")

	//ErrUnexpectedValue is used to indicate a parsed value was not what was expected (i.e. a word instead of a semicolon)
	ErrUnexpectedValue = errors.New("Unexpected value")

	//ErrUndefinedFB is used to indicate a FB was referenced that can't be found (so probably a typo has occured)
	ErrUndefinedFB = errors.New("Can't find FB with name")

	//ErrUndefinedEvent is used to indicate that an event was referenced that can't be found (so probably a typo has occured)
	ErrUndefinedEvent = errors.New("Can't find Event with name")

	//ErrUnexpectedAssociation is used when an association statement ("with") is used on a data line in an interface inappropriately (i.e. in a compositeFB, or trying to trigger an event)
	ErrUnexpectedAssociation = errors.New("Unexpected association")

	//ErrInvalidType is used when the type of an event or data variable is bad
	ErrInvalidType = errors.New("Invalid or missing data/event type")

	//ErrInvalidIOMeta is used when metadata for an I/O line is bad
	ErrInvalidIOMeta = errors.New("Invalid metadata for data/event line")

	//ErrNameAlreadyInUse is returned whenever something is named but the name is already in use elsewhere
	ErrNameAlreadyInUse = errors.New("This name is already defined elsewhere")

	//ErrOnlyInstancesGetParameters is returned when a constant parameter is attempt-assigned to a cfb output
	ErrOnlyInstancesGetParameters = errors.New("Constant parameters can only be provided to fb instances")
)

Functions

This section is empty.

Types

type ParseError

type ParseError struct {
	LineNumber int
	Argument   string
	Reason     string
	Err        error
}

ParseError is used to contain a helpful error message when parsing fails

func ParseString

func ParseString(name string, input string) ([]iec61499.FB, *ParseError)

ParseString takes an input string (i.e. filename) and input and returns all FBs in that string

func (ParseError) Error

func (p ParseError) Error() string

Error makes ParseError fulfill error interface

Jump to

Keyboard shortcuts

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