Changeset 553772b
- Timestamp:
- May 16, 2019, 9:43:49 AM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 7a54d67
- Parents:
- 3c5dee4
- Location:
- src/Parser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/lex.ll
r3c5dee4 r553772b 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Wed Ma r 13 14:54:30201913 * Update Count : 70 712 * Last Modified On : Wed May 15 21:25:27 2019 13 * Update Count : 708 14 14 */ 15 15 … … 265 265 fortran { KEYWORD_RETURN(FORTRAN); } 266 266 ftype { KEYWORD_RETURN(FTYPE); } // CFA 267 generator { KEYWORD_RETURN(GENERATOR); } // CFA 267 268 _Generic { KEYWORD_RETURN(GENERIC); } // C11 268 269 goto { KEYWORD_RETURN(GOTO); } -
src/Parser/parser.yy
r3c5dee4 r553772b 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Apr 15 15:02:56201913 // Update Count : 429 012 // Last Modified On : Wed May 15 21:25:27 2019 13 // Update Count : 4296 14 14 // 15 15 … … 173 173 DeclarationNode * fieldDecl( DeclarationNode * typeSpec, DeclarationNode * fieldList ) { 174 174 if ( ! fieldList ) { // field declarator ? 175 if ( ! ( typeSpec->type && typeSpec->type->kind == TypeData::Aggregate) ) {175 if ( ! ( typeSpec->type && (typeSpec->type->kind == TypeData::Aggregate || typeSpec->type->kind == TypeData::Enum) ) ) { 176 176 stringstream ss; 177 177 typeSpec->type->print( ss ); … … 275 275 %token ENUM STRUCT UNION 276 276 %token EXCEPTION // CFA 277 %token COROUTINE MONITOR THREAD// CFA277 %token GENERATOR COROUTINE MONITOR THREAD // CFA 278 278 %token OTYPE FTYPE DTYPE TTYPE TRAIT // CFA 279 279 %token SIZEOF OFFSETOF … … 677 677 // empty 678 678 { $$ = nullptr; } 679 | ' ?' // CFA, default parameter679 | '@' // CFA, default parameter 680 680 { SemanticError( yylloc, "Default parameter for argument is currently unimplemented." ); $$ = nullptr; } 681 681 // { $$ = new ExpressionNode( build_constantInteger( *new string( "2" ) ) ); } … … 796 796 { $$ = new ExpressionNode( build_cast( $2, $4 ) ); } 797 797 // keyword cast cannot be grouped because of reduction in aggregate_key 798 | '(' GENERATOR '&' ')' cast_expression // CFA 799 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Coroutine, $5 ) ); } 798 800 | '(' COROUTINE '&' ')' cast_expression // CFA 799 801 { $$ = new ExpressionNode( build_keyword_cast( KeywordCastExpr::Coroutine, $5 ) ); } … … 2061 2063 | EXCEPTION 2062 2064 { yyy = true; $$ = DeclarationNode::Exception; } 2065 | GENERATOR 2066 { yyy = true; $$ = DeclarationNode::Coroutine; } 2063 2067 | COROUTINE 2064 2068 { yyy = true; $$ = DeclarationNode::Coroutine; }
Note: See TracChangeset
for help on using the changeset viewer.