P4C
The P4 Compiler
 
Loading...
Searching...
No Matches
P4::ResolutionContext Class Reference

Visitor mixin for looking up names in enclosing scopes from the Visitor::Context. More...

Inheritance diagram for P4::ResolutionContext:

Public Member Functions

const IR::IDeclaration * getDeclaration (const IR::Path *path, bool notNull=false) const
 
const IR::IDeclaration * getDeclaration (const IR::This *, bool notNull=false) const
 
auto getDeclarations (const IR::INamespace *ns) const
 Returns the set of decls that exist in the given namespace.
 
auto getDeclsByName (const IR::INamespace *ns, cstring name) const
 Returns the set of decls with the given name that exist in the given namespace.
 
std::vector< const IR::IDeclaration * > resolve (const IR::ID &name, ResolutionType type) const
 Resolve references for name, restricted to type declarations.
 
virtual const IR::IDeclaration * resolvePath (const IR::Path *path, bool isType) const
 
const IR::Type * resolveType (const IR::Type *type) const
 Resolve a refrence to a type type.
 
const IR::IDeclaration * resolveUnique (const IR::ID &name, ResolutionType type, const IR::INamespace *=nullptr) const
 Resolve reference for name, restricted to type declarations, and expect one result.
 

Protected Member Functions

 ResolutionContext (bool ao)
 
std::vector< const IR::IDeclaration * > lookup (const IR::INamespace *ns, const IR::ID &name, ResolutionType type) const
 
std::vector< const IR::IDeclaration * > lookupMatchKind (const IR::ID &name) const
 
const IR::Vector< IR::Argument > * methodArguments (cstring name) const
 We are resolving a method call. Find the arguments from the context.
 

Protected Attributes

bool anyOrder
 

Detailed Description

Visitor mixin for looking up names in enclosing scopes from the Visitor::Context.

Member Function Documentation

◆ getDeclaration() [1/2]

const IR::IDeclaration * P4::ResolutionContext::getDeclaration ( const IR::Path * path,
bool notNull = false ) const
virtual

Implements P4::DeclarationLookup.

◆ getDeclaration() [2/2]

const IR::IDeclaration * P4::ResolutionContext::getDeclaration ( const IR::This * pointer,
bool notNull = false ) const
virtual

Implements P4::DeclarationLookup.

◆ resolvePath()

const IR::IDeclaration * P4::ResolutionContext::resolvePath ( const IR::Path * path,
bool isType ) const
virtual

Resolve path; if isType is true then resolution will only return type nodes.