ddptypes

package
v0.3.0-alpha Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INVALID  GrammaticalGender = -1
	MASKULIN                   = iota
	FEMININ
	NEUTRUM
)

Variables

This section is empty.

Functions

func IsList

func IsList(t Type) bool

func IsNumeric

func IsNumeric(t Type) bool

func IsPrimitive

func IsPrimitive(t Type) bool

func IsPrimitiveOrVoid

func IsPrimitiveOrVoid(t Type) bool

func IsStruct

func IsStruct(t Type) bool

func IsVoid

func IsVoid(t Type) bool

Types

type GrammaticalGender

type GrammaticalGender int

enum Type for the grammatical gender of a type

type ListType

type ListType struct {
	Underlying Type
}

func (ListType) Gender

func (ListType) Gender() GrammaticalGender

func (ListType) String

func (listType ListType) String() string

type ParameterType

type ParameterType struct {
	Type        Type
	IsReference bool
}

represents the type of a function parameter which may be a reference

func (ParameterType) String

func (paramType ParameterType) String() string

type PrimitiveType

type PrimitiveType int

enum type for primitive types (+ void)

const (
	ZAHL          PrimitiveType = iota // int64
	KOMMAZAHL                          // float64
	WAHRHEITSWERT                      // bool
	BUCHSTABE                          // int32
	TEXT                               // string
)

func (PrimitiveType) Gender

func (p PrimitiveType) Gender() GrammaticalGender

func (PrimitiveType) String

func (p PrimitiveType) String() string

type StructField

type StructField struct {
	// name of the field
	Name string
	// type of the field
	Type Type
}

represents a single field of a struct

type StructType

type StructType struct {
	// name of the struct
	Name string
	// grammatical gender of the struct name
	GramGender GrammaticalGender
	// fields of the struct
	// in order of declaration
	Fields []StructField
}

represents the type of a ddp struct

func (*StructType) Gender

func (t *StructType) Gender() GrammaticalGender

func (*StructType) String

func (t *StructType) String() string

type Type

type Type interface {
	// the grammatical Gender of the Type
	Gender() GrammaticalGender
	// string representation of the type (its name)
	String() string
}

holds information about a DDP-Type

func GetNestedUnderlying

func GetNestedUnderlying(typ Type) Type

gets the underlying type for nested lists if typ is not a list type typ is returned

type VoidType

type VoidType struct{}

func (VoidType) Gender

func (VoidType) Gender() GrammaticalGender

func (VoidType) String

func (VoidType) String() string

Jump to

Keyboard shortcuts

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