Changeset 7bf7fb9 for src/Parser/parser.yy
- Timestamp:
- Aug 7, 2016, 9:47:37 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 04273e9, d1625f8
- Parents:
- 35f9114
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r35f9114 r7bf7fb9 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 5 15:06:44201613 // Update Count : 17 5612 // Last Modified On : Sun Aug 7 09:37:48 2016 13 // Update Count : 1764 14 14 // 15 15 … … 60 60 std::stack< LinkageSpec::Type > linkageStack; 61 61 TypedefTable typedefTable; 62 63 void appendStr( std::string &to, std::string *from ) { 64 // "abc" "def" "ghi" => "abcdefghi", remove new text from quotes and insert before last quote in old string. 65 to.insert( to.length() - 1, from->substr( 1, from->length() - 2 ) ); 66 } // appendStr 62 67 %} 63 68 … … 304 309 constant: 305 310 // ENUMERATIONconstant is not included here; it is treated as a variable with type "enumeration constant". 306 INTEGERconstant { $$ = makeConstantInteger( *$1 ); }307 | FLOATINGconstant { $$ = makeConstantFloat( *$1 ); }308 | CHARACTERconstant { $$ = makeConstantChar( *$1 ); }311 INTEGERconstant { $$ = build_constantInteger( *$1 ); } 312 | FLOATINGconstant { $$ = build_constantFloat( *$1 ); } 313 | CHARACTERconstant { $$ = build_constantChar( *$1 ); } 309 314 ; 310 315 … … 331 336 332 337 string_literal_list: // juxtaposed strings are concatenated 333 STRINGliteral { $$ = makeConstantStr( *$1 ); } 334 | string_literal_list STRINGliteral { $$ = $1->appendstr( $2 ); } 338 STRINGliteral { $$ = build_constantStr( *$1 ); } 339 | string_literal_list STRINGliteral 340 { 341 appendStr( $1->get_expr()->get_constant()->get_value(), $2 ); 342 delete $2; // allocated by lexer 343 $$ = $1; 344 } 335 345 ; 336 346
Note: See TracChangeset
for help on using the changeset viewer.