comparison src/share/vm/adlc/adlparse.hpp @ 475:284d0af00d53

6771309: debugging AD files is difficult without #line directives in generated code Summary: more and better #line and #define directives in the generated code; ADLC itself accepts #line directives Reviewed-by: never, kvn
author jrose
date Tue, 09 Dec 2008 12:41:26 -0800
parents 4d9884b01ba6
children 569b3b226089
comparison
equal deleted inserted replaced
474:7a018855d2f0 475:284d0af00d53
91 void encode_parse(void); // Parse encoding section 91 void encode_parse(void); // Parse encoding section
92 void frame_parse(void); // Parse frame section 92 void frame_parse(void); // Parse frame section
93 void pipe_parse(void); // Parse pipeline section 93 void pipe_parse(void); // Parse pipeline section
94 void definitions_parse(void); // Parse definitions section 94 void definitions_parse(void); // Parse definitions section
95 void peep_parse(void); // Parse peephole rule definitions 95 void peep_parse(void); // Parse peephole rule definitions
96 void preproc_line(void); // Parse a #line statement
96 void preproc_define(void); // Parse a #define statement 97 void preproc_define(void); // Parse a #define statement
97 void preproc_undef(void); // Parse an #undef statement 98 void preproc_undef(void); // Parse an #undef statement
98 99
99 // Helper functions for instr_parse(). 100 // Helper functions for instr_parse().
100 void adjust_set_rule(InstructForm *instr); 101 void adjust_set_rule(InstructForm *instr);
224 225
225 void get_oplist(NameList &parameters, FormDict &operands);// Parse type-operand pairs 226 void get_oplist(NameList &parameters, FormDict &operands);// Parse type-operand pairs
226 void get_effectlist(FormDict &effects, FormDict &operands); // Parse effect-operand pairs 227 void get_effectlist(FormDict &effects, FormDict &operands); // Parse effect-operand pairs
227 // Return the contents of a parenthesized expression. 228 // Return the contents of a parenthesized expression.
228 // Requires initial '(' and consumes final ')', which is replaced by '\0'. 229 // Requires initial '(' and consumes final ')', which is replaced by '\0'.
229 char *get_paren_expr(const char *description); 230 char *get_paren_expr(const char *description, bool include_location = false);
230 // Return expression up to next stop-char, which terminator replaces. 231 // Return expression up to next stop-char, which terminator replaces.
231 // Does not require initial '('. Does not consume final stop-char. 232 // Does not require initial '('. Does not consume final stop-char.
232 // Final stop-char is left in _curchar, but is also is replaced by '\0'. 233 // Final stop-char is left in _curchar, but is also is replaced by '\0'.
233 char *get_expr(const char *description, const char *stop_chars); 234 char *get_expr(const char *description, const char *stop_chars);
234 char *find_cpp_block(const char *description); // Parse a C++ code block 235 char *find_cpp_block(const char *description); // Parse a C++ code block
235 // Issue parser error message & go to EOL 236 // Issue parser error message & go to EOL
236 void parse_err(int flag, const char *fmt, ...); 237 void parse_err(int flag, const char *fmt, ...);
238 // Create a location marker for this file and line.
239 char *get_line_string(int linenum = 0);
240 // Return a location marker which tells the C preprocessor to
241 // forget the previous location marker. (Requires awk postprocessing.)
242 char *end_line_marker() { return (char*)"\n#line 999999\n"; }
237 243
238 // Return pointer to current character 244 // Return pointer to current character
239 inline char cur_char(void); 245 inline char cur_char(void);
240 // Advance to next character, assign this to _curchar 246 // Advance to next character, assign this to _curchar
241 inline void next_char(void); 247 inline void next_char(void);
266 int linenum() { return _buf.linenum(); } 272 int linenum() { return _buf.linenum(); }
267 273
268 static bool is_literal_constant(const char *hex_string); 274 static bool is_literal_constant(const char *hex_string);
269 static bool is_hex_digit(char digit); 275 static bool is_hex_digit(char digit);
270 static bool is_int_token(const char* token, int& intval); 276 static bool is_int_token(const char* token, int& intval);
277 static bool equivalent_expressions(const char* str1, const char* str2);
271 static void trim(char* &token); // trim leading & trailing spaces 278 static void trim(char* &token); // trim leading & trailing spaces
272 }; 279 };