Envision
A visual programming IDE for object-oriented languages
List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends
InformationScripting::AstQuery Class Reference
Inheritance diagram for InformationScripting::AstQuery:
InformationScripting::LinearQuery InformationScripting::Query

Public Member Functions

virtual Optional< TupleSetexecuteLinear (TupleSet input) override
 
- Public Member Functions inherited from InformationScripting::LinearQuery
 LinearQuery (Model::Node *target=nullptr)
 
virtual QList< Optional< TupleSet > > execute (QList< TupleSet > input) override
 
- Public Member Functions inherited from InformationScripting::Query
 Query (Model::Node *target=nullptr)
 
virtual ~Query ()=default
 
bool hasInput () const
 
virtual void setHasInput ()
 
Model::Nodetarget () const
 

Static Public Member Functions

static void registerDefaultQueries ()
 

Private Types

using ExecuteFunction = std::function< Optional< TupleSet >(AstQuery *, TupleSet)>
 

Private Member Functions

 AstQuery (Model::Node *target, QStringList args, ExecuteFunction exec, std::vector< ArgumentRule > argumentRules={})
 
void addBaseEdgesFor (OOModel::Class *childClass, NamedProperty &classNode, TupleSet &ts)
 
template<typename Predicate >
void addNodesForWhich (TupleSet &ts, Predicate holds, Model::Node *from=nullptr)
 
void addNodesOfType (TupleSet &ts, const Model::SymbolMatcher &matcher, Model::Node *from=nullptr, bool topLevelNodeOnly=false)
 
Optional< TupleSetattribute (TupleSet input)
 
Optional< TupleSetbaseClassesQuery (TupleSet input)
 
Optional< TupleSetcallGraph (TupleSet input)
 
Optional< TupleSetdefintionsQuery (TupleSet input)
 
Optional< TupleSetgenericQuery (TupleSet input)
 
Optional< TupleSetnameQuery (TupleSet input, QString name)
 
void outputAsAST (TupleSet &tupleSet, const QString &relationName, const QStringList &keepProperties)
 
Optional< TupleSettoParentType (TupleSet input)
 
Optional< TupleSettypeFilter (TupleSet input)
 
Optional< TupleSettypeQuery (TupleSet input, QString type)
 
Optional< TupleSetusagesQuery (TupleSet input)
 

Static Private Member Functions

static void addCallInformation (TupleSet &ts, OOModel::Method *method, QList< OOModel::Method * > callees)
 
static bool matchesExpectedType (Model::Node *node, Model::Node::SymbolType symbolType, const QString &expectedType, const QStringList &args)
 

Private Attributes

ArgumentParser arguments_
 
ExecuteFunction exec_ {}
 

Static Private Attributes

static const QStringList ATTRIBUTE_NAME_NAMES {"at", "attribute"}
 
static const QStringList NAME_ARGUMENT_NAMES {"n", "name"}
 
static const QStringList NODES_ARGUMENT_NAMES {"nodes"}
 
static const QStringList NODETYPE_ARGUMENT_NAMES {"t", "type"}
 
static const QStringList RELATION_ARGUMENT_NAMES {"r", "relation"}
 
static const QStringList TOP_LEVEL_ARGUMENT_NAMES {"tl", "topLevel"}
 

Friends

class QueryRegistry
 

Member Typedef Documentation

◆ ExecuteFunction

Constructor & Destructor Documentation

◆ AstQuery()

InformationScripting::AstQuery::AstQuery ( Model::Node target,
QStringList  args,
ExecuteFunction  exec,
std::vector< ArgumentRule argumentRules = {} 
)
private

Member Function Documentation

◆ addBaseEdgesFor()

void InformationScripting::AstQuery::addBaseEdgesFor ( OOModel::Class childClass,
NamedProperty classNode,
TupleSet ts 
)
private

◆ addCallInformation()

void InformationScripting::AstQuery::addCallInformation ( TupleSet ts,
OOModel::Method method,
QList< OOModel::Method * >  callees 
)
staticprivate

◆ addNodesForWhich()

template<typename Predicate >
void InformationScripting::AstQuery::addNodesForWhich ( TupleSet ts,
Predicate  holds,
Model::Node from = nullptr 
)
private

◆ addNodesOfType()

void InformationScripting::AstQuery::addNodesOfType ( TupleSet ts,
const Model::SymbolMatcher matcher,
Model::Node from = nullptr,
bool  topLevelNodeOnly = false 
)
private

◆ attribute()

Optional< TupleSet > InformationScripting::AstQuery::attribute ( TupleSet  input)
private

◆ baseClassesQuery()

Optional< TupleSet > InformationScripting::AstQuery::baseClassesQuery ( TupleSet  input)
private

◆ callGraph()

Optional< TupleSet > InformationScripting::AstQuery::callGraph ( TupleSet  input)
private

◆ defintionsQuery()

Optional< TupleSet > InformationScripting::AstQuery::defintionsQuery ( TupleSet  input)
private

◆ executeLinear()

Optional< TupleSet > InformationScripting::AstQuery::executeLinear ( TupleSet  input)
overridevirtual

◆ genericQuery()

Optional< TupleSet > InformationScripting::AstQuery::genericQuery ( TupleSet  input)
private

◆ matchesExpectedType()

bool InformationScripting::AstQuery::matchesExpectedType ( Model::Node node,
Model::Node::SymbolType  symbolType,
const QString &  expectedType,
const QStringList &  args 
)
staticprivate

◆ nameQuery()

Optional< TupleSet > InformationScripting::AstQuery::nameQuery ( TupleSet  input,
QString  name 
)
private

◆ outputAsAST()

void InformationScripting::AstQuery::outputAsAST ( TupleSet tupleSet,
const QString &  relationName,
const QStringList &  keepProperties 
)
private

◆ registerDefaultQueries()

void InformationScripting::AstQuery::registerDefaultQueries ( )
static

◆ toParentType()

Optional< TupleSet > InformationScripting::AstQuery::toParentType ( TupleSet  input)
private

◆ typeFilter()

Optional< TupleSet > InformationScripting::AstQuery::typeFilter ( TupleSet  input)
private

◆ typeQuery()

Optional< TupleSet > InformationScripting::AstQuery::typeQuery ( TupleSet  input,
QString  type 
)
private

◆ usagesQuery()

Optional< TupleSet > InformationScripting::AstQuery::usagesQuery ( TupleSet  input)
private

Friends And Related Function Documentation

◆ QueryRegistry

friend class QueryRegistry
friend

Member Data Documentation

◆ arguments_

ArgumentParser InformationScripting::AstQuery::arguments_
private

◆ ATTRIBUTE_NAME_NAMES

const QStringList InformationScripting::AstQuery::ATTRIBUTE_NAME_NAMES {"at", "attribute"}
staticprivate

◆ exec_

ExecuteFunction InformationScripting::AstQuery::exec_ {}
private

◆ NAME_ARGUMENT_NAMES

const QStringList InformationScripting::AstQuery::NAME_ARGUMENT_NAMES {"n", "name"}
staticprivate

◆ NODES_ARGUMENT_NAMES

const QStringList InformationScripting::AstQuery::NODES_ARGUMENT_NAMES {"nodes"}
staticprivate

◆ NODETYPE_ARGUMENT_NAMES

const QStringList InformationScripting::AstQuery::NODETYPE_ARGUMENT_NAMES {"t", "type"}
staticprivate

◆ RELATION_ARGUMENT_NAMES

const QStringList InformationScripting::AstQuery::RELATION_ARGUMENT_NAMES {"r", "relation"}
staticprivate

◆ TOP_LEVEL_ARGUMENT_NAMES

const QStringList InformationScripting::AstQuery::TOP_LEVEL_ARGUMENT_NAMES {"tl", "topLevel"}
staticprivate