cge

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const CGEVersion = "0.4"

Variables

This section is empty.

Functions

func Parse

func Parse(source io.Reader) (Metadata, []Object, []error)

Types

type Metadata

type Metadata struct {
	Name       string
	Comments   []string
	CGEVersion string
}

type Object

type Object struct {
	Comments   []string
	Type       TokenType
	Name       string
	Properties []Property
}

func (Object) String

func (o Object) String() string

type ObjectType

type ObjectType string

type ParseError

type ParseError struct {
	Token   Token
	Message string
	Line    []rune
}

func (ParseError) Error

func (p ParseError) Error() string

type Property

type Property struct {
	Comments []string
	Name     string
	Type     *PropertyType
}

func (Property) String

func (o Property) String() string

type PropertyType

type PropertyType struct {
	Token   Token
	Generic *PropertyType
}

type ScanError

type ScanError struct {
	Line     int
	LineText []rune
	Column   int
	Message  string
}

func (ScanError) Error

func (s ScanError) Error() string

type Token

type Token struct {
	Type   TokenType
	Lexeme string
	Line   int
	Column int
}

type TokenType

type TokenType string
const (
	NAME    TokenType = "NAME"
	VERSION TokenType = "VERSION"

	CONFIG  TokenType = "CONFIG"
	COMMAND TokenType = "COMMAND"
	EVENT   TokenType = "EVENT"
	TYPE    TokenType = "TYPE"
	ENUM    TokenType = "ENUM"

	STRING  TokenType = "STRING"
	BOOL    TokenType = "BOOL"
	INT32   TokenType = "INT32"
	INT64   TokenType = "INT64"
	BIGINT  TokenType = "BIGINT"
	FLOAT32 TokenType = "FLOAT32"
	FLOAT64 TokenType = "FLOAT64"

	MAP  TokenType = "MAP"
	LIST TokenType = "LIST"

	IDENTIFIER     TokenType = "IDENTIFIER"
	VERSION_NUMBER TokenType = "VERSION_NUMBER"

	OPEN_CURLY  TokenType = "OPEN_CURLY"
	CLOSE_CURLY TokenType = "CLOSE_CURLY"
	COLON       TokenType = "COLON"
	COMMA       TokenType = "COMMA"
	GREATER     TokenType = "GREATER"
	LESS        TokenType = "LESS"

	COMMENT TokenType = "COMMENT"

	EOF TokenType = "EOF"
)

Jump to

Keyboard shortcuts

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