- Timestamp:
- Jan 27, 2021, 9:19:37 AM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- d9e4d83
- Parents:
- 352cbc2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r352cbc2 rec3f9c8 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jan 26 11:18:19202113 // Update Count : 46 7412 // Last Modified On : Wed Jan 27 08:58:56 2021 13 // Update Count : 4680 14 14 // 15 15 … … 41 41 42 42 %{ 43 #define YYDEBUG_LEXER_TEXT (yylval)// lexer loads this up each time43 #define YYDEBUG_LEXER_TEXT( yylval ) // lexer loads this up each time 44 44 #define YYDEBUG 1 // get the pretty debugging code to compile 45 45 #define YYERROR_VERBOSE // more information in syntax errors … … 187 187 ConstantExpr * constant = dynamic_cast<ConstantExpr *>(type->expr.get()); 188 188 if ( constant && (constant->get_constant()->get_value() == "0" || constant->get_constant()->get_value() == "1") ) { 189 189 type = new ExpressionNode( new CastExpr( maybeMoveBuild<Expression>(type), new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ) ); 190 190 } // if 191 191 return new ForCtrl( … … 1247 1247 { $$ = new StatementNode( build_computedgoto( $3 ) ); } 1248 1248 // A semantic check is required to ensure fallthru appears only in the body of a choose statement. 1249 1249 | fall_through_name ';' // CFA 1250 1250 { $$ = new StatementNode( build_branch( BranchStmt::FallThrough ) ); } 1251 1251 | fall_through_name identifier_or_type_name ';' // CFA 1252 1252 { $$ = new StatementNode( build_branch( $2, BranchStmt::FallThrough ) ); } 1253 1253 | fall_through_name DEFAULT ';' // CFA … … 1739 1739 1740 1740 enum_specifier_nobody: // type specifier - {...} 1741 // Preclude SUE declarations in restricted scopes: 1742 // 1743 // int f( struct S { int i; } s1, Struct S s2 ) { struct S s3; ... } 1744 // 1745 // because it is impossible to call f due to name equivalence. 1741 // Preclude SUE declarations in restricted scopes (see type_specifier_nobody) 1746 1742 basic_type_specifier 1747 1743 | sue_type_specifier_nobody … … 2461 2457 { 2462 2458 typedefTable.addToScope( *$2, TYPEDEFname, "9" ); 2463 if ( $1 == TypeDecl::Otype ) { SemanticError( yylloc, "otype keyword is deprecated " ); }2464 if ( $1 == TypeDecl::Dtype ) { SemanticError( yylloc, "dtype keyword is deprecated " ); }2465 if ( $1 == TypeDecl::Ttype ) { SemanticError( yylloc, "ttype keyword is deprecated " ); }2459 if ( $1 == TypeDecl::Otype ) { SemanticError( yylloc, "otype keyword is deprecated, use T " ); } 2460 if ( $1 == TypeDecl::Dtype ) { SemanticError( yylloc, "dtype keyword is deprecated, use T &" ); } 2461 if ( $1 == TypeDecl::Ttype ) { SemanticError( yylloc, "ttype keyword is deprecated, use T ..." ); } 2466 2462 } 2467 2463 type_initializer_opt assertion_list_opt
Note: See TracChangeset
for help on using the changeset viewer.