rteparser

package
v0.0.0-...-50a3762 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 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")

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

	//ErrInvalidType is used when the type of a data variable is bad
	ErrInvalidType = errors.New("Invalid or missing data 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")
)

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) ([]rtedef.EnforcedFunction, *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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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