|
@@ -53,15 +53,17 @@ public:
|
|
|
int get_col_number() const;
|
|
int get_col_number() const;
|
|
|
|
|
|
|
|
CPPToken get_next_token();
|
|
CPPToken get_next_token();
|
|
|
|
|
+ CPPToken peek_next_token();
|
|
|
#ifdef CPP_VERBOSE_LEX
|
|
#ifdef CPP_VERBOSE_LEX
|
|
|
CPPToken get_next_token0();
|
|
CPPToken get_next_token0();
|
|
|
int _token_index;
|
|
int _token_index;
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
- 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());
|
|
|
|
|
|
|
+ void warning(const string &message);
|
|
|
|
|
+ void warning(const string &message, const YYLTYPE &loc);
|
|
|
|
|
+ void error(const string &message);
|
|
|
|
|
+ void error(const string &message, const YYLTYPE &loc);
|
|
|
|
|
+ void show_line(const YYLTYPE &loc);
|
|
|
|
|
|
|
|
CPPCommentBlock *get_comment_before(int line, CPPFile file);
|
|
CPPCommentBlock *get_comment_before(int line, CPPFile file);
|
|
|
CPPCommentBlock *get_comment_on(int line, CPPFile file);
|
|
CPPCommentBlock *get_comment_on(int line, CPPFile file);
|
|
@@ -112,6 +114,8 @@ protected:
|
|
|
|
|
|
|
|
private:
|
|
private:
|
|
|
CPPToken internal_get_next_token();
|
|
CPPToken internal_get_next_token();
|
|
|
|
|
+ int check_digraph(int c);
|
|
|
|
|
+ int check_trigraph(int c);
|
|
|
int skip_whitespace(int c);
|
|
int skip_whitespace(int c);
|
|
|
int skip_comment(int c);
|
|
int skip_comment(int c);
|
|
|
int skip_c_comment(int c);
|
|
int skip_c_comment(int c);
|
|
@@ -121,22 +125,14 @@ private:
|
|
|
int get_preprocessor_command(int c, string &command);
|
|
int get_preprocessor_command(int c, string &command);
|
|
|
int get_preprocessor_args(int c, string &args);
|
|
int get_preprocessor_args(int c, string &args);
|
|
|
|
|
|
|
|
- void handle_define_directive(const string &args, int first_line,
|
|
|
|
|
- int first_col, const CPPFile &first_file);
|
|
|
|
|
- void handle_undef_directive(const string &args, int first_line,
|
|
|
|
|
- int first_col, const CPPFile &first_file);
|
|
|
|
|
- void handle_ifdef_directive(const string &args, int first_line,
|
|
|
|
|
- int first_col, const CPPFile &first_file);
|
|
|
|
|
- void handle_ifndef_directive(const string &args, int first_line,
|
|
|
|
|
- int first_col, const CPPFile &first_file);
|
|
|
|
|
- void handle_if_directive(const string &args, int first_line,
|
|
|
|
|
- int first_col, const CPPFile &first_file);
|
|
|
|
|
- void handle_include_directive(const string &args, int first_line,
|
|
|
|
|
- int first_col, const CPPFile &first_file);
|
|
|
|
|
- void handle_pragma_directive(const string &args, int first_line,
|
|
|
|
|
- int first_col, const CPPFile &first_file);
|
|
|
|
|
- void handle_error_directive(const string &args, int first_line,
|
|
|
|
|
- int first_col, const CPPFile &first_file);
|
|
|
|
|
|
|
+ void handle_define_directive(const string &args, const YYLTYPE &loc);
|
|
|
|
|
+ void handle_undef_directive(const string &args, const YYLTYPE &loc);
|
|
|
|
|
+ void handle_ifdef_directive(const string &args, const YYLTYPE &loc);
|
|
|
|
|
+ void handle_ifndef_directive(const string &args, const YYLTYPE &loc);
|
|
|
|
|
+ void handle_if_directive(const string &args, const YYLTYPE &loc);
|
|
|
|
|
+ void handle_include_directive(const string &args, const YYLTYPE &loc);
|
|
|
|
|
+ void handle_pragma_directive(const string &args, const YYLTYPE &loc);
|
|
|
|
|
+ void handle_error_directive(const string &args, const YYLTYPE &loc);
|
|
|
|
|
|
|
|
void skip_false_if_block(bool consider_elifs);
|
|
void skip_false_if_block(bool consider_elifs);
|
|
|
|
|
|
|
@@ -153,7 +149,7 @@ private:
|
|
|
int va_arg, vector_string &args,
|
|
int va_arg, vector_string &args,
|
|
|
const string &expr, size_t &p);
|
|
const string &expr, size_t &p);
|
|
|
|
|
|
|
|
- CPPToken get_number(int c, int c2 = 0);
|
|
|
|
|
|
|
+ CPPToken get_number(int c);
|
|
|
static int check_keyword(const string &name);
|
|
static int check_keyword(const string &name);
|
|
|
int scan_escape_sequence(int c);
|
|
int scan_escape_sequence(int c);
|
|
|
string scan_quoted(int c);
|
|
string scan_quoted(int c);
|
|
@@ -162,6 +158,7 @@ private:
|
|
|
bool should_ignore_preprocessor() const;
|
|
bool should_ignore_preprocessor() const;
|
|
|
|
|
|
|
|
int get();
|
|
int get();
|
|
|
|
|
+ int peek();
|
|
|
void unget(int c);
|
|
void unget(int c);
|
|
|
|
|
|
|
|
CPPTemplateParameterList *
|
|
CPPTemplateParameterList *
|
|
@@ -177,6 +174,7 @@ private:
|
|
|
bool open(const CPPFile &file);
|
|
bool open(const CPPFile &file);
|
|
|
bool connect_input(const string &input);
|
|
bool connect_input(const string &input);
|
|
|
int get();
|
|
int get();
|
|
|
|
|
+ int peek();
|
|
|
|
|
|
|
|
const CPPManifest *_ignore_manifest;
|
|
const CPPManifest *_ignore_manifest;
|
|
|
CPPFile _file;
|
|
CPPFile _file;
|
|
@@ -184,6 +182,8 @@ private:
|
|
|
istream *_in;
|
|
istream *_in;
|
|
|
int _line_number;
|
|
int _line_number;
|
|
|
int _col_number;
|
|
int _col_number;
|
|
|
|
|
+ int _next_line_number;
|
|
|
|
|
+ int _next_col_number;
|
|
|
bool _lock_position;
|
|
bool _lock_position;
|
|
|
int _prev_last_c;
|
|
int _prev_last_c;
|
|
|
};
|
|
};
|