A walker that creates an AST. All Translate* methods have been overridden to remove the translation code.
Private Typedefs Summary: | |
std::vector<FuncImplCache> | FuncImplVec A vector of function impls [Source] |
std::vector<FuncImplVec> | FuncImplStack A stack of function impl vectors [Source] |
Private Structs Summary: | |
FuncImplCache Info about one stored function impl. [Source] |
Private Enums Summary: | |
Postfix_Flag | Postfix_Var, Postfix_Func The state of postfix translation. [Source] |
Private Member functions Summary: | |
int | find_col(const char* start, const char* find) Finds the column given the start ptr and the current position. [Source] |
Private Data members Summary: | |
SWalker* | g_swalker [Source] |
Parser* | m_parser [Source] |
Builder* | m_builder [Source] |
FileFilter* | m_filter [Source] |
Program* | m_program [Source] |
Decoder* | m_decoder [Source] |
Lookup* | m_lookup [Source] |
Ptree* | m_declaration A pointer to the currect declaration ptree, if any, used to get the return type and modifiers, etc. [Source] |
std::vector<AST::Parameter*>* | m_template A pointer to the current template parameters, if any, used to get the template parameters and set in the declaration. [Source] |
char* | m_filename_ptr This pointer is used as a comparison to avoid redundant effort. [Source] |
AST::SourceFile* | m_file The current file, set by update_line_number [Source] |
int | m_lineno [Source] |
bool | m_extract_tails True if should try and extract tail comments before }'s [Source] |
LinkStore* | m_links Storage for links. [Source] |
bool | m_store_decl True if this TranslateDeclarator should try to store the decl type [Source] |
std::vector<std::string> | m_dummyname A dummy name used for tail comments [Source] |
TypeFormatter* | m_type_formatter An instance of TypeFormatter for formatting types [Source] |
AST::Function* | m_function The current function, if in a function block [Source] |
std::vector<AST::Parameter*> | m_param_cache The params found before a function block. [Source] |
std::vector<Types::Type*> | m_params The types accumulated for function parameters in function calls [Source] |
Types::Type* | m_type The type returned from the expression-type translators [Source] |
AST::Scope* | m_scope The Scope to use for name lookups, or NULL to use enclosing default scope rules. [Source] |
Postfix_Flag | m_postfix_flag foo->var versus var or foo->var(). [Source] |
FuncImplStack | m_func_impl_stack The stack of function impl vectors [Source] |
Public Structs Inherited from Walker | |
NameScope |
Public Data members Inherited from Walker | |
argument_name |
Protected Member functions Inherited from Walker | |
LookupMetaclass |
Protected Data members Inherited from Walker | |
env |
Public Member function Details: |
Sets extract tails to true. This will cause the parser to create dummy declarations for comments before close braces or the end of the file
Sets store links to true. This will cause the whole ptree to be traversed, and any linkable identifiers found will be stored
Returns a formatter string of the parameters. The idea is that this string will be appended to the function name to form the 'name' of the function.
Private Enum Details: |
< Lookup as a variable
The state of postfix translation. This is needed for constructs like foo->var versus var or foo->var(). The function call resolution needs to be done in the final TranslateVariable, since that's where the last name (which is to be linked) is handled.
Private Member function Details: |
Finds the column given the start ptr and the current position. The derived column number is processed with the link_map before returning, so -1 may be returned to indicate "inside macro".
Private Data member Details: |
A pointer to the current template parameters, if any, used to get the template parameters and set in the declaration. Should be NULL if not in a template.
This pointer is used as a comparison to avoid redundant effort. Do not use it to get the filename, since the string is a reference to the preprocessed file in memory and is *not* null terminated!
Storage for links. This is only set if we should be storing links, so it must be checked before every use
The params found before a function block. These may be different from the ones that are in the original declaration(s), but it is these names we need for referencing names inside the block, so a reference is stored here.
The Scope to use for name lookups, or NULL to use enclosing default scope rules. This is for when we are at a Variable, and already know it must be part of a given class (eg, foo->bar .. bar must be in foo's class)
foo->var versus var or foo->var(). The function call resolution needs to be done in the final TranslateVariable, since that's where the last name (which is to be linked) is handled.