ast

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Expr

type Expr interface {
	// contains filtered or unexported methods
}

Expr represents abstract expression

type Field

type Field struct {
	Name  string
	Value Expr
}

Field represents structure field initialization

func NewField

func NewField(name string, value Expr) *Field

NewField creates new field

type Mapper

type Mapper struct {
	// Signature is a mapper signature (TODO: Make it an object)
	Signature string
	// Vars is a list of variable assignments
	Vars []Variable
	// Result is a final return statement
	Result Expr
}

Mapper represents mapper

type Package

type Package struct {
	Name    string
	Imports []string
	Mappers []*Mapper
}

Package represents package

type StructExpr

type StructExpr struct {
	Name      string
	Fields    []*Field
	IsPointer bool
}

StructExpr represents structure initialization expression

func NewStruct

func NewStruct(name string, fields ...*Field) *StructExpr

NewStruct creates structure initialization expression

func NewStructPtr

func NewStructPtr(name string, fields ...*Field) *StructExpr

NewStructPtr creates pointer to structure initialization expression

type ValueExpr

type ValueExpr struct {
	Value string
}

ValueExpr represents simple value expression

func NewValue

func NewValue(v string) *ValueExpr

NewValue creates new value expression

type Variable

type Variable struct {
	Name  string
	Value Expr
}

Variable represents local variable in a mapper

Jump to

Keyboard shortcuts

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