Changeset cdc02f2
- Timestamp:
- Oct 25, 2018, 11:55:21 AM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 515a037
- Parents:
- 9507ce3 (diff), ee27df2 (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. - Files:
-
- 1 added
- 1 deleted
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
doc/user/Makefile
r9507ce3 rcdc02f2 79 79 ## Define the default recipes. 80 80 81 ${Build} :81 ${Build} : 82 82 mkdir -p ${Build} 83 83 -
libcfa/src/iostream.cfa
r9507ce3 rcdc02f2 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Aug 11 13:56:43201813 // Update Count : 47 312 // Last Modified On : Wed Sep 26 18:22:57 2018 13 // Update Count : 474 14 14 // 15 15 … … 410 410 // Local Variables: // 411 411 // tab-width: 4 // 412 // compile-command: "cfa iostream.c " //412 // compile-command: "cfa iostream.cfa" // 413 413 // End: // -
libcfa/src/iterator.cfa
r9507ce3 rcdc02f2 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 7 08:38:23 201713 // Update Count : 2 812 // Last Modified On : Wed Sep 26 18:23:10 2018 13 // Update Count : 29 14 14 // 15 15 … … 33 33 // Local Variables: // 34 34 // tab-width: 4 // 35 // compile-command: "cfa iterator.c " //35 // compile-command: "cfa iterator.cfa" // 36 36 // End: // -
src/Parser/lex.ll
r9507ce3 rcdc02f2 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Wed Aug 29 15:02:41201813 * Update Count : 68 612 * Last Modified On : Sat Oct 20 09:42:45 2018 13 * Update Count : 687 14 14 */ 15 15 … … 209 209 __attribute__ { KEYWORD_RETURN(ATTRIBUTE); } // GCC 210 210 auto { KEYWORD_RETURN(AUTO); } 211 basetypeof { KEYWORD_RETURN(BASETYPEOF); } // CFA 211 212 _Bool { KEYWORD_RETURN(BOOL); } // C99 212 213 break { KEYWORD_RETURN(BREAK); } -
src/Parser/parser.yy
r9507ce3 rcdc02f2 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 30 17:02:25201813 // Update Count : 40 2912 // Last Modified On : Sun Oct 21 08:27:29 2018 13 // Update Count : 4045 14 14 // 15 15 … … 186 186 } // fieldDecl 187 187 188 ExpressionNode *forInc( const OperKinds op ) {189 return new ExpressionNode( build_constantInteger( *new string( op == OperKinds::LThan || op == OperKinds::LEThan ? "1" : "-1" ) ) );190 } // forInc191 192 188 ForCtrl * forCtrl( ExpressionNode * type, string * index, ExpressionNode * start, enum OperKinds compop, ExpressionNode * comp, ExpressionNode * inc ) { 193 189 ConstantExpr *constant = dynamic_cast<ConstantExpr *>(type->get_expr()); … … 198 194 distAttr( DeclarationNode::newTypeof( type ), DeclarationNode::newName( index )->addInitializer( new InitializerNode( start ) ) ), 199 195 new ExpressionNode( build_binary_val( compop, new ExpressionNode( build_varref( new string( *index ) ) ), comp ) ), 200 new ExpressionNode( build_binary_val( OperKinds::PlusAssn, new ExpressionNode( build_varref( new string( *index ) ) ), inc ) ) ); 196 new ExpressionNode( build_binary_val( compop == OperKinds::LThan || compop == OperKinds::LEThan ? // choose += or -= for upto/downto 197 OperKinds::PlusAssn : OperKinds::MinusAssn, new ExpressionNode( build_varref( new string( *index ) ) ), inc ) ) ); 201 198 } // forCtrl 202 199 … … 261 258 %token ZERO_T ONE_T // CFA 262 259 %token VALIST // GCC 263 %token TYPEOF LABEL// GCC260 %token TYPEOF BASETYPEOF LABEL // GCC 264 261 %token ENUM STRUCT UNION 265 262 %token EXCEPTION // CFA … … 636 633 { $$ = new ExpressionNode( build_fieldSel( $1, build_tuple( $4 ) ) ); } 637 634 | postfix_expression ARROW no_attr_identifier 638 { 639 $$ = new ExpressionNode( build_pfieldSel( $1, *$3 == "0" || *$3 == "1" ? build_constantInteger( *$3 ) : build_varref( $3 ) ) ); 640 } 635 { $$ = new ExpressionNode( build_pfieldSel( $1, build_varref( $3 ) ) ); } 641 636 | postfix_expression ARROW INTEGERconstant // CFA, tuple index 642 637 { $$ = new ExpressionNode( build_pfieldSel( $1, build_constantInteger( *$3 ) ) ); } … … 1146 1141 } else { 1147 1142 $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), 1148 OperKinds::LThan, $1->clone(), forInc( OperKinds::LThan) );1143 OperKinds::LThan, $1->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); 1149 1144 } // if 1150 1145 } 1151 1146 | constant_expression inclexcl constant_expression // CFA 1152 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, forInc( $2) ); }1147 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); } 1153 1148 | constant_expression inclexcl constant_expression '~' constant_expression // CFA 1154 1149 { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, $5 ); } … … 1162 1157 if ( NameExpr *identifier = dynamic_cast<NameExpr *>($1->get_expr()) ) { 1163 1158 $$ = forCtrl( $3, new string( identifier->name ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ), 1164 OperKinds::LThan, $3->clone(), forInc( OperKinds::LThan) );1159 OperKinds::LThan, $3->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); 1165 1160 } else { 1166 1161 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); $$ = nullptr; … … 1174 1169 } else { 1175 1170 if ( NameExpr *identifier = dynamic_cast<NameExpr *>($1->get_expr()) ) { 1176 $$ = forCtrl( $3, new string( identifier->name ), $3->clone(), $4, $5, forInc( $4) );1171 $$ = forCtrl( $3, new string( identifier->name ), $3->clone(), $4, $5, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); 1177 1172 } else { 1178 1173 SemanticError( yylloc, "Expression disallowed. Only loop-index name allowed" ); $$ = nullptr; … … 1859 1854 | TYPEOF '(' comma_expression ')' // GCC: typeof(a+b) y; 1860 1855 { $$ = DeclarationNode::newTypeof( $3 ); } 1856 | BASETYPEOF '(' type ')' // CFA: basetypeof(x) y; 1857 { $$ = $3; } 1858 | BASETYPEOF '(' comma_expression ')' // CFA: basetypeof(a+b) y; 1859 { $$ = DeclarationNode::newTypeof( $3 ); } 1861 1860 | ATTR_TYPEGENname '(' type ')' // CFA: e.g., @type(x) y; 1862 1861 { $$ = DeclarationNode::newAttr( $1, $3 ); } -
tests/.expect/loopctrl.txt
r9507ce3 rcdc02f2 3 3 empty 4 4 5 zero 5 6 A 6 A A7 7 A A A A A A A A A A 8 8 B B B B B … … 10 10 D D D D D 11 11 E E E E E 12 0 1 2 3 4 5 6 7 8 9 12 13 13 0 1 2 3 4 5 6 7 8 9 14 14 1 3 5 7 9 … … 18 18 2 4 6 8 10 19 19 10 8 6 4 2 20 21 20 22 3 6 9 23 21 24 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9) 22 25 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9) 26 23 27 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9) 24 28 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9) 29 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10) 30 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10) 31 32 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1) 33 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1) 34 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0) 35 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)
Note: See TracChangeset
for help on using the changeset viewer.