Changeset 779a4a3 for src/Parser
- Timestamp:
- May 3, 2018, 4:33:19 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct, with_gc
- Children:
- f3152ab
- Parents:
- f465f0e (diff), c9d5c4f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- src/Parser
- Files:
-
- 4 edited
-
ParseNode.h (modified) (2 diffs)
-
StatementNode.cc (modified) (3 diffs)
-
lex.ll (modified) (2 diffs)
-
parser.yy (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ParseNode.h
rf465f0e r779a4a3 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Apr 29 14:04:05201813 // Update Count : 83 012 // Last Modified On : Mon Apr 30 09:19:17 2018 13 // Update Count : 831 14 14 // 15 15 … … 416 416 Statement * build_finally( StatementNode * stmt ); 417 417 Statement * build_compound( StatementNode * first ); 418 Statement * build_asm stmt( bool voltile, Expression * instruction, ExpressionNode * output = nullptr, ExpressionNode * input = nullptr, ExpressionNode * clobber = nullptr, LabelNode * gotolabels = nullptr );419 Statement * build_dir stmt( std::string * directive );418 Statement * build_asm( bool voltile, Expression * instruction, ExpressionNode * output = nullptr, ExpressionNode * input = nullptr, ExpressionNode * clobber = nullptr, LabelNode * gotolabels = nullptr ); 419 Statement * build_directive( std::string * directive ); 420 420 WaitForStmt * build_waitfor( ExpressionNode * target, StatementNode * stmt, ExpressionNode * when ); 421 421 WaitForStmt * build_waitfor( ExpressionNode * target, StatementNode * stmt, ExpressionNode * when, WaitForStmt * existing ); -
src/Parser/StatementNode.cc
rf465f0e r779a4a3 10 10 // Created On : Sat May 16 14:59:41 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Apr 29 14:21:45201813 // Update Count : 35 312 // Last Modified On : Mon Apr 30 09:21:16 2018 13 // Update Count : 354 14 14 // 15 15 … … 310 310 } 311 311 312 Statement * build_asm stmt( bool voltile, Expression * instruction, ExpressionNode * output, ExpressionNode * input, ExpressionNode * clobber, LabelNode * gotolabels ) {312 Statement * build_asm( bool voltile, Expression * instruction, ExpressionNode * output, ExpressionNode * input, ExpressionNode * clobber, LabelNode * gotolabels ) { 313 313 std::list< Expression * > out, in; 314 314 std::list< ConstantExpr * > clob; … … 320 320 } 321 321 322 Statement * build_dirstmt( string * directive ) { 323 cout << *directive << endl; 324 return nullptr; 322 Statement * build_directive( string * directive ) { 323 return new DirectiveStmt( *directive ); 325 324 } 326 325 -
src/Parser/lex.ll
rf465f0e r779a4a3 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Sun Apr 29 14:10:49201813 * Update Count : 67 512 * Last Modified On : Thu May 3 13:42:40 2018 13 * Update Count : 676 14 14 */ 15 15 … … 174 174 } 175 175 176 /* ignore preprocessor-style directives (for now)*/176 /* preprocessor-style directives */ 177 177 ^{h_white}*"#"[^\n]*"\n" { RETURN_VAL( DIRECTIVE ); } 178 178 -
src/Parser/parser.yy
rf465f0e r779a4a3 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Apr 29 14:20:17201813 // Update Count : 32 0612 // Last Modified On : Thu May 3 08:20:09 2018 13 // Update Count : 3225 14 14 // 15 15 … … 877 877 | asm_statement 878 878 | DIRECTIVE 879 { $$ = new StatementNode( build_dir stmt( $1 ) ); }879 { $$ = new StatementNode( build_directive( $1 ) ); } 880 880 ; 881 881 … … 1207 1207 asm_statement: 1208 1208 ASM asm_volatile_opt '(' string_literal ')' ';' 1209 { $$ = new StatementNode( build_asm stmt( $2, $4, 0 ) ); }1209 { $$ = new StatementNode( build_asm( $2, $4, 0 ) ); } 1210 1210 | ASM asm_volatile_opt '(' string_literal ':' asm_operands_opt ')' ';' // remaining GCC 1211 { $$ = new StatementNode( build_asm stmt( $2, $4, $6 ) ); }1211 { $$ = new StatementNode( build_asm( $2, $4, $6 ) ); } 1212 1212 | ASM asm_volatile_opt '(' string_literal ':' asm_operands_opt ':' asm_operands_opt ')' ';' 1213 { $$ = new StatementNode( build_asm stmt( $2, $4, $6, $8 ) ); }1213 { $$ = new StatementNode( build_asm( $2, $4, $6, $8 ) ); } 1214 1214 | ASM asm_volatile_opt '(' string_literal ':' asm_operands_opt ':' asm_operands_opt ':' asm_clobbers_list_opt ')' ';' 1215 { $$ = new StatementNode( build_asm stmt( $2, $4, $6, $8, $10 ) ); }1215 { $$ = new StatementNode( build_asm( $2, $4, $6, $8, $10 ) ); } 1216 1216 | ASM asm_volatile_opt GOTO '(' string_literal ':' ':' asm_operands_opt ':' asm_clobbers_list_opt ':' label_list ')' ';' 1217 { $$ = new StatementNode( build_asm stmt( $2, $5, 0, $8, $10, $12 ) ); }1217 { $$ = new StatementNode( build_asm( $2, $5, 0, $8, $10, $12 ) ); } 1218 1218 ; 1219 1219 … … 2405 2405 | ASM '(' string_literal ')' ';' // GCC, global assembler statement 2406 2406 { 2407 $$ = DeclarationNode::newAsmStmt( new StatementNode( build_asm stmt( false, $3, 0 ) ) );2407 $$ = DeclarationNode::newAsmStmt( new StatementNode( build_asm( false, $3, 0 ) ) ); 2408 2408 } 2409 2409 | EXTERN STRINGliteral // C++-style linkage specifier … … 2451 2451 | declaration_qualifier_list type_qualifier_list 2452 2452 { 2453 if ( $1->type->forall ) xxx = forall = true; // remember generic type 2453 // forall must be in the type_qualifier_list 2454 if ( $2->type->forall ) xxx = forall = true; // remember generic type 2454 2455 } 2455 2456 push '{' external_definition_list '}' // CFA, namespace
Note:
See TracChangeset
for help on using the changeset viewer.