souffle
2.0.2-371-g6315b36
|
Go to the documentation of this file.
28 Program& program = translationUnit.getProgram();
29 for (Component* component : program.getComponents()) {
36 nestedComponents[&cur].insert(nestedComponent);
37 enclosingComponent[nestedComponent] = &cur;
46 if (boundName.
empty()) {
53 while (searchScope !=
nullptr) {
55 if (cur->getComponentType()->getName() ==
toString(boundName)) {
61 searchScope = found->second;
63 searchScope =
nullptr;
70 if (cur->getComponentType()->getName() ==
toString(boundName)) {
const Component * getComponent(const Component *scope, const std::string &name, const TypeBinding &activeBinding) const
Performs a lookup operation for a component with the given name within the addressed scope.
void run(const TranslationUnit &translationUnit) override
run analysis for a Ast translation unit
std::set< const Component * > globalScopeComponents
const std::string & toString(const std::string &str)
A generic function converting strings into strings (trivial case).
bool empty() const
check for emptiness
static constexpr const char * name
Class that encapsulates std::map of types binding that comes from .init c = Comp<MyType> Type binding...
std::map< const Component *, std::set< const Component * > > nestedComponents
void visitDepthFirst(const Node &root, Visitor< R, Ps... > &visitor, Args &... args)
A utility function visiting all nodes within the ast rooted by the given node recursively in a depth-...
const QualifiedName & find(const QualifiedName &name) const
Returns binding for given name or empty string if such binding does not exist.
Qualified Name class defines fully/partially qualified names to identify objects in components.
std::vector< Component * > getComponents() const
Get components.
std::map< const Component *, const Component * > enclosingComponent