Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Atom ¶
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)