Changeset a8541d9
- Timestamp:
- Jun 11, 2015, 1:31:07 PM (10 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- ea9b9d3
- Parents:
- bfbf97f (diff), cda48b6 (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
- Files:
-
- 323 added
- 40 deleted
- 5 edited
- 81 moved
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
rbfbf97f ra8541d9 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Thu Jun 04 15:00:00201513 // Update Count : 1 2512 // Last Modified On : Thu Jun 11 13:22:39 2015 13 // Update Count : 137 14 14 // 15 15 … … 43 43 } 44 44 45 CodeGenerator::CodeGenerator( std::ostream &os ) : cur_indent( 0 ), insideFunction( false ), output( os ) { } 46 47 CodeGenerator::CodeGenerator( std::ostream &os, std::string init, int indent, bool infunp ) 48 : cur_indent( indent ), insideFunction( infunp ), output( os ) { 45 ostream & CodeGenerator::Indenter::operator()( ostream & output ) { 46 return output << string( cg.cur_indent, ' ' ); 47 } 48 49 ostream & operator<<( ostream & output, CodeGenerator::Indenter &indent ) { 50 return indent( output ); 51 } 52 53 CodeGenerator::CodeGenerator( std::ostream &os ) : indent(*this), cur_indent( 0 ), insideFunction( false ), output( os ) { } 54 55 CodeGenerator::CodeGenerator( std::ostream &os, std::string init, int indentation, bool infunp ) 56 : indent(*this), cur_indent( indentation ), insideFunction( infunp ), output( os ) { 49 57 //output << std::string( init ); 50 58 } 51 59 52 CodeGenerator::CodeGenerator( std::ostream &os, char *init, int indent , bool infunp )53 : cur_indent( indent), insideFunction( infunp ), output( os ) {60 CodeGenerator::CodeGenerator( std::ostream &os, char *init, int indentation, bool infunp ) 61 : indent(*this), cur_indent( indentation ), insideFunction( infunp ), output( os ) { 54 62 //output << std::string( init ); 55 63 } … … 62 70 } // if 63 71 } 64 72 65 73 //*** Declarations 66 74 void CodeGenerator::visit( FunctionDecl *functionDecl ) { … … 104 112 105 113 if ( ! memb.empty() ) { 106 output << endl << string( cur_indent, ' ' )<< "{" << endl;114 output << endl << indent << "{" << endl; 107 115 108 116 cur_indent += CodeGenerator::tabsize; 109 117 for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end(); i++) { 110 output << string( cur_indent, ' ' );118 output << indent; 111 119 (*i)->accept(*this ); 112 120 output << ";" << endl; … … 115 123 cur_indent -= CodeGenerator::tabsize; 116 124 117 output << string( cur_indent, ' ' )<< "}";125 output << indent << "}"; 118 126 } // if 119 127 } … … 138 146 139 147 if ( ! memb.empty() ) { 140 output << endl << "{" << endl;148 output << " {" << endl; 141 149 142 150 cur_indent += CodeGenerator::tabsize; … … 144 152 ObjectDecl *obj = dynamic_cast< ObjectDecl* >( *i ); 145 153 assert( obj ); 146 output << string( cur_indent, ' ' )<< mangleName( obj );154 output << indent << mangleName( obj ); 147 155 if ( obj->get_init() ) { 148 156 output << " = "; … … 154 162 cur_indent -= CodeGenerator::tabsize; 155 163 156 output << "}" << endl;164 output << indent << "}"; 157 165 } // if 158 166 } … … 444 452 445 453 for ( std::list<Statement *>::iterator i = ks.begin(); i != ks.end(); i++) { 446 output << string( cur_indent, ' ' )<< printLabels( (*i)->get_labels() );454 output << indent << printLabels( (*i)->get_labels() ); 447 455 (*i)->accept(*this ); 448 456 … … 454 462 cur_indent -= CodeGenerator::tabsize; 455 463 456 output << string( cur_indent, ' ' )<< "}";464 output << indent << "}"; 457 465 } 458 466 … … 494 502 cur_indent -= CodeGenerator::tabsize; 495 503 496 output << string( cur_indent, ' ' )<< "}";504 output << indent << "}"; 497 505 } 498 506 499 507 void CodeGenerator::visit( CaseStmt *caseStmt ) { 500 output << string( cur_indent, ' ' );508 output << indent; 501 509 if ( caseStmt->isDefault()) { 502 510 output << "default"; … … 511 519 cur_indent += CodeGenerator::tabsize; 512 520 for ( std::list<Statement *>::iterator i = sts.begin(); i != sts.end(); i++) { 513 output << string( cur_indent, ' ' )<< printLabels( (*i)->get_labels() ) ;521 output << indent << printLabels( (*i)->get_labels() ) ; 514 522 (*i)->accept(*this ); 515 523 output << endl; … … 564 572 whileStmt->get_body()->accept( *this ); 565 573 566 output << string( cur_indent, ' ' );574 output << indent; 567 575 568 576 if ( whileStmt->get_isDoWhile() ) { … … 596 604 597 605 void CodeGenerator::visit( NullStmt *nullStmt ) { 598 //output << string( cur_indent, ' ' )<< CodeGenerator::printLabels( nullStmt->get_labels() );606 //output << indent << CodeGenerator::printLabels( nullStmt->get_labels() ); 599 607 output << "/* null statement */ ;"; 600 608 } -
src/CodeGen/CodeGenerator.h
rbfbf97f ra8541d9 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon Jun 8 14:34:43 201513 // Update Count : 1511 // Last Modified By : Rob Schluntz 12 // Last Modified On : Thu Jun 11 13:24:23 2015 13 // Update Count : 23 14 14 // 15 15 … … 80 80 81 81 template< class Iterator > void genCommaList( Iterator begin, Iterator end ); 82 83 struct Indenter { 84 Indenter(CodeGenerator &cg) : cg(cg) {} 85 CodeGenerator & cg; 86 std::ostream& operator()(std::ostream & os); 87 }; 82 88 private: 89 90 Indenter indent; 83 91 int cur_indent; 84 92 bool insideFunction; -
src/Parser/parser.cc
rbfbf97f ra8541d9 9272 9272 std::cout << "in file " << yyfilename << " "; 9273 9273 } // if 9274 // std::cout << "at line " << yylineno << " reading token \"" << *(yylval.tok.str) << "\"" << std::endl; 9275 std::cout << "at line " << yylineno << " reading token \"" << yytext << "\"" << std::endl; 9274 std::cout << "at line " << yylineno << " reading token \"" << (yytext[0] == '\0' ? "EOF" : yytext) << "\"" << std::endl; 9276 9275 } 9277 9276 -
src/Parser/parser.yy
rbfbf97f ra8541d9 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jun 10 14:22:15201513 // Update Count : 10 3912 // Last Modified On : Wed Jun 10 20:31:54 2015 13 // Update Count : 1040 14 14 // 15 15 … … 2723 2723 std::cout << "in file " << yyfilename << " "; 2724 2724 } // if 2725 std::cout << "at line " << yylineno << " reading token \"" << yytext<< "\"" << std::endl;2725 std::cout << "at line " << yylineno << " reading token \"" << (yytext[0] == '\0' ? "EOF" : yytext) << "\"" << std::endl; 2726 2726 } 2727 2727 -
src/Tests/Expect-a/Constant0-1.txt
rbfbf97f ra8541d9 9 9 0: const signed int 10 10 1: const signed int 11 0: signed int 12 1: signed int 13 0: signed int 14 1: signed int 11 15 0: static const signed int 12 16 1: static const signed int … … 26 30 27 31 1: static const instance of struct __anonymous2 28 1: signed int29 32 0: pointer to signed int 30 1: signed int 31 1: signed int 33 1: pointer to signed int 32 34 0: pointer to signed int 35 1: pointer to signed int 33 36 0: pointer to signed int 37 1: pointer to signed int 34 38 0: pointer to signed int 39 1: pointer to signed int 35 40 0: const pointer to signed int 41 1: const pointer to signed int 36 42 0: const pointer to signed int 43 1: const pointer to signed int 37 44 0: const pointer to signed int 45 1: const pointer to signed int 38 46 struct __anonymous3 39 47 with members … … 68 76 x: const pointer to pointer to signed int 69 77 0: const pointer to pointer to signed int 78 main: C function 79 accepting unspecified arguments 80 returning 81 signed int 82 with body 83 CompoundStmt 84 Declaration of 1: signed int 85 Declaration of 0: pointer to signed int 86 Declaration of x: pointer to signed int 87 Declaration of 0: pointer to signed int 88 -
src/Tests/Expect-a/Forall.txt
rbfbf97f ra8541d9 1 ?=?: function 2 with parameters 3 pointer to signed int 4 signed int 5 returning 6 signed int 7 8 ?=?: function 9 with parameters 10 pointer to float 11 float 12 returning 13 float 14 15 ?=?: function 16 with parameters 17 pointer to pointer to signed int 18 pointer to signed int 19 returning 20 pointer to signed int 21 22 ?=?: function 23 with parameters 24 pointer to pointer to float 25 pointer to float 26 returning 27 pointer to float 28 29 ?=?: function 30 with parameters 31 pointer to char 32 char 33 returning 34 char 35 36 ?=?: function 37 with parameters 38 pointer to pointer to function 39 with parameters 40 void 41 returning 42 void 43 44 pointer to function 45 with parameters 46 void 47 returning 48 void 49 50 returning 51 pointer to function 52 with parameters 53 void 54 returning 55 void 56 57 58 g1: function 59 accepting unspecified arguments 60 returning 61 void 62 with body 63 CompoundStmt 64 Declaration of f: forall 65 T: type 66 with assertions 67 ?=?: function 68 with parameters 69 pointer to instance of type T (not function type) 70 instance of type T (not function type) 71 returning 72 instance of type T (not function type) 73 74 75 function 76 with parameters 77 instance of type T (not function type) 78 returning 79 instance of type T (not function type) 80 81 Declaration of f: function 82 with parameters 83 signed int 84 returning 85 void 86 87 Declaration of h: function 88 with parameters 89 p: pointer to function 90 with parameters 91 void 92 returning 93 void 94 95 returning 96 void 97 98 Declaration of x: signed int 99 Declaration of y: pointer to function 100 with parameters 101 void 102 returning 103 void 104 105 Declaration of z: char 106 Declaration of w: float 107 Expression Statement: 108 Applying untyped: 109 Name: f 110 ...to: 111 Name: x 112 113 Expression Statement: 114 Applying untyped: 115 Name: f 116 ...to: 117 Name: y 118 119 Expression Statement: 120 Applying untyped: 121 Name: f 122 ...to: 123 Name: z 124 125 Expression Statement: 126 Applying untyped: 127 Name: f 128 ...to: 129 Name: w 130 131 Expression Statement: 132 Applying untyped: 133 Name: h 134 ...to: 135 Applying untyped: 136 Name: f 137 ...to: 138 Name: y 139 140 141 g2: function 142 accepting unspecified arguments 143 returning 144 void 145 with body 146 CompoundStmt 147 Declaration of f: forall 148 T: type 149 with assertions 150 ?=?: function 151 with parameters 152 pointer to instance of type T (not function type) 153 instance of type T (not function type) 154 returning 155 instance of type T (not function type) 156 157 158 function 159 with parameters 160 instance of type T (not function type) 161 instance of type T (not function type) 162 returning 163 void 164 165 Declaration of f: forall 166 T: type 167 with assertions 168 ?=?: function 169 with parameters 170 pointer to instance of type T (not function type) 171 instance of type T (not function type) 172 returning 173 instance of type T (not function type) 174 175 176 U: type 177 with assertions 178 ?=?: function 179 with parameters 180 pointer to instance of type U (not function type) 181 instance of type U (not function type) 182 returning 183 instance of type U (not function type) 184 185 186 function 187 with parameters 188 instance of type T (not function type) 189 instance of type U (not function type) 190 returning 191 void 192 193 Declaration of x: signed int 194 Declaration of y: float 195 Declaration of z: pointer to signed int 196 Declaration of w: pointer to float 197 Expression Statement: 198 Applying untyped: 199 Name: f 200 ...to: 201 Name: x 202 Name: y 203 204 Expression Statement: 205 Applying untyped: 206 Name: f 207 ...to: 208 Name: z 209 Name: w 210 211 Expression Statement: 212 Applying untyped: 213 Name: f 214 ...to: 215 Name: x 216 Name: z 217 218 1 219 f: typedef for pointer to forall 2 220 T: type … … 285 503 286 504 505 min: forall 506 T: type 507 with assertions 508 ?=?: function 509 with parameters 510 pointer to instance of type T (not function type) 511 instance of type T (not function type) 512 returning 513 instance of type T (not function type) 514 515 0: const instance of type T (not function type) 516 ?!=?: function 517 with parameters 518 instance of type T (not function type) 519 instance of type T (not function type) 520 returning 521 signed int 522 523 ?<?: function 524 with parameters 525 instance of type T (not function type) 526 instance of type T (not function type) 527 returning 528 signed int 529 530 531 function 532 with parameters 533 t1: instance of type T (not function type) 534 t2: instance of type T (not function type) 535 returning 536 instance of type T (not function type) 537 with body 538 CompoundStmt 539 Return Statement, returning: Conditional expression on: 540 Cast of: 541 Applying untyped: 542 Name: ?!=? 543 ...to: 544 Applying untyped: 545 Name: ?<? 546 ...to: 547 Name: t1 548 Name: t2 549 Name: 0 550 551 to: 552 signed int 553 First alternative: 554 Name: t1 555 Second alternative: 556 Name: t2 557 558 559 560 287 561 main: C function 288 562 accepting unspecified arguments … … 310 584 ...to: 311 585 Name: x 312 Name: y313 586 314 587 Expression Statement: -
src/Tests/Expect-a/Functions.txt
rbfbf97f ra8541d9 681 681 f: function 682 682 with parameters 683 function 684 with parameters 685 instance of type T (not function type) 686 returning 687 instance of type T (not function type) 688 689 T: instance of type T (not function type) 690 returning 691 signed int 692 with body 693 CompoundStmt 694 Expression Statement: 695 Applying untyped: 696 Name: T 697 ...to: 698 Name: T 699 700 683 f: pointer to instance of type T (not function type) 684 t: instance of type T (not function type) 685 returning 686 signed int 687 with body 688 CompoundStmt 689 Declaration of T: instance of type T (not function type) 690 -
src/Tests/Expect-a/Initialization.txt
rbfbf97f ra8541d9 1 x 21: pointer to signed int with initializer1 x11: pointer to signed int with initializer 2 2 Simple Initializer: Name: 0 3 3 4 x 22: signed int with initializer4 x12: signed int with initializer 5 5 Simple Initializer: Name: 0 6 6 … … 82 82 constant expression 3 signed int Name: g3 83 83 84 struct point 85 with members 86 x: signed int 87 z: signed int 88 struct __anonymous4 89 with members 90 y1: signed int 91 y2: signed int 92 y3: signed int 93 94 y: instance of struct __anonymous4 95 w: signed int 96 97 struct quintet 98 with members 99 v: signed int 100 w: signed int 101 x: signed int 102 y: signed int 103 z: signed int 104 105 main: C function 106 accepting unspecified arguments 107 returning 108 signed int 109 with body 110 CompoundStmt 111 Declaration of p1: instance of struct point with initializer 112 Compound initializer: 113 Simple Initializer: constant expression 3 signed int 114 designated by: Name: x 115 116 Declaration of p2: instance of struct point with initializer 117 Compound initializer: 118 Simple Initializer: constant expression 3 signed int 119 Simple Initializer: constant expression 4 signed int 120 Declaration of p3: instance of struct point with initializer 121 Compound initializer: 122 Simple Initializer: constant expression 5 signed int 123 designated by: Name: x 124 Name: z 125 126 Compound initializer: designated by: [ Name: y 127 ] 128 Simple Initializer: constant expression 6 signed int 129 designated by: Name: y3 130 Name: y1 131 132 Simple Initializer: constant expression 17 signed int 133 Declaration of p4: instance of struct point with initializer 134 Compound initializer: 135 Simple Initializer: constant expression 5 signed int 136 designated by: Name: w 137 138 Simple Initializer: constant expression 4 signed int 139 -
src/Tests/Expect-a/Tuple.txt
rbfbf97f ra8541d9 22 22 returning 23 23 signed int 24 signed int25 signed int24 pointer to signed int 25 pointer to signed int 26 26 signed int 27 27 … … 135 135 constant expression 17 signed int 136 136 constant expression 3 signed int 137 138 Expression Statement: 139 Applying untyped: 140 Name: ?=? 141 ...to: 142 Address of: 143 Tuple: 144 Name: x 145 146 Name: y 147 148 Name: z 149 150 Cast of: 151 Tuple: 152 Name: p 153 154 Applying untyped: 155 Name: f 156 ...to: 157 constant expression 17 signed int 158 constant expression 3 signed int 159 160 to: 161 short signed int 162 unsigned int 163 tuple of types 164 signed int 165 signed int 166 137 167 138 168 Expression Statement: … … 201 231 Name: t1 202 232 constant expression 3 signed int 233 Expression Statement: 234 Tuple: 235 203 236 Expression Statement: 204 237 Tuple: … … 494 527 ...to: 495 528 Address of: 529 Tuple: 530 Name: a 531 532 Name: b 533 534 Applying untyped: 535 Name: h 536 ...to: 537 constant expression 3 signed int constant expression 3 signed int Name: 0 538 constant expression "abc" array of char with dimension of constant expression 6 unsigned int 539 Expression Statement: 540 Applying untyped: 541 Name: ?=? 542 ...to: 543 Address of: 496 544 Name: sp 497 545 Name: sp -
src/Tests/Expect-a/TypeGenerator.txt
rbfbf97f ra8541d9 11 11 instance of type T (not function type) 12 12 13 ?=?: function 14 with parameters 15 pointer to instance of type T (not function type) 16 instance of type T (not function type) 17 returning 18 instance of type T (not function type) 19 13 20 14 21 struct __anonymous0 15 22 with members 16 23 data: instance of type T (not function type) 17 next: pointer to instance of type List (not function type)24 next: pointer to instance of type List1 (not function type) 18 25 with parameters 19 26 instance of type T (not function type) 20 27 21 28 22 List : type for pointer to instance of struct __anonymous029 List1: type for pointer to instance of struct __anonymous0 23 30 with parameters 24 31 T: type … … 30 37 31 38 32 with assertions 33 instance of context addable 34 with parameters 35 instance of type T (not function type) 36 37 38 ListOfIntegers: typedef for instance of type List (not function type) 39 ListOfIntegers: typedef for instance of type List1 (not function type) 39 40 with parameters 40 41 signed int … … 47 48 signed int 48 49 returning 49 instance of type List (not function type)50 instance of type List1 (not function type) 50 51 with parameters 51 52 signed int … … 57 58 h: function 58 59 with parameters 59 p: pointer to instance of type List (not function type)60 p: pointer to instance of type List1 (not function type) 60 61 with parameters 61 62 signed int … … 63 64 returning 64 65 signed int 66 67 struct S1 68 with parameters 69 T: type 70 71 struct S1 72 with parameters 73 T: type 74 75 with members 76 i: instance of type T (not function type) 77 78 v1: instance of struct S1 79 with parameters 80 signed int 81 82 p: pointer to instance of struct S1 83 with parameters 84 signed int 85 86 struct S2 87 with parameters 88 T: type 89 90 with members 91 i: instance of type T (not function type) 92 93 v2: instance of struct S2 94 with parameters 95 signed int 96 97 struct __anonymous1 98 with parameters 99 T: type 100 101 with members 102 i: instance of type T (not function type) 103 104 v2: instance of struct __anonymous1 105 with parameters 106 signed int 65 107 66 108 struct node -
src/Tests/Expect-a/Typedef.txt
rbfbf97f ra8541d9 44 44 45 45 c: instance of type a (not function type) 46 x: typedef for type-of expression constant expression 3 signed int 47 y: typedef for type-of expression constant expression 3 signed int 48 p: instance of type x (not function type) 49 q: instance of type y (not function type) 46 50 main: C function 47 51 accepting unspecified arguments … … 50 54 with body 51 55 CompoundStmt 56 Declaration of z: typedef for type-of expression constant expression 3 signed int 57 Declaration of p: typedef for type-of expression constant expression 3 signed int 58 Declaration of w: instance of type z (not function type) 59 Declaration of x: instance of type p (not function type) 52 60 53 61 arrayOf10Pointers: typedef for array of pointer to signed int with dimension of constant expression 10 signed int 54 x: instance of type arrayOf10Pointers (not function type)62 array: instance of type arrayOf10Pointers (not function type) 55 63 constantPointer: typedef for const pointer to signed int 56 64 funcPtr: typedef for pointer to function -
src/Tests/Expect-a/VariableDeclarator.txt
rbfbf97f ra8541d9 33 33 f33: open array of const pointer to const pointer to signed int 34 34 f34: array of const pointer to const pointer to signed int with dimension of constant expression 10 signed int 35 f35: open array of pointer tosigned int36 f36: array of pointer tosigned int with dimension of constant expression 10 signed int37 f37: open array of pointer to pointer tosigned int38 f38: array of pointer to pointer tosigned int with dimension of constant expression 10 signed int39 f39: open array of pointer to const pointer tosigned int40 f40: array of pointer to const pointer tosigned int with dimension of constant expression 10 signed int41 f41: open array of const pointer to const pointer tosigned int42 f42: array of const pointer to const pointer tosigned int with dimension of constant expression 10 signed int35 f35: pointer to open array of signed int 36 f36: pointer to array of signed int with dimension of constant expression 10 signed int 37 f37: pointer to pointer to open array of signed int 38 f38: pointer to pointer to array of signed int with dimension of constant expression 10 signed int 39 f39: pointer to const pointer to open array of signed int 40 f40: pointer to const pointer to array of signed int with dimension of constant expression 10 signed int 41 f41: const pointer to const pointer to open array of signed int 42 f42: const pointer to const pointer to array of signed int with dimension of constant expression 10 signed int 43 43 f43: open array of array of signed int with dimension of constant expression 3 signed int 44 44 f44: array of array of signed int with dimension of constant expression 3 signed int with dimension of constant expression 3 signed int … … 177 177 178 178 179 z: pointer to array of double with dimension of constant expression 20 signed int 180 w: array of pointer to char with dimension of constant expression 20 signed int 179 cf3: pointer to signed int 180 cf4: pointer to pointer to signed int 181 cf5: pointer to const pointer to signed int 182 cf6: const pointer to const pointer to signed int 183 cf15: open array of signed int 184 cf16: array of signed int with dimension of constant expression 10 signed int 185 cf19: open array of pointer to signed int 186 cf20: array of pointer to signed int with dimension of constant expression 10 signed int 187 cf21: open array of pointer to pointer to signed int 188 cf22: array of pointer to pointer to signed int with dimension of constant expression 10 signed int 189 cf23: open array of pointer to const pointer to signed int 190 cf24: array of pointer to const pointer to signed int with dimension of constant expression 10 signed int 191 cf25: open array of const pointer to const pointer to signed int 192 cf26: array of const pointer to const pointer to signed int with dimension of constant expression 10 signed int 193 cf35: pointer to open array of signed int 194 cf36: pointer to array of signed int with dimension of constant expression 10 signed int 195 cf37: pointer to pointer to open array of signed int 196 cf38: pointer to pointer to array of signed int with dimension of constant expression 10 signed int 197 cf39: pointer to const pointer to open array of signed int 198 cf40: pointer to const pointer to array of signed int with dimension of constant expression 10 signed int 199 cf41: const pointer to const pointer to open array of signed int 200 cf42: const pointer to const pointer to array of signed int with dimension of constant expression 10 signed int 201 cf43: open array of array of signed int with dimension of constant expression 3 signed int 202 cf44: array of array of signed int with dimension of constant expression 3 signed int with dimension of constant expression 3 signed int 203 cf49: open array of array of pointer to signed int with dimension of constant expression 3 signed int 204 cf50: array of array of pointer to signed int with dimension of constant expression 3 signed int with dimension of constant expression 3 signed int 205 cf51: open array of array of pointer to pointer to signed int with dimension of constant expression 3 signed int 206 cf52: array of array of pointer to pointer to signed int with dimension of constant expression 3 signed int with dimension of constant expression 3 signed int 207 cf53: open array of array of const pointer to signed int with dimension of constant expression 3 signed int 208 cf54: array of array of pointer to const pointer to signed int with dimension of constant expression 3 signed int with dimension of constant expression 3 signed int 209 cf55: open array of array of const pointer to const pointer to signed int with dimension of constant expression 3 signed int 210 cf56: array of array of const pointer to const pointer to signed int with dimension of constant expression 3 signed int with dimension of constant expression 3 signed int 211 cf65: function 212 with parameters 213 signed int 214 returning 215 signed int 216 217 cf66: function 218 with parameters 219 signed int 220 returning 221 signed int 222 223 cf67: function 224 with parameters 225 signed int 226 returning 227 pointer to signed int 228 229 cf68: function 230 with parameters 231 signed int 232 returning 233 pointer to pointer to signed int 234 235 cf69: function 236 with parameters 237 signed int 238 returning 239 const pointer to pointer to signed int 240 241 cf70: function 242 with parameters 243 signed int 244 returning 245 const pointer to const pointer to signed int 246 181 247 v3: pointer to open array of pointer to open array of pointer to function 182 248 with parameters -
src/Tests/Expect-e/MiscError.txt
rbfbf97f ra8541d9 5 5 nothing 6 6 Alternatives are: Cost ( 0, 0, 1 ): Cast of: 7 Variable Expression: b: asigned int7 Variable Expression: b: signed int 8 8 9 9 to: … … 14 14 15 15 Cost ( 0, 0, 1 ): Cast of: 16 Variable Expression: b: afloat16 Variable Expression: b: float 17 17 18 18 to: … … 29 29 nothing 30 30 Alternatives are: Cost ( 0, 0, 1 ): Cast of: 31 Variable Expression: b: asigned int31 Variable Expression: b: signed int 32 32 33 33 to: … … 38 38 39 39 Cost ( 0, 0, 1 ): Cast of: 40 Variable Expression: b: afloat40 Variable Expression: b: float 41 41 42 42 to: … … 57 57 Alternatives are: Cost ( 0, 0, 1 ): Cast of: 58 58 Comma Expression: 59 Variable Expression: a: asigned int59 Variable Expression: a: signed int 60 60 61 Variable Expression: b: asigned int61 Variable Expression: b: signed int 62 62 63 63 to: … … 69 69 Cost ( 0, 0, 1 ): Cast of: 70 70 Comma Expression: 71 Variable Expression: a: asigned int71 Variable Expression: a: signed int 72 72 73 Variable Expression: b: afloat73 Variable Expression: b: float 74 74 75 75 to: -
src/Tests/Expect-e/OccursError.txt
rbfbf97f ra8541d9 1 1 Error: No reasonable alternatives for expression Applying untyped: 2 2 Name: f 3 4 3 ...to: 5 4 Name: g -
src/Tests/Expect-s/TypeGenerator.txt
rbfbf97f ra8541d9 1 Adding function swap2 1 --- Entering scope 3 2 --- Entering scope 4 3 --- Leaving scope containing 5 4 Adding type T 6 Adding function ?=?7 --- Entering scope8 --- Leaving scope containing9 Adding object left10 Adding object right11 --- Entering scope12 Adding object temp13 --- Leaving scope containing14 --- Leaving scope containing15 T16 --- Entering scope17 --- Entering scope18 --- Leaving scope containing19 Adding type T20 Adding object 021 5 Adding function ?+? 22 --- Entering scope23 --- Leaving scope containing24 Adding function ?++25 --- Entering scope26 --- Leaving scope containing27 Adding function ?+=?28 6 --- Entering scope 29 7 --- Leaving scope containing 30 8 --- Leaving scope containing 31 9 T 32 Adding context sumable 33 --- Entering scope 34 --- Leaving scope containing 35 Adding type T1 36 Adding object 0 37 Adding function ?+? 38 --- Entering scope 39 --- Leaving scope containing 40 Adding function ?++ 41 --- Entering scope 42 --- Leaving scope containing 43 Adding function ?+=? 44 --- Entering scope 45 --- Leaving scope containing 46 --- Entering scope 47 --- Entering scope 48 --- Leaving scope containing 49 Adding type P1 50 --- Entering scope 51 --- Leaving scope containing 52 Adding type P2 53 --- Leaving scope containing 54 P1 55 P2 56 Adding type T2 57 --- Entering scope 58 --- Leaving scope containing 59 Adding type T3 10 Adding context addable 60 11 Adding fwd decl for struct __anonymous0 61 12 --- Entering scope 62 Adding object i63 Adding object j13 Adding object data 14 Adding object next 64 15 --- Leaving scope containing 65 16 Adding struct __anonymous0 … … 67 18 --- Entering scope 68 19 --- Leaving scope containing 69 Adding type P1 70 --- Entering scope 71 --- Leaving scope containing 72 Adding type P2 20 Adding type T 73 21 --- Entering scope 74 22 --- Leaving scope containing 75 23 --- Leaving scope containing 76 P1 77 P2 78 Adding type T2 79 Adding object w1 80 Adding object g2 24 T 25 Adding type List1 26 Adding object li 27 Adding function f 81 28 --- Entering scope 29 Adding object g 82 30 --- Leaving scope containing 83 Adding type w3 84 Adding object g3 85 Adding function sum 31 Adding function h 32 --- Entering scope 33 Adding object p 34 --- Leaving scope containing 35 Adding fwd decl for struct S1 86 36 --- Entering scope 87 37 --- Entering scope 88 38 --- Leaving scope containing 89 39 Adding type T 90 Adding function ?=? 40 --- Leaving scope containing 41 T 42 Adding struct S1 43 Adding fwd decl for struct S1 44 --- Entering scope 91 45 --- Entering scope 92 46 --- Leaving scope containing 93 Adding object n 94 Adding object a 47 Adding type T 48 Adding object i 49 --- Leaving scope containing 50 T 51 Adding struct S1 95 52 --- Entering scope 96 Adding object total 53 --- Leaving scope containing 54 Adding object v1 55 --- Entering scope 56 --- Leaving scope containing 57 Adding object p 58 Adding fwd decl for struct S2 59 --- Entering scope 60 --- Entering scope 61 --- Leaving scope containing 62 Adding type T 97 63 Adding object i 64 --- Leaving scope containing 65 T 66 Adding struct S2 67 --- Entering scope 68 --- Leaving scope containing 69 Adding object v2 70 Adding fwd decl for struct __anonymous1 71 --- Entering scope 72 --- Entering scope 73 --- Leaving scope containing 74 Adding type T 75 Adding object i 76 --- Leaving scope containing 77 T 78 Adding struct __anonymous1 79 --- Entering scope 80 --- Leaving scope containing 81 Adding object v2 82 Adding fwd decl for struct node 83 --- Entering scope 84 --- Entering scope 85 --- Leaving scope containing 86 Adding type T 87 Adding object data 88 --- Entering scope 89 --- Leaving scope containing 90 Adding object next 91 --- Leaving scope containing 92 T 93 Adding struct node 94 --- Entering scope 95 --- Entering scope 96 --- Leaving scope containing 97 Adding type T 98 --- Entering scope 99 --- Leaving scope containing 100 --- Leaving scope containing 101 T 102 Adding type List 103 Adding object my_list 104 --- Entering scope 105 --- Leaving scope containing 106 Adding type Complex 107 Adding function main 108 --- Entering scope 109 --- Entering scope 98 110 --- Entering scope 99 111 --- Leaving scope containing 100 112 --- Leaving scope containing 101 113 --- Leaving scope containing 102 T103 Adding function twice104 --- Entering scope105 --- Entering scope106 --- Leaving scope containing107 Adding type T108 Adding function ?=?109 --- Entering scope110 --- Leaving scope containing111 Adding object 0112 Adding function ?+?113 --- Entering scope114 --- Leaving scope containing115 Adding function ?++116 --- Entering scope117 --- Leaving scope containing118 Adding function ?+=?119 --- Entering scope120 --- Leaving scope containing121 Adding object t122 --- Entering scope123 --- Leaving scope containing124 --- Leaving scope containing125 T126 Adding function main127 --- Entering scope128 --- Entering scope129 Adding object x130 Adding object y131 Adding object a132 Adding object f133 --- Leaving scope containing134 --- Leaving scope containing -
src/main.cc
rbfbf97f ra8541d9 9 9 // Author : Richard C. Bilson 10 10 // Created On : Fri May 15 23:12:02 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : T ue Jun 09 15:10:05201513 // Update Count : 6 811 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 11 11:06:04 2015 13 // Update Count : 69 14 14 // 15 15 … … 71 71 errorp = false; 72 72 73 enum { Ast, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, P rototypes, Resolver, Symbol, Parse, };73 enum { Ast, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Validate, }; 74 74 75 75 static struct option long_opts[] = { … … 80 80 { "libcfa", no_argument, 0, LibCFA }, 81 81 { "nopreamble", no_argument, 0, Nopreamble }, 82 { "parse", no_argument, 0, Parse }, 82 83 { "prototypes", no_argument, 0, Prototypes }, 83 84 { "resolver", no_argument, 0, Resolver }, 84 85 { "symbol", no_argument, 0, Symbol }, 85 { " parse", no_argument, 0, Parse },86 { "validate", no_argument, 0, Validate }, 86 87 { 0, 0, 0, 0 } 87 88 }; … … 96 97 97 98 int c; 98 while ( (c = getopt_long( argc, argv, "aefglnpqrs xyzD:", long_opts, &long_index )) != -1 ) {99 while ( (c = getopt_long( argc, argv, "aefglnpqrsvyzD:", long_opts, &long_index )) != -1 ) { 99 100 switch ( c ) { 100 101 case Ast: … … 138 139 symtabp = true; 139 140 break; 140 case ' x': // dump AST after decl validation pass141 case 'v': // dump AST after decl validation pass 141 142 validp = true; 142 143 break;
Note:
See TracChangeset
for help on using the changeset viewer.