ast

package
v0.0.0-...-82f5664 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Brace

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

func NewBrace

func NewBrace(start, end *Pos, lr LR) *Brace

func NewLBrace

func NewLBrace(start, end *Pos) *Brace

func NewRBrace

func NewRBrace(start, end *Pos) *Brace

func (*Brace) End

func (d *Brace) End() *Pos

func (*Brace) MarshalJSON

func (d *Brace) MarshalJSON() ([]byte, error)

func (*Brace) Name

func (d *Brace) Name() string

func (*Brace) Start

func (d *Brace) Start() *Pos

type Colon

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

func NewColon

func NewColon(start, end *Pos) *Colon

func (*Colon) End

func (d *Colon) End() *Pos

func (*Colon) MarshalJSON

func (d *Colon) MarshalJSON() ([]byte, error)

func (*Colon) Name

func (d *Colon) Name() string

func (*Colon) Start

func (d *Colon) Start() *Pos

type Const

type Const struct {
	Keyword *Keyword `json:"keyword"`
	Type    *Ident   `json:"type"`
	Name    *Ident   `json:"name"`
	Equal   *Equal   `json:"equal"`
	Value   Value    `json:"value"`
}

func NewConst

func NewConst(start, end *Pos) *Const

func (*Const) End

func (c *Const) End() *Pos

func (*Const) MarshalJSON

func (n *Const) MarshalJSON() ([]byte, error)

func (*Const) Start

func (c *Const) Start() *Pos

type Dot

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

func NewDot

func NewDot(start, end *Pos) *Dot

func (*Dot) End

func (d *Dot) End() *Pos

func (*Dot) MarshalJSON

func (d *Dot) MarshalJSON() ([]byte, error)

func (*Dot) Name

func (d *Dot) Name() string

func (*Dot) Start

func (d *Dot) Start() *Pos

type Equal

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

func NewEqual

func NewEqual(start, end *Pos) *Equal

func (*Equal) End

func (e *Equal) End() *Pos

func (*Equal) MarshalJSON

func (e *Equal) MarshalJSON() ([]byte, error)

func (*Equal) Start

func (e *Equal) Start() *Pos

type Expression

type Expression interface {
	Start() *Pos
	End() *Pos
}

type Field

type Field struct {
	ID           *Int   `json:"id"`
	Colon        *Colon `json:"colon"`
	Req          *Req   `json:"req"`
	Type         *Ident `json:"type"`
	Name         *Ident `json:"name"`
	Equal        *Equal `json:"equal"`
	DefaultValue Value  `json:"default_value"`
}

func NewField

func NewField() *Field

func (*Field) End

func (c *Field) End() *Pos

func (*Field) MarshalJSON

func (n *Field) MarshalJSON() ([]byte, error)

func (*Field) Start

func (c *Field) Start() *Pos

type Float

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

func NewFloat

func NewFloat(start, end *Pos, name string) *Float

func (*Float) End

func (s *Float) End() *Pos

func (*Float) MarshalJSON

func (s *Float) MarshalJSON() ([]byte, error)

func (*Float) Name

func (s *Float) Name() string

func (*Float) Start

func (s *Float) Start() *Pos

func (*Float) Type

func (s *Float) Type() string

type Ident

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

func NewIdent

func NewIdent(start, end *Pos, name string) *Ident

func (*Ident) Append

func (i *Ident) Append(j Token) *Ident

func (*Ident) End

func (i *Ident) End() *Pos

func (*Ident) MarshalJSON

func (i *Ident) MarshalJSON() ([]byte, error)

func (*Ident) Name

func (i *Ident) Name() string

func (*Ident) Start

func (i *Ident) Start() *Pos

func (*Ident) Type

func (i *Ident) Type() string

type Include

type Include struct {
	Keyword *Keyword `json:"keyword"`
	Name    *Ident   `json:"name"`
	Path    *String  `json:"path"`
}

func NewInclude

func NewInclude(start, end *Pos) *Include

func (*Include) End

func (i *Include) End() *Pos

func (*Include) MarshalJSON

func (n *Include) MarshalJSON() ([]byte, error)

func (*Include) Start

func (i *Include) Start() *Pos

type Int

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

func NewInt

func NewInt(start, end *Pos, name string) *Int

func (*Int) End

func (s *Int) End() *Pos

func (*Int) MarshalJSON

func (s *Int) MarshalJSON() ([]byte, error)

func (*Int) Name

func (s *Int) Name() string

func (*Int) Start

func (s *Int) Start() *Pos

func (*Int) Type

func (s *Int) Type() string

type Keyword

type Keyword struct {
	Type  string `json:"type"`
	Start *Pos   `json:"start"`
	End   *Pos   `json:"end"`
}

func NewKeyword

func NewKeyword(t string, start, end *Pos) *Keyword

type LR

type LR int
const (
	Left LR = iota
	Right
)

type Namespace

type Namespace struct {
	Keyword *Keyword `json:"keyword"`
	Scope   *Ident   `json:"scope"`
	Name    *Ident   `json:"name"`
}

func NewNamespace

func NewNamespace(start, end *Pos) *Namespace

func (*Namespace) End

func (n *Namespace) End() *Pos

func (*Namespace) MarshalJSON

func (n *Namespace) MarshalJSON() ([]byte, error)

func (*Namespace) Start

func (n *Namespace) Start() *Pos

type Pos

type Pos struct {
	Offset int
	Line   int
	Column int
}

func NewPos

func NewPos(p scanner.Position) *Pos

func (*Pos) MarshalJSON

func (p *Pos) MarshalJSON() ([]byte, error)

func (*Pos) String

func (p *Pos) String() string

type Program

type Program struct {
	Expressions []Expression `json:"expressions"`
}

func (*Program) MarshalJSON

func (p *Program) MarshalJSON() ([]byte, error)

func (*Program) Type

func (p *Program) Type() string

type RO

type RO int
const (
	Required RO = iota
	Optional
)

type Req

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

func NewOptional

func NewOptional(start, end *Pos) *Req

func NewReq

func NewReq(start, end *Pos, ro RO) *Req

func NewRequired

func NewRequired(start, end *Pos) *Req

func (*Req) End

func (d *Req) End() *Pos

func (*Req) MarshalJSON

func (d *Req) MarshalJSON() ([]byte, error)

func (*Req) Name

func (d *Req) Name() string

func (*Req) Start

func (d *Req) Start() *Pos

type String

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

func NewString

func NewString(start, end *Pos, name string) *String

func (*String) End

func (s *String) End() *Pos

func (*String) MarshalJSON

func (s *String) MarshalJSON() ([]byte, error)

func (*String) Name

func (s *String) Name() string

func (*String) Start

func (s *String) Start() *Pos

func (*String) Type

func (s *String) Type() string

type Struct

type Struct struct {
	Keyword *Keyword `json:"keyword"`
	Name    *Ident   `json:"name"`
	LBrace  *Brace   `json:"lbrace"`
	Fields  []*Field `json:"fields"`
	RBrace  *Brace   `json:"rbrace"`
}

func NewStruct

func NewStruct(start, end *Pos) *Struct

func (*Struct) End

func (n *Struct) End() *Pos

func (*Struct) MarshalJSON

func (n *Struct) MarshalJSON() ([]byte, error)

func (*Struct) Start

func (n *Struct) Start() *Pos

type Token

type Token interface {
	Expression
	Name() string
}

type Typedef

type Typedef struct {
	Keyword        *Keyword `json:"keyword"`
	DefinitionType *Ident   `json:"definition_type"`
	Identifier     *Ident   `json:"identifier"`
}

func NewTypedef

func NewTypedef(start, end *Pos) *Typedef

func (*Typedef) End

func (t *Typedef) End() *Pos

func (*Typedef) MarshalJSON

func (t *Typedef) MarshalJSON() ([]byte, error)

func (*Typedef) Start

func (t *Typedef) Start() *Pos

type Value

type Value interface {
	Start() *Pos
	End() *Pos
}

Jump to

Keyboard shortcuts

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