ast

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NodeType_names = map[NodeType]string{
	NodeType_RESERVED: "RESERVED",

	NodeType_STRUCT: "STRUCT",
	NodeType_ENUM:   "ENUM",
	NodeType_ALIAS:  "ALIAS",

	NodeType_RAWTYPE: "RAWTYPE",
}

Functions

This section is empty.

Types

type Alias

type Alias struct {
	StrType string
	Type    *Node
}

type Enum

type Enum struct {
	Enums []string
}

type Field

type Field struct {
	Name    string
	StrType string
	Type    *Node
}

type File

type File struct {
	Name  string
	Nodes []*Node

	Globals map[string]*Node
}

func NewFile

func NewFile(filename string) *File

type Node

type Node struct {
	Type NodeType
	Name string
	File string
	Line int
	Col  int

	Token lexer.Token

	// Struct
	Struct *Struct
	// Enum
	Enum *Enum
	// Alias
	Alias *Alias
	// RawType
	RawType *RawType
}

func NewNode

func NewNode(nodeType NodeType) *Node

type NodeType

type NodeType int
const (
	NodeType_RESERVED NodeType = iota

	NodeType_STRUCT
	NodeType_ENUM
	NodeType_ALIAS

	NodeType_RAWTYPE
)

func (NodeType) Printf

func (n NodeType) Printf(format string, a ...interface{}) string

func (NodeType) String

func (n NodeType) String() string

type RawType

type RawType struct {
	Type string
}

type Struct

type Struct struct {
	Fields []*Field
}

Jump to

Keyboard shortcuts

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