ast

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize

func Normalize(r *AST) error

Normalize takes the raw ast from the parser and updates it state so it's ready to be rendered

Types

type AST

type AST struct {
	Entities []*Entity
	Views    []*Entity
}

func (*AST) FindEntity

func (a *AST) FindEntity(name string) (*Entity, error)

type Attribute

type Attribute struct {
	Name            string
	InverseName     string
	Identity        bool
	InverseIdentity bool
	Unique          bool
	Type            Type
}

func (*Attribute) Resolve

func (a *Attribute) Resolve() []ResolvedAttribute

type Attributes

type Attributes []*Attribute

func (Attributes) NoAuto

func (a Attributes) NoAuto() Attributes

func (Attributes) NoIDs

func (a Attributes) NoIDs() Attributes

func (Attributes) NoReferences

func (a Attributes) NoReferences() Attributes

func (Attributes) OnlyAuto

func (a Attributes) OnlyAuto() Attributes

func (Attributes) OnlyIDs

func (a Attributes) OnlyIDs() Attributes

func (Attributes) OnlyReferences

func (a Attributes) OnlyReferences() Attributes

func (Attributes) OnlyUnique

func (a Attributes) OnlyUnique() Attributes

func (Attributes) Resolve

func (a Attributes) Resolve() []ResolvedAttribute

type Bool

type Bool struct {
}

func (*Bool) IsAuto

func (b *Bool) IsAuto() bool

func (*Bool) String

func (b *Bool) String() string

type Entity

type Entity struct {
	Name     string
	Comments []string
	IsView   bool

	// Attributes are all attributes defined on this entity including ID
	Attributes Attributes

	InverseAttributes Attributes
}

func (*Entity) HasSerialInCompositeIdentity added in v0.19.2

func (e *Entity) HasSerialInCompositeIdentity() bool

func (*Entity) SerialInCompositeIdentity added in v0.19.2

func (e *Entity) SerialInCompositeIdentity() ResolvedAttribute

type Enum

type Enum struct {
	Name   string
	Values []EnumValue
}

func (*Enum) IsAuto

func (e *Enum) IsAuto() bool

func (Enum) MaxLength

func (e Enum) MaxLength() int

func (Enum) Short

func (e Enum) Short() string

func (*Enum) String

func (e *Enum) String() string

type EnumValue

type EnumValue struct {
	ID    string
	Value string
}

type Float

type Float struct {
}

func (*Float) IsAuto

func (f *Float) IsAuto() bool

func (*Float) String

func (f *Float) String() string

type Int

type Int struct {
}

func (*Int) IsAuto

func (i *Int) IsAuto() bool

func (*Int) String

func (i *Int) String() string

type Reference

type Reference struct {
	Entity *Entity
	// contains filtered or unexported fields
}

func MkReference

func MkReference(name string) *Reference

func (*Reference) IsAuto

func (r *Reference) IsAuto() bool

func (*Reference) String

func (r *Reference) String() string

type ResolvedAttribute

type ResolvedAttribute []*Attribute

func (ResolvedAttribute) Attribute

func (ra ResolvedAttribute) Attribute() *Attribute

func (ResolvedAttribute) Name

func (ra ResolvedAttribute) Name() string

func (ResolvedAttribute) Type

func (ra ResolvedAttribute) Type() Type

type Serial

type Serial struct {
}

func (*Serial) IsAuto

func (s *Serial) IsAuto() bool

func (*Serial) String

func (s *Serial) String() string

type String

type String struct {
}

func (*String) IsAuto

func (s *String) IsAuto() bool

func (*String) String

func (s *String) String() string

type Time

type Time struct {
}

func (*Time) IsAuto

func (t *Time) IsAuto() bool

func (*Time) String

func (t *Time) String() string

type Type

type Type interface {
	IsAuto() bool
	String() string
}

Jump to

Keyboard shortcuts

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