souffle
2.0.2-371-g6315b36
|
Abstract class for syntactic elements in an input program. More...
#include <Node.h>
Public Member Functions | |
virtual void | apply (const NodeMapper &) |
Apply the mapper to all child nodes. More... | |
virtual Node * | clone () const =0 |
Create a clone (i.e. More... | |
std::string | extloc () const |
Return source location of the syntactic element. More... | |
virtual std::vector< const Node * > | getChildNodes () const |
Obtain a list of all embedded AST child nodes. 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 | |
virtual bool | equal (const Node &) const |
Abstract equality check for two AST nodes. More... | |
virtual void | print (std::ostream &os) const =0 |
Output to a given output stream. More... | |
Private Attributes | |
SrcLocation | location |
Source location of a syntactic element. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Node &node) |
Print node onto an output stream. More... | |
|
inline |
|
virtualdefault |
|
inlinevirtual |
Apply the mapper to all child nodes.
Reimplemented in souffle::ast::Component, souffle::ast::ComponentInit, souffle::ast::Program, souffle::ast::Relation, souffle::ast::Clause, souffle::ast::Aggregator, souffle::ast::Atom, souffle::ast::ExecutionPlan, souffle::ast::TypeCast, souffle::ast::Term, and souffle::ast::Negation.
|
pure virtual |
Create a clone (i.e.
deep copy) of this node
Implemented in souffle::ast::Type, souffle::ast::Constant, souffle::ast::Literal, souffle::ast::Argument, souffle::ast::Functor, souffle::ast::Constraint, souffle::ast::Component, souffle::ast::Program, souffle::ast::Relation, souffle::ast::Directive, souffle::ast::Clause, souffle::ast::Aggregator, souffle::ast::FunctorDeclaration, souffle::ast::Atom, souffle::ast::ComponentInit, souffle::ast::TypeCast, souffle::ast::ComponentType, souffle::ast::IntrinsicFunctor, souffle::ast::ExecutionPlan, souffle::ast::NumericConstant, souffle::ast::Attribute, souffle::ast::BranchDeclaration, souffle::ast::Negation, souffle::ast::BranchInit, souffle::ast::UserDefinedFunctor, souffle::ast::ExecutionOrder, souffle::ast::Variable, souffle::ast::ProvenanceNegation, souffle::ast::SubroutineArgument, souffle::ast::RecordInit, souffle::ast::StringConstant, souffle::ast::Pragma, souffle::ast::NilConstant, souffle::ast::Counter, and souffle::ast::UnnamedVariable.
|
inlineprotectedvirtual |
Abstract equality check for two AST nodes.
Reimplemented in souffle::ast::Component, souffle::ast::Program, souffle::ast::Relation, souffle::ast::Clause, souffle::ast::Aggregator, souffle::ast::Directive, souffle::ast::IntrinsicFunctor, souffle::ast::FunctorDeclaration, souffle::ast::Atom, souffle::ast::ExecutionPlan, souffle::ast::ComponentInit, souffle::ast::NumericConstant, souffle::ast::TypeCast, souffle::ast::ComponentType, souffle::ast::Term, souffle::ast::UserDefinedFunctor, souffle::ast::Negation, souffle::ast::Attribute, souffle::ast::BranchInit, souffle::ast::ExecutionOrder, souffle::ast::Variable, souffle::ast::SubroutineArgument, souffle::ast::Pragma, and souffle::ast::Constant.
|
inline |
|
inlinevirtual |
Obtain a list of all embedded AST child nodes.
Reimplemented in souffle::ast::Component, souffle::ast::Program, souffle::ast::Relation, souffle::ast::Clause, souffle::ast::Atom, souffle::ast::ExecutionPlan, souffle::ast::Aggregator, souffle::ast::ComponentInit, souffle::ast::Negation, souffle::ast::TypeCast, and souffle::ast::Term.
|
inline |
Return source location of the Node.
Definition at line 46 of file Node.h.
Referenced by souffle::ast::BranchInit::BranchInit(), souffle::ast::TypeCast::getChildNodes(), souffle::ast::Negation::Negation(), souffle::ast::SubroutineArgument::SubroutineArgument(), souffle::ast::transform::PartitionBodyLiteralsTransformer::transform(), souffle::ast::transform::TypeCheckerImpl::visitStringConstant(), and souffle::ast::transform::TypeCheckerImpl::visitVariable().
|
inline |
|
inline |
Equivalence check for two AST nodes.
|
protectedpure virtual |
Output to a given output stream.
Implemented in souffle::ast::ExecutionPlan, souffle::ast::FunctorDeclaration, souffle::ast::ExecutionOrder, souffle::ast::Component, souffle::ast::Program, souffle::ast::Relation, souffle::ast::Clause, souffle::ast::Aggregator, souffle::ast::Directive, souffle::ast::Atom, souffle::ast::IntrinsicFunctor, souffle::ast::ComponentInit, souffle::ast::TypeCast, souffle::ast::ComponentType, souffle::ast::UserDefinedFunctor, souffle::ast::Negation, souffle::ast::Attribute, souffle::ast::BranchDeclaration, souffle::ast::BranchInit, souffle::ast::Variable, souffle::ast::ProvenanceNegation, souffle::ast::SubroutineArgument, souffle::ast::Pragma, souffle::ast::RecordInit, souffle::ast::StringConstant, souffle::ast::Constant, souffle::ast::Counter, and souffle::ast::UnnamedVariable.
|
inline |
|
friend |
|
private |