Module mycroft::ast [] [src]

The ast module defines the parsed form of the Mycroft language.

Structs

Clause

A Clause is one component of a unification query, specifying a predicate combined with restrictions over each variable

FieldType

FieldType describes how a particular field in a predicate will be stored and viewed

NamedField

A named field is a predicate field for those using the named style.

Predicate

A Predicate can essentially be seen as a fact-type declaration. It describes the types of each field of a particular relation, and prescribes how it is to be matched (by index or by name).

Program

A Program contains all parts of a Mycroft program, and is the basic unit to be handed to the code generator.

Query

A Query is a predefined question that can be asked of the database. Appropriate indexes and code to use them will be generated. It is formed as a unification query over several clauses.

Rule

A Rule is a triggered transition that will instantiate the head and insert it when the body is matched.

Enums

Fields

Fields contains either an ordered list of type names or a list of NamedFields. These are encoded separately at this stage to ensure that ordered predicates are only matched against ordered match clauses, and named predicates with named match clauses during translation to IR.

Match

A Match is the specifier for how to unify a particular field