parser

package
v0.0.0-...-d73cd42 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2014 License: BSD-2-Clause Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ParseErrInvalidNameDefinition indicates an invalid name clause
	ParseErrInvalidNameClause = "invalid name clause"

	// ParseErrInvalidProcDefinition indicates an invalid procedure definition
	ParseErrInvalidProcDefinition = "invalid procedure definition"

	// ParseErrInvalidTypeDefinition indicates an invalid type definition
	ParseErrInvalidTypeDefinition = "invalid type definition"

	// ParseErrInvalidStructFieldDefinition indicates an invalid struct field definition
	ParseErrInvalidStructFieldDefinition = "invalid struct field definition"

	// ParseErrMissingType indicates that a type was expected but not found
	ParseErrMissingType = "missing type"

	// ParseErrInvalidDefinition indicates an invalid statement
	ParseErrInvalidStatement = "invalid statement"

	// ParseErrInvalidParameter indicates an invalid parameter definition (argument or return value)
	ParseErrInvalidParameter = "invalid parameter definition (argument or return value)"

	// ParseErrDuplicateProcedureIdentifier indicates a duplicate identifier for a procedure
	ParseErrDuplicateProcedureIdentifier = "duplicate procedure identifier"

	// ParseErrDuplicateParameterIdentifier indicates a duplicate parameter identifier (argument or return value)
	ParseErrDuplicateParameterIdentifier = "duplicate parameter identifier (argument or return value)"

	// ParseErrUnexpectedReturnParameters indicates that return parameters were given.
	// This is probably unexpected because the procedure is a oneway procedure.
	ParseErrUnexpectedReturnParameters = "unexpected return parameters (oneway procedure?)"

	// ParseErrEmptyReturnGroup indicates parenthesis for return values are given, but no actual return parameters inside them.
	ParseErrEmptyReturnGroup = "empty return group"

	// ParseErrUnexpectedEOF indicates that the parse expected more lines, but got EOF
	ParseErrUnexpectedEOF = "unexpected EOF"

	// ParseErrReader indicates there was a problem with reading the syntax
	ParseErrReader = "reader error"
)

ParseError.Type values

View Source
var (
	// ErrNotImlemented indicates a feature has not been implemented yet.
	ErrNotImlemented = errors.New("not implemented")

	// ErrUnexpectedEOF indicates the file had not ended yet
	ErrUnexpectedEOF = errors.New(ParseErrUnexpectedEOF)
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Verbose          bool
	PrintParseErrors bool
}

type ParseError

type ParseError struct {
	Line  int
	Type  string
	Extra string
}

ParseError holds information about an error on a given line. ParseError implements the error interface.

func (*ParseError) Error

func (pe *ParseError) Error() string

type Parser

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

func NewParser

func NewParser(config *Config) *Parser

func (*Parser) Parse

func (parser *Parser) Parse(rd io.Reader) (*definitions.Service, error)

Parse parses an ango definition stream and returns a *Service or an error. When and error occured during the parsing of a line, it is of type *ParseError.

Jump to

Keyboard shortcuts

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