ast

package
v0.0.0-...-839bc5d Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IDENTIFIER ExpressionType = "identifier"
	INFLIX     ExpressionType = "inflix"

	AND Operator = "and"
	OR  Operator = "or"

	ACTION   RelationalReferenceType = "action"
	RELATION RelationalReferenceType = "relation"
)

Variables

This section is empty.

Functions

func IsDirectEntityReference

func IsDirectEntityReference(s RelationTypeStatement) bool

IsDirectEntityReference -

Types

type ActionStatement

type ActionStatement struct {
	Action              token.Token // token.ACTION
	Name                token.Token // token.IDENT
	ExpressionStatement Statement
}

ActionStatement -

func (*ActionStatement) String

func (ls *ActionStatement) String() string

String -

type EntityStatement

type EntityStatement struct {
	Entity             token.Token // token.ENTITY
	Name               token.Token // token.IDENT
	RelationStatements []Statement
	ActionStatements   []Statement
}

EntityStatement -

func (*EntityStatement) String

func (ls *EntityStatement) String() string

String -

type Expression

type Expression interface {
	Node

	IsInfix() bool
	GetType() ExpressionType
	// contains filtered or unexported methods
}

Expression -

type ExpressionStatement

type ExpressionStatement struct {
	Expression Expression
}

ExpressionStatement struct

func (*ExpressionStatement) String

func (es *ExpressionStatement) String() string

String -

type ExpressionType

type ExpressionType string

type Identifier

type Identifier struct {
	Prefix token.Token
	Idents []token.Token // token.IDENT
}

Identifier -

func (*Identifier) GetType

func (ls *Identifier) GetType() ExpressionType

GetType -

func (*Identifier) IsInfix

func (ls *Identifier) IsInfix() bool

IsInfix -

func (*Identifier) IsPrefix

func (ls *Identifier) IsPrefix() bool

IsPrefix -

func (*Identifier) String

func (ls *Identifier) String() string

String -

type InfixExpression

type InfixExpression struct {
	Op       token.Token // The operator token, e.g. and, or
	Left     Expression
	Operator Operator
	Right    Expression
}

InfixExpression -

func (*InfixExpression) GetType

func (ie *InfixExpression) GetType() ExpressionType

GetType -

func (*InfixExpression) IsInfix

func (ie *InfixExpression) IsInfix() bool

IsInfix -

func (*InfixExpression) String

func (ie *InfixExpression) String() string

String -

type Node

type Node interface {
	String() string
}

Node -

type Operator

type Operator string

func (Operator) String

func (o Operator) String() string

String -

type RelationStatement

type RelationStatement struct {
	Relation      token.Token // token.RELATION
	Name          token.Token // token.IDENT
	RelationTypes []RelationTypeStatement
}

RelationStatement -

func (*RelationStatement) String

func (ls *RelationStatement) String() string

String -

type RelationTypeStatement

type RelationTypeStatement struct {
	Sign     token.Token // token.SIGN
	Type     token.Token // token.IDENT
	Relation token.Token // token.IDENT
}

RelationTypeStatement -

func (*RelationTypeStatement) String

func (ls *RelationTypeStatement) String() string

String -

type RelationalReferenceType

type RelationalReferenceType string

type Schema

type Schema struct {
	Statements []Statement
	// contains filtered or unexported fields
}

Schema - it contains all statements

func (*Schema) GetRelationReferenceIfExist

func (sch *Schema) GetRelationReferenceIfExist(name string) ([]RelationTypeStatement, bool)

GetRelationReferenceIfExist - it returns the relation reference

func (*Schema) GetRelationalReferenceTypeIfExist

func (sch *Schema) GetRelationalReferenceTypeIfExist(r string) (RelationalReferenceType, bool)

GetRelationalReferenceTypeIfExist - it returns the relational reference type

func (*Schema) IsEntityReferenceExist

func (sch *Schema) IsEntityReferenceExist(name string) bool

IsEntityReferenceExist - it checks if the entity reference exists

func (*Schema) IsRelationReferenceExist

func (sch *Schema) IsRelationReferenceExist(name string) bool

IsRelationReferenceExist - it checks if the relation reference exists

func (*Schema) IsRelationalReferenceExist

func (sch *Schema) IsRelationalReferenceExist(name string) bool

IsRelationalReferenceExist - it checks if the relational reference exists

func (*Schema) SetActionReferences

func (sch *Schema) SetActionReferences(r map[string]struct{})

SetActionReferences - it contains action references

func (*Schema) SetEntityReferences

func (sch *Schema) SetEntityReferences(r map[string]struct{})

SetEntityReferences - it contains entity references

func (*Schema) SetRelationReferences

func (sch *Schema) SetRelationReferences(r map[string][]RelationTypeStatement)

SetRelationReferences - it contains relation references

func (*Schema) SetRelationalReferences

func (sch *Schema) SetRelationalReferences(r map[string]RelationalReferenceType)

SetRelationalReferences it contains action and relation references

func (*Schema) Validate

func (sch *Schema) Validate() error

Validate - validate schema

type Statement

type Statement interface {
	Node
	// contains filtered or unexported methods
}

Statement -

Jump to

Keyboard shortcuts

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