Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

CPPExpressionParser Class Reference

#include <cppExpressionParser.h>

Inheritance diagram for CPPExpressionParser:

CPPPreprocessor List of all members.

Public Types

typedef map< string, CPPManifest * > Manifests
typedef set< CPPFileParsedFiles
typedef set< string > Includes

Public Member Functions

 CPPExpressionParser (CPPScope *current_scope, CPPScope *global_scope)
 ~CPPExpressionParser ()
bool parse_expr (const string &expr)
bool parse_expr (const string &expr, const CPPPreprocessor &filepos)
void output (ostream &out) const
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())
CPPCommentBlockget_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

CPPScope_current_scope
CPPScope_global_scope
CPPExpression_expr
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 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.

CPPExpressionparse_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.


Member Typedef Documentation

typedef set<string> CPPPreprocessor::Includes [inherited]
 

Definition at line 91 of file cppPreprocessor.h.

typedef map<string, CPPManifest *> CPPPreprocessor::Manifests [inherited]
 

Definition at line 80 of file cppPreprocessor.h.

typedef set<CPPFile> CPPPreprocessor::ParsedFiles [inherited]
 

Definition at line 88 of file cppPreprocessor.h.


Constructor & Destructor Documentation

CPPExpressionParser::CPPExpressionParser CPPScope current_scope,
CPPScope global_scope
 

Definition at line 34 of file cppExpressionParser.cxx.

CPPExpressionParser::~CPPExpressionParser  ) 
 

Definition at line 49 of file cppExpressionParser.cxx.

References _current_scope, _expr, _global_scope, CPPPreprocessor::get_error_count(), CPPPreprocessor::init_const_expr(), and parse_const_expr().


Member Function Documentation

void CPPPreprocessor::copy_filepos const CPPPreprocessor other  )  [inherited]
 

Definition at line 255 of file cppPreprocessor.cxx.

References CPPPreprocessor::_files.

void CPPPreprocessor::error const string &  message,
int  line = 0,
int  col = 0,
CPPFile  file = CPPFile()
[inherited]
 

Definition at line 510 of file cppPreprocessor.cxx.

References CPPPreprocessor::_error_count.

Referenced by CPPIdentifier::get_scope(), and CPPIdentifier::is_tbd().

string CPPPreprocessor::expand_manifests const string &  input_expr  )  [protected, inherited]
 

Given a string, expand all manifests within the string and return the new string.

Definition at line 731 of file cppPreprocessor.cxx.

References _expr, CPPPreprocessor::_verbose, current_scope, global_scope, NULL, and parse_expr().

Referenced by CPPPreprocessor::handle_undef_directive().

int CPPPreprocessor::get_col_number  )  const [inherited]
 

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().

CPPCommentBlock * CPPPreprocessor::get_comment_before int  line,
CPPFile  file
[inherited]
 

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().

int CPPPreprocessor::get_error_count  )  const [inherited]
 

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 CPPParser::is_fully_specified(), ~CPPExpressionParser(), and CPPTypeParser::~CPPTypeParser().

CPPFile CPPPreprocessor::get_file  )  const [inherited]
 

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().

int CPPPreprocessor::get_line_number  )  const [inherited]
 

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().

CPPToken CPPPreprocessor::get_next_token  )  [inherited]
 

Definition at line 315 of file cppPreprocessor.cxx.

Referenced by CPPPreprocessor::get().

int CPPPreprocessor::get_verbose  )  const [inherited]
 

Returns the verbosity level of the parser.

Definition at line 243 of file cppPreprocessor.cxx.

References CPPPreprocessor::_files.

int CPPPreprocessor::get_warning_count  )  const [inherited]
 

Definition at line 542 of file cppPreprocessor.cxx.

References NULL.

bool CPPPreprocessor::init_const_expr const string &  expr  )  [protected, inherited]
 

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().

bool CPPPreprocessor::init_cpp const CPPFile file  )  [protected, inherited]
 

Definition at line 608 of file cppPreprocessor.cxx.

References CPPPreprocessor::_last_c, CPPPreprocessor::_parsed_files, and CPPPreprocessor::_start_of_line.

Referenced by CPPParser::is_fully_specified().

bool CPPPreprocessor::init_type const string &  type  )  [protected, inherited]
 

Definition at line 639 of file cppPreprocessor.cxx.

References CPPPreprocessor::_files.

Referenced by CPPTypeParser::~CPPTypeParser().

void CPPExpressionParser::output ostream &  out  )  const
 

Definition at line 100 of file cppExpressionParser.cxx.

CPPExpression * CPPPreprocessor::parse_expr const string &  expr,
CPPScope current_scope,
CPPScope global_scope
[protected, inherited]
 

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 CPPParser::parse_file().

bool CPPExpressionParser::parse_expr const string &  expr,
const CPPPreprocessor filepos
 

Definition at line 79 of file cppExpressionParser.cxx.

bool CPPExpressionParser::parse_expr const string &  expr  ) 
 

Definition at line 60 of file cppExpressionParser.cxx.

Referenced by CPPPreprocessor::expand_manifests().

bool CPPPreprocessor::push_file const CPPFile file  )  [protected, inherited]
 

Definition at line 654 of file cppPreprocessor.cxx.

References CPPPreprocessor::_files.

Referenced by CPPPreprocessor::get_error_count().

bool CPPPreprocessor::push_string const string &  input,
bool  lock_position
[protected, inherited]
 

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().

void CPPPreprocessor::set_verbose int  verbose  )  [inherited]
 

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().

void CPPPreprocessor::warning const string &  message,
int  line = 0,
int  col = 0,
CPPFile  file = CPPFile()
[inherited]
 

Definition at line 484 of file cppPreprocessor.cxx.

Referenced by CPPPreprocessor::extract_manifest_args(), CPPPreprocessor::get_preprocessor_command(), CPPDeclaration::get_template_scope(), CPPScope::is_fully_specified(), CPPStructType::is_incomplete(), and CPPPreprocessor::should_ignore_manifest().


Member Data Documentation

Includes CPPPreprocessor::_angle_includes [inherited]
 

Definition at line 93 of file cppPreprocessor.h.

CPPComments CPPPreprocessor::_comments [inherited]
 

Definition at line 86 of file cppPreprocessor.h.

Referenced by CPPPreprocessor::skip_c_comment().

CPPScope* CPPExpressionParser::_current_scope
 

Definition at line 48 of file cppExpressionParser.h.

Referenced by ~CPPExpressionParser().

CPPExpression* CPPExpressionParser::_expr
 

Definition at line 50 of file cppExpressionParser.h.

Referenced by CPPPreprocessor::expand_manifests(), and ~CPPExpressionParser().

CPPScope* CPPExpressionParser::_global_scope
 

Definition at line 49 of file cppExpressionParser.h.

Referenced by ~CPPExpressionParser().

DSearchPath CPPPreprocessor::_include_path [inherited]
 

Definition at line 83 of file cppPreprocessor.h.

Manifests CPPPreprocessor::_manifests [inherited]
 

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().

ParsedFiles CPPPreprocessor::_parsed_files [inherited]
 

Definition at line 89 of file cppPreprocessor.h.

Referenced by CPPPreprocessor::init_cpp().

Includes CPPPreprocessor::_quote_includes [inherited]
 

Definition at line 92 of file cppPreprocessor.h.

Referenced by CPPPreprocessor::handle_ifdef_directive().

bool CPPPreprocessor::_resolve_identifiers [inherited]
 

Definition at line 100 of file cppPreprocessor.h.

DSearchPath CPPPreprocessor::_system_include_path [inherited]
 

Definition at line 84 of file cppPreprocessor.h.

int CPPPreprocessor::_verbose [inherited]
 

Definition at line 106 of file cppPreprocessor.h.

Referenced by CPPPreprocessor::expand_manifests().


The documentation for this class was generated from the following files:
Generated on Thu May 1 22:13:19 2003 for DTool by doxygen1.3