expression

package
v0.0.0-...-2bc12df Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func And

func And(p1 rql.ASTNode, p2 rql.ASTNode) rql.ASTNode

func Atom

func Atom(p rql.ASTNode) rql.ASTNode

Atom wraps p into a type that works with predicate expressions. The RQL will use this to call p's appropriate Eval* methods, where each Eval* method implements its interface-specific semantics. For example, if p is a Primary and EntryPredicate, then the returned atom's EvalEntry method will be evaluated as a.EvalEntry(e) == p.EntryInDomain(e) && p.EvalEntry(e). Front-end interfaces to the RQL should always use the Atom type when testing their parsed predicates to ensure correct evaluation semantics.

If you'd like to see where Atoms are being used, then check out expression.go.

func New

func New(ptype string, negatable bool, g PtypeGenerator) rql.ASTNode

New returns a new predicate expression (PE) of 'ptype' predicates if negatable is false, otherwise it returns a new negatable predicate expression (NPE) of 'ptype' predicates.

The AtomGenerator should generate "empty" structs representing a 'ptype' predicate.

A PE is described by the following grammar:

PE := AND(PE, PE) | OR(PE, PE) | Atom(ptype)

An NPE is described by the following grammar:

NPE := NOT(NPE) | AND(NPE, NPE) | OR(NPE, NPE) | Atom(ptype)

func Not

func Not(p rql.ASTNode) rql.ASTNode

func Or

func Or(p1 rql.ASTNode, p2 rql.ASTNode) rql.ASTNode

Types

type PtypeGenerator

type PtypeGenerator func() rql.ASTNode

Jump to

Keyboard shortcuts

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