adl

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAdlAST

func BuildAdlAST(str string) (ctree.Tree, antlr.Tree, *antlr.BaseLexer, antlr.TokenStream, errs)

func QTreeToken

func QTreeToken(tts antlr.TokenStream, p antlr.Recognizer)

func VisitADLWi added in v1.0.9

func VisitADLWi(tr ctree.Tree, vi antlr.ParseTreeVisitor) (antlr.Recognizer, errs)

func VisitAdlWo

func VisitAdlWo(tr ctree.Tree, vi antlr.ParseTreeVisitor) (antlr.Recognizer, errs)

func WalkADLWi added in v1.0.9

func WalkADLWi(tr ctree.Tree, list antlr.ParseTreeListener) (antlr.Recognizer, errs)

func WalkADLWo

func WalkADLWo(tr ctree.Tree, list antlr.ParseTreeListener) (antlr.Recognizer, errs)

Types

type ADL

type ADL struct {
	Modules []*Module
}

func (ADL) String

func (a ADL) String() string

type ADLBuildListener

type ADLBuildListener struct {
	*antlr.BaseParseTreeVisitor
	// contains filtered or unexported fields
}

func (*ADLBuildListener) EnterEveryRule

func (v *ADLBuildListener) EnterEveryRule(ctx antlr.ParserRuleContext)

EnterEveryRule is called when any rule is entered.

func (*ADLBuildListener) ExitEveryRule

func (v *ADLBuildListener) ExitEveryRule(ctx antlr.ParserRuleContext)

ExitEveryRule

type AnnotateAble

type AnnotateAble interface {
	AddAnnotation(an Annotation)
}

type Annotation

type Annotation struct {
	Key ScopedName  `json:"v1"`
	Val interface{} `json:"v2"`
}

func (*Annotation) Set

func (an *Annotation) Set(val interface{})

type Annotations

type Annotations []Annotation

func (*Annotations) AddAnnotation

func (ans *Annotations) AddAnnotation(an Annotation)

type Decl

type Decl struct {
	Name        string   `json:"name"`
	Version     *string  `json:"version,omitempty"`
	Type        DeclType `json:"type_"`
	Annotations `json:"annotations"`
}

func (Decl) String

func (m Decl) String() string

type DeclType

type DeclType struct {
	Struct  *Name    `json:"struct_,omitempty"`
	Union   *Name    `json:"union_,omitempty"`
	Type    *TypeDef `json:"type_,omitempty"`
	Newtype *NewType `json:"newtype_,omitempty"`
}

type DiagMessage

type DiagMessage interface {
	Line() int
	Column() int
	Message() string
	Len() int
	Text() string
}

type Error

type Error struct {
	ctree.TreeNode `json:"-"`
	Start, Stop    antlr.Token
	Expected       []string
	Received       string
	Annotations    `json:"annotations"`
}

func (Error) Column

func (er Error) Column() int

func (Error) Len

func (er Error) Len() int

func (Error) Line

func (er Error) Line() int

func (Error) Message

func (er Error) Message() string

func (*Error) SetTreeNode added in v1.0.8

func (er *Error) SetTreeNode(t ctree.TreeNode)

func (Error) Text

func (er Error) Text() string

type Field

type Field struct {
	Name           string      `json:"name"`
	SerializedName string      `json:"serializedName"`
	TypeExpr       TypeExpr    `json:"typeExpr"`
	Default        interface{} `json:"default,omitempty"`
	Annotations    `json:"annotations"`
}

type Import

type Import struct {
	ModuleName *string     `json:"moduleName,omitempty"`
	ScopedName *ScopedName `json:"scopedName,omitempty"`
}

func (Import) String

func (i Import) String() string

type ImportableAble

type ImportableAble interface {
	AddImport(Import)
}

type Json

type Json interface{}

type JsonArray

type JsonArray struct {
	JsonElems []Json
}

func (JsonArray) String

func (a JsonArray) String() string

type JsonNull

type JsonNull struct{}

func (JsonNull) String

func (a JsonNull) String() string

type JsonObj

type JsonObj struct {
	JsonObjs
}

type JsonObjs

type JsonObjs map[string]Json

type Module

type Module struct {
	Name        string          `json:"name"`
	Imports     []Import        `json:"imports"`
	Decls       map[string]Decl `json:"decls"`
	Annotations `json:"annotations"`
}

func (*Module) AddImport

func (mo *Module) AddImport(im Import)

func (Module) String

func (m Module) String() string

type Name

type Name struct {
	TypeParams []string `json:"typeParams"`
	Field      []Field  `json:"fields"`
}

Struct & Union

type NewType

type NewType struct {
	TypeParams []string    `json:"typeParams"`
	TypeExpr   TypeExpr    `json:"typeExpr"`
	Default    interface{} `json:"default,omitempty"`
}

type ScopedName

type ScopedName struct {
	ModuleName string `json:"moduleName"`
	Name       string `json:"name"`
}

type Setable

type Setable interface {
	Set(val interface{})
}

type TTType

type TTType struct{}

func (*TTType) Down

func (*TTType) Down() int

func (*TTType) Eof

func (*TTType) Eof() int

func (*TTType) Up

func (*TTType) Up() int

type TypeDef

type TypeDef struct {
	TypeParams []string `json:"typeParams"`
	TypeExpr   TypeExpr `json:"typeExpr"`
}

type TypeExpr

type TypeExpr struct {
	TypeRef    TypeRef    `json:"typeRef"`
	Parameters []TypeExpr `json:"parameters"`
}

type TypeRef

type TypeRef struct {
	Primitive *string     `json:"primitive,omitempty"`
	TypeParam *string     `json:"typeParam,omitempty"`
	Reference *ScopedName `json:"reference,omitempty"`
}

Directories

Path Synopsis
lsp

Jump to

Keyboard shortcuts

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