souffle
2.0.2-371-g6315b36
|
The program class consists of relations, clauses and types. More...
#include <Program.h>
Public Member Functions | |
void | addClause (Own< Clause > clause) |
Add a clause. More... | |
void | addDirective (Own< Directive > directive) |
Add relation directive. More... | |
void | addRelation (Own< Relation > relation) |
void | addType (Own< Type > type) |
Add a type declaration. More... | |
void | apply (const NodeMapper &map) override |
Apply the mapper to all child nodes. More... | |
void | clearComponents () |
Remove components and components' instantiations. More... | |
Program * | clone () const override |
Create a clone (i.e. More... | |
std::vector< const Node * > | getChildNodes () const override |
Obtain a list of all embedded AST child nodes. More... | |
std::vector< Clause * > | getClauses () const |
Return clauses. More... | |
std::vector< ComponentInit * > | getComponentInstantiations () const |
Return component instantiation. More... | |
std::vector< Component * > | getComponents () const |
Return components. More... | |
std::vector< Directive * > | getDirectives () const |
Return relation directives. More... | |
std::vector< FunctorDeclaration * > | getFunctorDeclarations () const |
Return functor declarations. More... | |
const VecOwn< Pragma > & | getPragmaDirectives () const |
Return pragma directives. More... | |
std::vector< Relation * > | getRelations () const |
Return relations. More... | |
std::vector< Type * > | getTypes () const |
Return types. More... | |
bool | removeClause (const Clause *clause) |
Remove a clause. More... | |
bool | removeDirective (const Directive *directive) |
Remove a directive. More... | |
bool | removeRelationDecl (const QualifiedName &name) |
Remove relation. More... | |
void | setClauses (VecOwn< Clause > newClauses) |
Set clauses. More... | |
Public Member Functions inherited from souffle::ast::Node | |
std::string | extloc () const |
Return source location of the syntactic element. More... | |
const SrcLocation & | getSrcLoc () const |
Return source location of the Node. More... | |
Node (SrcLocation loc={}) | |
bool | operator!= (const Node &other) const |
Inequality check for two AST nodes. More... | |
bool | operator== (const Node &other) const |
Equivalence check for two AST nodes. More... | |
void | setSrcLoc (SrcLocation l) |
Set source location for the Node. More... | |
virtual | ~Node ()=default |
Protected Member Functions | |
void | addComponent (Own< Component > component) |
Add component. More... | |
void | addFunctorDeclaration (Own< FunctorDeclaration > functor) |
void | addInstantiation (Own< ComponentInit > instantiation) |
Add component instantiation. More... | |
void | addPragma (Own< Pragma > pragma) |
bool | equal (const Node &node) const override |
Abstract equality check for two AST nodes. More... | |
void | print (std::ostream &os) const override |
Output to a given output stream. More... | |
Protected Attributes | |
VecOwn< Clause > | clauses |
Program clauses. More... | |
VecOwn< Component > | components |
Component definitions. More... | |
VecOwn< Directive > | directives |
Directives. More... | |
VecOwn< FunctorDeclaration > | functors |
External Functors. More... | |
VecOwn< ComponentInit > | instantiations |
Component instantiations. More... | |
VecOwn< Pragma > | pragmas |
Pragmas. More... | |
VecOwn< Relation > | relations |
Program relations. More... | |
VecOwn< Type > | types |
Program types More... | |
Friends | |
class | souffle::ParserDriver |
The program class consists of relations, clauses and types.
Add a clause.
Definition at line 62 of file Program.cpp.
References clauses.
Referenced by souffle::ParserDriver::addClause().
Add component.
Definition at line 248 of file Program.h.
References components.
Referenced by souffle::ParserDriver::addComponent().
Add relation directive.
Definition at line 80 of file Program.h.
References directives.
Referenced by souffle::ParserDriver::addDirective().
|
protected |
Definition at line 100 of file Program.cpp.
Referenced by souffle::ParserDriver::addFunctorDeclaration().
|
inlineprotected |
Add component instantiation.
Definition at line 254 of file Program.h.
References instantiations.
Referenced by souffle::ParserDriver::addInstantiation().
Definition at line 95 of file Program.cpp.
Referenced by souffle::ParserDriver::addPragma().
Definition at line 43 of file Program.cpp.
References rel(), and relations.
Referenced by souffle::ParserDriver::addRelation().
Add a type declaration.
Definition at line 88 of file Program.cpp.
Referenced by souffle::ParserDriver::addType().
|
inlineoverridevirtual |
Apply the mapper to all child nodes.
Reimplemented from souffle::ast::Node.
Definition at line 139 of file Program.h.
References clauses, components, directives, functors, instantiations, souffle::map(), pragmas, relations, and types.
void souffle::ast::Program::clearComponents | ( | ) |
Remove components and components' instantiations.
Definition at line 107 of file Program.cpp.
|
inlineoverridevirtual |
Create a clone (i.e.
deep copy) of this node
Implements souffle::ast::Node.
Definition at line 126 of file Program.h.
References clauses, souffle::clone(), components, directives, functors, instantiations, pragmas, relations, and types.
|
inlineoverrideprotectedvirtual |
Abstract equality check for two AST nodes.
Reimplemented from souffle::ast::Node.
Definition at line 211 of file Program.h.
References clauses, components, directives, souffle::equal_targets(), functors, instantiations, pragmas, relations, and types.
|
inlineoverridevirtual |
Obtain a list of all embedded AST child nodes.
Reimplemented from souffle::ast::Node.
Definition at line 166 of file Program.h.
References clauses, components, directives, functors, instantiations, pragmas, relations, and types.
|
inline |
Return clauses.
Definition at line 65 of file Program.h.
References clauses, and souffle::toPtrVector().
Referenced by souffle::ast::getRecords().
|
inline |
Return component instantiation.
Definition at line 119 of file Program.h.
References instantiations, and souffle::toPtrVector().
|
inline |
Return components.
Definition at line 114 of file Program.h.
References components, and souffle::toPtrVector().
|
inline |
Return relation directives.
Definition at line 75 of file Program.h.
References directives, and souffle::toPtrVector().
Referenced by souffle::ParserDriver::addDirective(), and souffle::ast::transform::IODefaultsTransformer::transform().
|
inline |
Return functor declarations.
Definition at line 70 of file Program.h.
References functors, and souffle::toPtrVector().
Referenced by souffle::ParserDriver::addFunctorDeclaration().
|
inline |
Return relations.
Definition at line 60 of file Program.h.
References relations, and souffle::toPtrVector().
Referenced by souffle::ast::transform::SemanticCheckerImpl::SemanticCheckerImpl(), and souffle::ast::transform::test::TEST().
|
inline |
Return types.
Definition at line 55 of file Program.h.
References souffle::toPtrVector(), and types.
Referenced by souffle::ParserDriver::addType().
|
inlineoverrideprotectedvirtual |
Output to a given output stream.
Implements souffle::ast::Node.
Definition at line 196 of file Program.h.
References clauses, components, directives, functors, instantiations, souffle::join(), pragmas, relations, and types.
bool souffle::ast::Program::removeClause | ( | const Clause * | clause | ) |
bool souffle::ast::Program::removeDirective | ( | const Directive * | directive | ) |
Remove a directive.
Definition at line 78 of file Program.cpp.
bool souffle::ast::Program::removeRelationDecl | ( | const QualifiedName & | name | ) |
|
friend |
Program clauses.
Definition at line 269 of file Program.h.
Referenced by addClause(), apply(), clone(), equal(), getChildNodes(), getClauses(), print(), and setClauses().
Component definitions.
Definition at line 275 of file Program.h.
Referenced by addComponent(), apply(), clone(), equal(), getChildNodes(), getComponents(), and print().
Directives.
Definition at line 272 of file Program.h.
Referenced by addDirective(), apply(), clone(), equal(), getChildNodes(), getDirectives(), and print().
|
protected |
External Functors.
Definition at line 266 of file Program.h.
Referenced by apply(), clone(), equal(), getChildNodes(), getFunctorDeclarations(), and print().
|
protected |
Component instantiations.
Definition at line 278 of file Program.h.
Referenced by addInstantiation(), apply(), clone(), equal(), getChildNodes(), getComponentInstantiations(), and print().
Pragmas.
Definition at line 281 of file Program.h.
Referenced by apply(), clone(), equal(), getChildNodes(), getPragmaDirectives(), and print().
Program relations.
Definition at line 263 of file Program.h.
Referenced by addRelation(), apply(), clone(), equal(), getChildNodes(), getRelations(), and print().
Program types
Definition at line 260 of file Program.h.
Referenced by apply(), clone(), equal(), getChildNodes(), getTypes(), and print().