#include <cppParser.h>
Inheritance diagram for CPPParser:
Public Types | |
typedef vector< CPPDeclaration * > | Declarations |
typedef map< string, CPPType * > | ExtensionTypes |
typedef map< string, CPPNamespace * > | Namespaces |
typedef map< string, CPPTypedef * > | Typedefs |
typedef map< string, CPPInstance * > | Variables |
typedef map< string, CPPFunctionGroup * > | Functions |
typedef map< string, CPPDeclaration * > | Templates |
typedef map< string, CPPManifest * > | Manifests |
typedef set< CPPFile > | ParsedFiles |
typedef set< string > | Includes |
Public Member Functions | |
CPPParser () | |
virtual bool | is_fully_specified () const |
Returns true if this declaration is an actual, factual declaration, or false if some part of the declaration depends on a template parameter which has not yet been instantiated. | |
bool | parse_file (const string &filename) |
CPPExpression * | parse_expr (const string &expr) |
Given a string, expand all manifests within the string and evaluate it as an expression. | |
CPPType * | parse_type (const string &type) |
Given a string, interpret it as a type name and return the corresponding CPPType. | |
void | set_current_vis (CPPVisibility current_vis) |
CPPVisibility | get_current_vis () const |
void | set_struct_type (CPPStructType *struct_type) |
Sets the struct or class that owns this scope. | |
CPPStructType * | get_struct_type () const |
Returns the class or struct that defines this scope, if any. | |
CPPScope * | get_parent_scope () const |
Returns the parent scope of this scope, if any. | |
virtual void | add_declaration (CPPDeclaration *decl, CPPScope *global_scope, CPPPreprocessor *preprocessor, const cppyyltype &pos) |
virtual void | add_enum_value (CPPInstance *inst) |
virtual void | define_extension_type (CPPExtensionType *type) |
virtual void | define_namespace (CPPNamespace *scope) |
virtual void | add_using (CPPUsing *using_decl, CPPScope *global_scope, CPPPreprocessor *error_sink=NULL) |
CPPScope * | instantiate (const CPPTemplateParameterList *actual_params, CPPScope *current_scope, CPPScope *global_scope, CPPPreprocessor *error_sink=NULL) const |
CPPScope * | substitute_decl (CPPDeclaration::SubstDecl &subst, CPPScope *current_scope, CPPScope *global_scope) const |
CPPType * | find_type (const string &name, bool recurse=true) const |
CPPType * | find_type (const string &name, CPPDeclaration::SubstDecl &subst, CPPScope *global_scope, bool recurse=true) const |
CPPScope * | find_scope (const string &name, bool recurse=true) const |
CPPScope * | find_scope (const string &name, CPPDeclaration::SubstDecl &subst, CPPScope *global_scope, bool recurse=true) const |
CPPDeclaration * | find_symbol (const string &name, bool recurse=true) const |
CPPDeclaration * | find_template (const string &name, bool recurse=true) const |
virtual string | get_simple_name () const |
virtual string | get_local_name (CPPScope *scope=NULL) const |
virtual string | get_fully_scoped_name () const |
virtual void | output (ostream &out, CPPScope *scope) const |
void | write (ostream &out, int indent, CPPScope *scope) const |
CPPTemplateScope * | get_template_scope () |
Returns the nearest ancestor of this scope that is a template scope, or NULL if the scope is fully specified. | |
virtual CPPTemplateScope * | as_template_scope () |
void | set_verbose (int verbose) |
Sets the verbosity level of the parser. | |
int | get_verbose () const |
Returns the verbosity level of the parser. | |
void | copy_filepos (const CPPPreprocessor &other) |
CPPFile | get_file () const |
int | get_line_number () const |
int | get_col_number () const |
CPPToken | get_next_token () |
void | warning (const string &message, int line=0, int col=0, CPPFile file=CPPFile()) |
void | error (const string &message, int line=0, int col=0, CPPFile file=CPPFile()) |
CPPCommentBlock * | get_comment_before (int line, CPPFile file) |
Returns the CPPCommentBlock immediately preceding the indicated line, if any. | |
int | get_warning_count () const |
int | get_error_count () const |
Public Attributes | |
Declarations | _declarations |
ExtensionTypes | _structs |
ExtensionTypes | _classes |
ExtensionTypes | _unions |
ExtensionTypes | _enums |
Namespaces | _namespaces |
Typedefs | _typedefs |
Variables | _variables |
Variables | _enum_values |
Functions | _functions |
Templates | _templates |
CPPNameComponent | _name |
Manifests | _manifests |
DSearchPath | _include_path |
DSearchPath | _system_include_path |
CPPComments | _comments |
ParsedFiles | _parsed_files |
Includes | _quote_includes |
Includes | _angle_includes |
bool | _resolve_identifiers |
int | _verbose |
Protected Types | |
typedef set< CPPScope * > | Using |
Protected Member Functions | |
bool | init_cpp (const CPPFile &file) |
bool | init_const_expr (const string &expr) |
bool | init_type (const string &type) |
bool | push_file (const CPPFile &file) |
bool | push_string (const string &input, bool lock_position) |
string | expand_manifests (const string &input_expr) |
Given a string, expand all manifests within the string and return the new string. | |
CPPExpression * | parse_expr (const string &expr, CPPScope *current_scope, CPPScope *global_scope) |
Given a string, expand all manifests within the string and evaluate it as an expression. | |
Protected Attributes | |
CPPScope * | _parent_scope |
CPPStructType * | _struct_type |
Using | _using |
CPPVisibility | _current_vis |
|
Definition at line 126 of file cppScope.h. |
|
Definition at line 129 of file cppScope.h. |
|
Definition at line 143 of file cppScope.h. |
|
Definition at line 91 of file cppPreprocessor.h. |
|
Definition at line 80 of file cppPreprocessor.h. |
|
Definition at line 135 of file cppScope.h. |
|
Definition at line 88 of file cppPreprocessor.h. |
|
Definition at line 145 of file cppScope.h. |
|
Definition at line 138 of file cppScope.h. |
|
Definition at line 152 of file cppScope.h. |
|
Definition at line 140 of file cppScope.h. |
|
Definition at line 41 of file cppParser.cxx. |
|
Reimplemented in CPPTemplateScope. Definition at line 155 of file cppScope.cxx. References CPPScope::_enum_values. Referenced by CPPTemplateScope::CPPTemplateScope(). |
|
Reimplemented in CPPTemplateScope. Definition at line 181 of file cppScope.cxx. References CPPScope::_enums, CPPScope::_unions, and CPPExtensionType::T_enum. Referenced by CPPTemplateScope::add_declaration(). |
|
Reimplemented in CPPTemplateScope. Definition at line 279 of file cppScope.cxx. References CPPScope::_is_fully_specified. |
|
Reimplemented in CPPTemplateScope. Definition at line 907 of file cppScope.cxx. Referenced by CPPScope::get_fully_scoped_name(), and CPPScope::is_fully_specified(). |
|
Definition at line 255 of file cppPreprocessor.cxx. References CPPPreprocessor::_files. |
|
Reimplemented in CPPTemplateScope. Definition at line 198 of file cppScope.cxx. Referenced by CPPTemplateScope::add_enum_value(). |
|
Reimplemented in CPPTemplateScope. Definition at line 265 of file cppScope.cxx. Referenced by CPPTemplateScope::define_extension_type(). |
|
Definition at line 510 of file cppPreprocessor.cxx. References CPPPreprocessor::_error_count. Referenced by CPPIdentifier::get_scope(), and CPPIdentifier::is_tbd(). |
|
Given a string, expand all manifests within the string and return the new string.
Definition at line 731 of file cppPreprocessor.cxx. References CPPExpressionParser::_expr, CPPPreprocessor::_verbose, current_scope, global_scope, NULL, and CPPExpressionParser::parse_expr(). Referenced by CPPPreprocessor::handle_undef_directive(). |
|
Definition at line 642 of file cppScope.cxx. |
|
Definition at line 587 of file cppScope.cxx. References CPPStructType::_scope, CPPDeclaration::as_struct_type(), CPPScope::find_type(), global_scope, and NULL. Referenced by CPPIdentifier::get_scope(), and CPPIdentifier::is_fully_specified(). |
|
Definition at line 663 of file cppScope.cxx. References NULL. |
|
Definition at line 729 of file cppScope.cxx. References CPPScope::_parent_scope, CPPScope::get_local_name(), CPPNameComponent::get_name_with_templ(), and NULL. |
|
Definition at line 538 of file cppScope.cxx. References CPPScope::_namespaces. |
|
Definition at line 493 of file cppScope.cxx. References CPPScope::_typedefs, current_scope, global_scope, and CPPScope::substitute_decl(). Referenced by CPPScope::find_scope(), CPPIdentifier::get_scope(), and CPPScope::substitute_decl(). |
|
Definition at line 300 of file cppPreprocessor.cxx. References CPPPreprocessor::_saved_tokens. Referenced by CPPPreprocessor::handle_error_directive(), CPPPreprocessor::handle_include_directive(), CPPPreprocessor::init_const_expr(), and CPPPreprocessor::set_verbose(). |
|
Returns the CPPCommentBlock immediately preceding the indicated line, if any. If there is no such comment, returns NULL. Definition at line 571 of file cppPreprocessor.cxx. References CPPPreprocessor::_saved_tokens, CPPPreprocessor::_state, CPPPreprocessor::push_string(), and CPPPreprocessor::S_normal. Referenced by CPPScope::set_current_vis(). |
|
Definition at line 143 of file cppScope.cxx. |
|
Definition at line 554 of file cppPreprocessor.cxx. References CPPPreprocessor::_last_c, CPPPreprocessor::_saved_tokens, CPPPreprocessor::_state, CPPPreprocessor::push_file(), and CPPPreprocessor::S_normal. Referenced by is_fully_specified(), CPPExpressionParser::~CPPExpressionParser(), and CPPTypeParser::~CPPTypeParser(). |
|
Definition at line 270 of file cppPreprocessor.cxx. References CPPPreprocessor::_files. Referenced by CPPPreprocessor::handle_error_directive(), CPPPreprocessor::handle_include_directive(), CPPPreprocessor::init_const_expr(), and CPPPreprocessor::set_verbose(). |
|
Reimplemented in CPPTemplateScope. Definition at line 814 of file cppScope.cxx. References CPPScope::_parent_scope, CPPScope::as_template_scope(), CPPScope::get_template_scope(), and NULL. Referenced by CPPIdentifier::get_scope(), and CPPIdentifier::is_tbd(). |
|
Definition at line 285 of file cppPreprocessor.cxx. References CPPPreprocessor::_files. Referenced by CPPPreprocessor::handle_error_directive(), CPPPreprocessor::handle_include_directive(), CPPPreprocessor::init_const_expr(), and CPPPreprocessor::set_verbose(). |
|
Reimplemented in CPPTemplateScope. Definition at line 791 of file cppScope.cxx. References CPPDeclaration::_vis, and indent(). Referenced by CPPScope::find_template(), CPPInstance::get_simple_name(), and CPPScope::is_fully_specified(). |
|
Definition at line 315 of file cppPreprocessor.cxx. Referenced by CPPPreprocessor::get(). |
|
Returns the parent scope of this scope, if any.
Definition at line 119 of file cppScope.cxx. References CPPScope::_current_vis. |
|
Reimplemented in CPPTemplateScope. Definition at line 774 of file cppScope.cxx. References CPPScope::_parent_scope, NULL, and CPPScope::output(). |
|
Returns the class or struct that defines this scope, if any.
Definition at line 106 of file cppScope.cxx. References CPPScope::_current_vis. |
|
Returns the nearest ancestor of this scope that is a template scope, or NULL if the scope is fully specified.
Definition at line 889 of file cppScope.cxx. Referenced by CPPScope::get_fully_scoped_name(). |
|
Returns the verbosity level of the parser.
Definition at line 243 of file cppPreprocessor.cxx. References CPPPreprocessor::_files. |
|
Definition at line 542 of file cppPreprocessor.cxx. References NULL. |
|
Definition at line 624 of file cppPreprocessor.cxx. References CPPPreprocessor::_files, CPPPreprocessor::get_col_number(), CPPPreprocessor::get_file(), CPPPreprocessor::get_line_number(), and indent(). Referenced by CPPExpressionParser::~CPPExpressionParser(). |
|
Definition at line 608 of file cppPreprocessor.cxx. References CPPPreprocessor::_last_c, CPPPreprocessor::_parsed_files, and CPPPreprocessor::_start_of_line. Referenced by is_fully_specified(). |
|
Definition at line 639 of file cppPreprocessor.cxx. References CPPPreprocessor::_files. Referenced by CPPTypeParser::~CPPTypeParser(). |
|
Definition at line 359 of file cppScope.cxx. References NULL. Referenced by CPPIdentifier::get_scope(). |
|
Returns true if this declaration is an actual, factual declaration, or false if some part of the declaration depends on a template parameter which has not yet been instantiated.
Reimplemented from CPPScope. Definition at line 59 of file cppParser.cxx. References CPPPreprocessor::get_error_count(), CPPPreprocessor::init_cpp(), parse_cpp(), and CPPFile::S_local. |
|
Reimplemented in CPPTemplateScope. Definition at line 837 of file cppScope.cxx. Referenced by CPPScope::get_simple_name(), and CPPIdentifier::substitute_decl(). |
|
Given a string, expand all manifests within the string and evaluate it as an expression. Returns NULL if the string is not a valid expression. This is an internal support function for CPPPreprocessor; however, there is a public variant of this function defined for CPPParser. Definition at line 802 of file cppPreprocessor.cxx. Referenced by parse_file(). |
|
Given a string, expand all manifests within the string and evaluate it as an expression. Returns NULL if the string is not a valid expression. Definition at line 96 of file cppParser.cxx. References NULL. |
|
Definition at line 73 of file cppParser.cxx. References CPPPreprocessor::parse_expr(). |
|
Given a string, interpret it as a type name and return the corresponding CPPType. Returns NULL if the string is not a valid type. Definition at line 113 of file cppParser.cxx. Referenced by TypeManager::unwrap_const(). |
|
Definition at line 654 of file cppPreprocessor.cxx. References CPPPreprocessor::_files. Referenced by CPPPreprocessor::get_error_count(). |
|
Definition at line 685 of file cppPreprocessor.cxx. References CPPPreprocessor::_manifests, CPPPreprocessor::expand_defined_function(), CPPPreprocessor::expand_manifest_inline(), and size_t. Referenced by CPPPreprocessor::get_comment_before(). |
|
Definition at line 131 of file cppScope.cxx. References CPPDeclaration::_leading_comment, cppyyltype::file, cppyyltype::first_line, CPPPreprocessor::get_comment_before(), and NULL. |
|
Sets the struct or class that owns this scope. This should only be done once, when the scope and its associated struct are created. It's provided so the scope can check the struct's ancestry for inherited symbols. Definition at line 91 of file cppScope.cxx. References CPPScope::_parent_scope. |
|
Sets the verbosity level of the parser. At 0, no warnings will be reported; at 1 or higher, expect to get spammed. Definition at line 230 of file cppPreprocessor.cxx. References CPPPreprocessor::_files, CPPPreprocessor::get_col_number(), CPPPreprocessor::get_file(), and CPPPreprocessor::get_line_number(). |
|
Definition at line 440 of file cppScope.cxx. References CPPStructType::_derivation, CPPScope::_parent_scope, CPPStructType::_scope, CPPScope::_struct_type, CPPScope::_typedefs, CPPScope::_using, CPPScope::find_type(), and NULL. Referenced by CPPScope::find_type(). |
|
|
|
Definition at line 93 of file cppPreprocessor.h. |
|
Definition at line 131 of file cppScope.h. |
|
Definition at line 86 of file cppPreprocessor.h. Referenced by CPPPreprocessor::skip_c_comment(). |
|
Definition at line 154 of file cppScope.h. Referenced by CPPScope::get_parent_scope(), and CPPScope::get_struct_type(). |
|
Definition at line 127 of file cppScope.h. Referenced by InterrogateBuilder::remap_indices(), and TypeManager::wrap_const_pointer(). |
|
Definition at line 142 of file cppScope.h. Referenced by CPPScope::add_declaration(). |
|
Definition at line 133 of file cppScope.h. Referenced by CPPScope::add_enum_value(). |
|
Definition at line 144 of file cppScope.h. Referenced by CPPStructType::check_virtual(). |
|
Definition at line 83 of file cppPreprocessor.h. |
|
Definition at line 81 of file cppPreprocessor.h. Referenced by CPPPreprocessor::get_preprocessor_command(), CPPPreprocessor::handle_error_directive(), CPPPreprocessor::push_string(), and CPPPreprocessor::skip_false_if_block(). |
|
Definition at line 147 of file cppScope.h. Referenced by CPPScope::is_fully_specified(), and CPPScope::write(). |
|
Definition at line 136 of file cppScope.h. Referenced by CPPScope::find_type(). |
|
|
Definition at line 89 of file cppPreprocessor.h. Referenced by CPPPreprocessor::init_cpp(). |
|
Definition at line 92 of file cppPreprocessor.h. Referenced by CPPPreprocessor::handle_ifdef_directive(). |
|
Definition at line 100 of file cppPreprocessor.h. |
|
Definition at line 151 of file cppScope.h. Referenced by CPPScope::CPPScope(), CPPScope::substitute_decl(), CPPScope::write(), and CPPScope::~CPPScope(). |
|
Definition at line 130 of file cppScope.h. |
|
Definition at line 84 of file cppPreprocessor.h. |
|
Definition at line 146 of file cppScope.h. |
|
Definition at line 139 of file cppScope.h. Referenced by CPPTemplateScope::add_using(), CPPScope::find_type(), and CPPScope::substitute_decl(). |
|
Definition at line 132 of file cppScope.h. Referenced by CPPScope::add_enum_value(). |
|
Definition at line 153 of file cppScope.h. Referenced by CPPScope::substitute_decl(). |
|
Definition at line 141 of file cppScope.h. |
|
Definition at line 106 of file cppPreprocessor.h. Referenced by CPPPreprocessor::expand_manifests(). |