Changeset 427854b for src/Parser
- Timestamp:
- Mar 2, 2020, 4:59:27 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- dfa4360
- Parents:
- 37cdd97
- Location:
- src/Parser
- Files:
-
- 4 edited
-
ParseNode.h (modified) (1 diff)
-
StatementNode.cc (modified) (1 diff)
-
TypeData.cc (modified) (1 diff)
-
parser.yy (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ParseNode.h
r37cdd97 r427854b 428 428 Statement * build_asm( bool voltile, Expression * instruction, ExpressionNode * output = nullptr, ExpressionNode * input = nullptr, ExpressionNode * clobber = nullptr, LabelNode * gotolabels = nullptr ); 429 429 Statement * build_directive( std::string * directive ); 430 SuspendStmt * build_suspend( StatementNode *, SuspendStmt::Type = SuspendStmt::None); 430 431 WaitForStmt * build_waitfor( ExpressionNode * target, StatementNode * stmt, ExpressionNode * when ); 431 432 WaitForStmt * build_waitfor( ExpressionNode * target, StatementNode * stmt, ExpressionNode * when, WaitForStmt * existing ); -
src/Parser/StatementNode.cc
r37cdd97 r427854b 249 249 } // build_finally 250 250 251 SuspendStmt * build_suspend( StatementNode * then, SuspendStmt::Type type ) { 252 auto node = new SuspendStmt(); 253 254 node->type = type; 255 256 std::list< Statement * > stmts; 257 buildMoveList< Statement, StatementNode >( then, stmts ); 258 if(!stmts.empty()) { 259 assert( stmts.size() == 1 ); 260 node->then = dynamic_cast< CompoundStmt * >( stmts.front() ); 261 } 262 263 return node; 264 } 265 251 266 WaitForStmt * build_waitfor( ExpressionNode * targetExpr, StatementNode * stmt, ExpressionNode * when ) { 252 267 auto node = new WaitForStmt(); -
src/Parser/TypeData.cc
r37cdd97 r427854b 769 769 case AggregateDecl::Struct: 770 770 case AggregateDecl::Coroutine: 771 case AggregateDecl::Generator: 771 772 case AggregateDecl::Monitor: 772 773 case AggregateDecl::Thread: -
src/Parser/parser.yy
r37cdd97 r427854b 1261 1261 { SemanticError( yylloc, "Initializer return is currently unimplemented." ); $$ = nullptr; } 1262 1262 | SUSPEND ';' 1263 { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }1263 { $$ = new StatementNode( build_suspend( nullptr ) ); } 1264 1264 | SUSPEND compound_statement ';' 1265 { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }1265 { $$ = new StatementNode( build_suspend( $2 ) ); } 1266 1266 | SUSPEND COROUTINE ';' 1267 { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }1267 { $$ = new StatementNode( build_suspend( nullptr, SuspendStmt::Coroutine ) ); } 1268 1268 | SUSPEND COROUTINE compound_statement 1269 { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }1269 { $$ = new StatementNode( build_suspend( $3, SuspendStmt::Coroutine ) ); } 1270 1270 | SUSPEND GENERATOR ';' 1271 { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }1271 { $$ = new StatementNode( build_suspend( nullptr, SuspendStmt::Generator ) ); } 1272 1272 | SUSPEND GENERATOR compound_statement 1273 { SemanticError( yylloc, "Suspend expression is currently unimplemented." ); $$ = nullptr; }1273 { $$ = new StatementNode( build_suspend( $3, SuspendStmt::Generator ) ); } 1274 1274 | THROW assignment_expression_opt ';' // handles rethrow 1275 1275 { $$ = new StatementNode( build_throw( $2 ) ); } … … 2086 2086 aggregate_control: // CFA 2087 2087 GENERATOR 2088 { SemanticError( yylloc, "generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }2088 { yyy = true; $$ = AggregateDecl::Generator; } 2089 2089 | MONITOR GENERATOR 2090 2090 { SemanticError( yylloc, "monitor generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }
Note:
See TracChangeset
for help on using the changeset viewer.