Changeset a8541d9


Ignore:
Timestamp:
Jun 11, 2015, 1:31:07 PM (10 years ago)
Author:
Rob Schluntz <rschlunt@…>
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.
Message:

Merge branch 'code-gen' into resolver

Location:
src
Files:
323 added
40 deleted
5 edited
81 moved

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    rbfbf97f ra8541d9  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Thu Jun 04 15:00:00 2015
    13 // Update Count     : 125
     12// Last Modified On : Thu Jun 11 13:22:39 2015
     13// Update Count     : 137
    1414//
    1515
     
    4343        }
    4444
    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 ) {
    4957                //output << std::string( init );
    5058        }
    5159
    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 ) {
    5462                //output << std::string( init );
    5563        }
     
    6270                } // if
    6371        }
    64   
     72 
    6573        //*** Declarations
    6674        void CodeGenerator::visit( FunctionDecl *functionDecl ) {
     
    104112
    105113                if ( ! memb.empty() ) {
    106                         output << endl << string( cur_indent, ' ' ) << "{" << endl;
     114                        output << endl << indent << "{" << endl;
    107115
    108116                        cur_indent += CodeGenerator::tabsize;
    109117                        for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end();  i++) {
    110                                 output << string( cur_indent, ' ' );
     118                                output << indent;
    111119                                (*i)->accept(*this );
    112120                                output << ";" << endl;
     
    115123                        cur_indent -= CodeGenerator::tabsize;
    116124
    117                         output << string( cur_indent, ' ' ) << "}";
     125                        output << indent << "}";
    118126                } // if
    119127        }
     
    138146
    139147                if ( ! memb.empty() ) {
    140                         output << endl << "{" << endl;
     148                        output << " {" << endl;
    141149
    142150                        cur_indent += CodeGenerator::tabsize;
     
    144152                                ObjectDecl *obj = dynamic_cast< ObjectDecl* >( *i );
    145153                                assert( obj );
    146                                 output << string( cur_indent, ' ' ) << mangleName( obj );
     154                                output << indent << mangleName( obj );
    147155                                if ( obj->get_init() ) {
    148156                                        output << " = ";
     
    154162                        cur_indent -= CodeGenerator::tabsize;
    155163
    156                         output << "}" << endl;
     164                        output << indent << "}";
    157165                } // if
    158166        }
     
    444452
    445453                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() );
    447455                        (*i)->accept(*this );
    448456
     
    454462                cur_indent -= CodeGenerator::tabsize;
    455463
    456                 output << string( cur_indent, ' ' ) << "}";
     464                output << indent << "}";
    457465        }
    458466
     
    494502                cur_indent -= CodeGenerator::tabsize;
    495503
    496                 output << string( cur_indent, ' ' ) << "}";
     504                output << indent << "}";
    497505        }
    498506
    499507        void CodeGenerator::visit( CaseStmt *caseStmt ) {
    500                 output << string( cur_indent, ' ' );
     508                output << indent;
    501509                if ( caseStmt->isDefault()) {
    502510                        output << "default";
     
    511519                cur_indent += CodeGenerator::tabsize;
    512520                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() )  ;
    514522                        (*i)->accept(*this );
    515523                        output << endl;
     
    564572                whileStmt->get_body()->accept( *this );
    565573
    566                 output << string( cur_indent, ' ' );
     574                output << indent;
    567575
    568576                if ( whileStmt->get_isDoWhile() ) {
     
    596604
    597605        void CodeGenerator::visit( NullStmt *nullStmt ) {
    598                 //output << string( cur_indent, ' ' ) << CodeGenerator::printLabels( nullStmt->get_labels() );
     606                //output << indent << CodeGenerator::printLabels( nullStmt->get_labels() );
    599607                output << "/* null statement */ ;";
    600608        }
  • src/CodeGen/CodeGenerator.h

    rbfbf97f ra8541d9  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jun  8 14:34:43 2015
    13 // Update Count     : 15
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Thu Jun 11 13:24:23 2015
     13// Update Count     : 23
    1414//
    1515
     
    8080
    8181                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                };
    8288          private:
     89
     90                Indenter indent;
    8391                int cur_indent;
    8492                bool insideFunction;
  • src/Parser/parser.cc

    rbfbf97f ra8541d9  
    92729272            std::cout << "in file " << yyfilename << " ";
    92739273        } // 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;
    92769275}
    92779276
  • src/Parser/parser.yy

    rbfbf97f ra8541d9  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jun 10 14:22:15 2015
    13 // Update Count     : 1039
     12// Last Modified On : Wed Jun 10 20:31:54 2015
     13// Update Count     : 1040
    1414//
    1515
     
    27232723            std::cout << "in file " << yyfilename << " ";
    27242724        } // 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;
    27262726}
    27272727
  • src/Tests/Expect-a/Constant0-1.txt

    rbfbf97f ra8541d9  
    990: const signed int
    10101: const signed int
     110: signed int
     121: signed int
     130: signed int
     141: signed int
    11150: static const signed int
    12161: static const signed int
     
    2630
    27311: static const instance of struct __anonymous2
    28 1: signed int
    29320: pointer to signed int
    30 1: signed int
    31 1: signed int
     331: pointer to signed int
    32340: pointer to signed int
     351: pointer to signed int
    33360: pointer to signed int
     371: pointer to signed int
    34380: pointer to signed int
     391: pointer to signed int
    35400: const pointer to signed int
     411: const pointer to signed int
    36420: const pointer to signed int
     431: const pointer to signed int
    37440: const pointer to signed int
     451: const pointer to signed int
    3846struct __anonymous3
    3947    with members
     
    6876x: const pointer to pointer to signed int
    69770: const pointer to pointer to signed int
     78main: 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
     58g1: 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
     141g2: 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
    1219f: typedef for pointer to forall
    2220      T: type
     
    285503
    286504
     505min: 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
     553First alternative:
     554  Name: t1
     555Second alternative:
     556  Name: t2
     557
     558
     559
     560
    287561main: C function
    288562      accepting unspecified arguments
     
    310584            ...to:
    311585                Name: x
    312                 Name: y
    313586
    314587                  Expression Statement:
  • src/Tests/Expect-a/Functions.txt

    rbfbf97f ra8541d9  
    681681f: function
    682682    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 x21: pointer to signed int with initializer
     1x11: pointer to signed int with initializer
    22  Simple Initializer:     Name: 0
    33
    4 x22: signed int with initializer
     4x12: signed int with initializer
    55  Simple Initializer:     Name: 0
    66
     
    8282constant expression 3 signed int         Name: g3
    8383
     84struct 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
     97struct 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
     105main: 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  
    2222    returning
    2323      signed int
    24       signed int
    25       signed int
     24      pointer to signed int
     25      pointer to signed int
    2626      signed int
    2727
     
    135135constant expression 17 signed int
    136136                  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:
     157constant 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
    137167
    138168                  Expression Statement:
     
    201231                Name: t1
    202232constant expression 3 signed int
     233                  Expression Statement:
     234            Tuple:
     235
    203236                  Expression Statement:
    204237            Tuple:
     
    494527            ...to:
    495528                Address of:
     529                  Tuple:
     530                                          Name: a
     531
     532                                          Name: b
     533
     534                Applying untyped:
     535                    Name: h
     536                ...to:
     537constant expression 3 signed int constant expression 3 signed int                     Name: 0
     538constant 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:
    496544                  Name: sp
    497545                Name: sp
  • src/Tests/Expect-a/TypeGenerator.txt

    rbfbf97f ra8541d9  
    1111            instance of type T (not function type)
    1212
     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
    1320
    1421struct __anonymous0
    1522    with members
    1623      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)
    1825        with parameters
    1926          instance of type T (not function type)
    2027
    2128
    22 List: type for pointer to instance of struct __anonymous0
     29List1: type for pointer to instance of struct __anonymous0
    2330  with parameters
    2431    T: type
     
    3037
    3138
    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)
     39ListOfIntegers: typedef for instance of type List1 (not function type)
    3940  with parameters
    4041    signed int
     
    4748            signed int
    4849          returning
    49             instance of type List (not function type)
     50            instance of type List1 (not function type)
    5051              with parameters
    5152                signed int
     
    5758h: function
    5859    with parameters
    59       p: pointer to instance of type List (not function type)
     60      p: pointer to instance of type List1 (not function type)
    6061        with parameters
    6162          signed int
     
    6364    returning
    6465      signed int
     66
     67struct S1
     68    with parameters
     69      T: type
     70
     71struct S1
     72    with parameters
     73      T: type
     74
     75    with members
     76      i: instance of type T (not function type)
     77
     78v1: instance of struct S1
     79  with parameters
     80    signed int
     81
     82p: pointer to instance of struct S1
     83  with parameters
     84    signed int
     85
     86struct S2
     87    with parameters
     88      T: type
     89
     90    with members
     91      i: instance of type T (not function type)
     92
     93v2: instance of struct S2
     94  with parameters
     95    signed int
     96
     97struct __anonymous1
     98    with parameters
     99      T: type
     100
     101    with members
     102      i: instance of type T (not function type)
     103
     104v2: instance of struct __anonymous1
     105  with parameters
     106    signed int
    65107
    66108struct node
  • src/Tests/Expect-a/Typedef.txt

    rbfbf97f ra8541d9  
    4444
    4545c: instance of type a (not function type)
     46x: typedef for type-of expression constant expression 3 signed int
     47y: typedef for type-of expression constant expression 3 signed int
     48p: instance of type x (not function type)
     49q: instance of type y (not function type)
    4650main: C function
    4751      accepting unspecified arguments
     
    5054    with body
    5155      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)
    5260
    5361arrayOf10Pointers: 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)
     62array: instance of type arrayOf10Pointers (not function type)
    5563constantPointer: typedef for const pointer to signed int
    5664funcPtr: typedef for pointer to function
  • src/Tests/Expect-a/VariableDeclarator.txt

    rbfbf97f ra8541d9  
    3333f33: open array of const pointer to const pointer to signed int
    3434f34: array of const pointer to const pointer to signed int with dimension of constant expression 10 signed int
    35 f35: open array of pointer to signed int
    36 f36: array of pointer to signed int with dimension of constant expression 10 signed int
    37 f37: open array of pointer to pointer to signed int
    38 f38: array of pointer to pointer to signed int with dimension of constant expression 10 signed int
    39 f39: open array of pointer to const pointer to signed int
    40 f40: array of pointer to const pointer to signed int with dimension of constant expression 10 signed int
    41 f41: open array of const pointer to const pointer to signed int
    42 f42: array of const pointer to const pointer to signed int with dimension of constant expression 10 signed int
     35f35: pointer to open array of signed int
     36f36: pointer to array of signed int with dimension of constant expression 10 signed int
     37f37: pointer to pointer to open array of signed int
     38f38: pointer to pointer to array of signed int with dimension of constant expression 10 signed int
     39f39: pointer to const pointer to open array of signed int
     40f40: pointer to const pointer to array of signed int with dimension of constant expression 10 signed int
     41f41: const pointer to const pointer to open array of signed int
     42f42: const pointer to const pointer to array of signed int with dimension of constant expression 10 signed int
    4343f43: open array of array of signed int with dimension of constant expression 3 signed int
    4444f44: array of array of signed int with dimension of constant expression 3 signed int with dimension of constant expression 3 signed int
     
    177177
    178178
    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
     179cf3: pointer to signed int
     180cf4: pointer to pointer to signed int
     181cf5: pointer to const pointer to signed int
     182cf6: const pointer to const pointer to signed int
     183cf15: open array of signed int
     184cf16: array of signed int with dimension of constant expression 10 signed int
     185cf19: open array of pointer to signed int
     186cf20: array of pointer to signed int with dimension of constant expression 10 signed int
     187cf21: open array of pointer to pointer to signed int
     188cf22: array of pointer to pointer to signed int with dimension of constant expression 10 signed int
     189cf23: open array of pointer to const pointer to signed int
     190cf24: array of pointer to const pointer to signed int with dimension of constant expression 10 signed int
     191cf25: open array of const pointer to const pointer to signed int
     192cf26: array of const pointer to const pointer to signed int with dimension of constant expression 10 signed int
     193cf35: pointer to open array of signed int
     194cf36: pointer to array of signed int with dimension of constant expression 10 signed int
     195cf37: pointer to pointer to open array of signed int
     196cf38: pointer to pointer to array of signed int with dimension of constant expression 10 signed int
     197cf39: pointer to const pointer to open array of signed int
     198cf40: pointer to const pointer to array of signed int with dimension of constant expression 10 signed int
     199cf41: const pointer to const pointer to open array of signed int
     200cf42: const pointer to const pointer to array of signed int with dimension of constant expression 10 signed int
     201cf43: open array of array of signed int with dimension of constant expression 3 signed int
     202cf44: array of array of signed int with dimension of constant expression 3 signed int with dimension of constant expression 3 signed int
     203cf49: open array of array of pointer to signed int with dimension of constant expression 3 signed int
     204cf50: array of array of pointer to signed int with dimension of constant expression 3 signed int with dimension of constant expression 3 signed int
     205cf51: open array of array of pointer to pointer to signed int with dimension of constant expression 3 signed int
     206cf52: 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
     207cf53: open array of array of const pointer to signed int with dimension of constant expression 3 signed int
     208cf54: 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
     209cf55: open array of array of const pointer to const pointer to signed int with dimension of constant expression 3 signed int
     210cf56: 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
     211cf65: function
     212    with parameters
     213      signed int
     214    returning
     215      signed int
     216
     217cf66: function
     218    with parameters
     219      signed int
     220    returning
     221      signed int
     222
     223cf67: function
     224    with parameters
     225      signed int
     226    returning
     227      pointer to signed int
     228
     229cf68: function
     230    with parameters
     231      signed int
     232    returning
     233      pointer to pointer to signed int
     234
     235cf69: function
     236    with parameters
     237      signed int
     238    returning
     239      const pointer to pointer to signed int
     240
     241cf70: function
     242    with parameters
     243      signed int
     244    returning
     245      const pointer to const pointer to signed int
     246
    181247v3: pointer to open array of pointer to open array of pointer to function
    182248    with parameters
  • src/Tests/Expect-e/MiscError.txt

    rbfbf97f ra8541d9  
    55  nothing
    66Alternatives are:        Cost ( 0, 0, 1 ):         Cast of:
    7           Variable Expression: b: a signed int
     7          Variable Expression: b: signed int
    88
    99        to:
     
    1414
    1515        Cost ( 0, 0, 1 ):         Cast of:
    16           Variable Expression: b: a float
     16          Variable Expression: b: float
    1717
    1818        to:
     
    2929  nothing
    3030Alternatives are:        Cost ( 0, 0, 1 ):         Cast of:
    31           Variable Expression: b: a signed int
     31          Variable Expression: b: signed int
    3232
    3333        to:
     
    3838
    3939        Cost ( 0, 0, 1 ):         Cast of:
    40           Variable Expression: b: a float
     40          Variable Expression: b: float
    4141
    4242        to:
     
    5757Alternatives are:        Cost ( 0, 0, 1 ):         Cast of:
    5858          Comma Expression:
    59             Variable Expression: a: a signed int
     59            Variable Expression: a: signed int
    6060
    61             Variable Expression: b: a signed int
     61            Variable Expression: b: signed int
    6262
    6363        to:
     
    6969        Cost ( 0, 0, 1 ):         Cast of:
    7070          Comma Expression:
    71             Variable Expression: a: a signed int
     71            Variable Expression: a: signed int
    7272
    73             Variable Expression: b: a float
     73            Variable Expression: b: float
    7474
    7575        to:
  • src/Tests/Expect-e/OccursError.txt

    rbfbf97f ra8541d9  
    11Error: No reasonable alternatives for expression Applying untyped:
    22    Name: f
    3 
    43...to:
    54    Name: g
  • src/Tests/Expect-s/TypeGenerator.txt

    rbfbf97f ra8541d9  
    1 Adding function swap
    21--- Entering scope
    32--- Entering scope
    43--- Leaving scope containing
    54Adding type T
    6 Adding function ?=?
    7 --- Entering scope
    8 --- Leaving scope containing
    9 Adding object left
    10 Adding object right
    11 --- Entering scope
    12 Adding object temp
    13 --- Leaving scope containing
    14 --- Leaving scope containing
    15 T
    16 --- Entering scope
    17 --- Entering scope
    18 --- Leaving scope containing
    19 Adding type T
    20 Adding object 0
    215Adding function ?+?
    22 --- Entering scope
    23 --- Leaving scope containing
    24 Adding function ?++
    25 --- Entering scope
    26 --- Leaving scope containing
    27 Adding function ?+=?
    286--- Entering scope
    297--- Leaving scope containing
    308--- Leaving scope containing
    319T
    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
     10Adding context addable
    6011Adding fwd decl for struct __anonymous0
    6112--- Entering scope
    62 Adding object i
    63 Adding object j
     13Adding object data
     14Adding object next
    6415--- Leaving scope containing
    6516Adding struct __anonymous0
     
    6718--- Entering scope
    6819--- Leaving scope containing
    69 Adding type P1
    70 --- Entering scope
    71 --- Leaving scope containing
    72 Adding type P2
     20Adding type T
    7321--- Entering scope
    7422--- Leaving scope containing
    7523--- Leaving scope containing
    76 P1
    77 P2
    78 Adding type T2
    79 Adding object w1
    80 Adding object g2
     24T
     25Adding type List1
     26Adding object li
     27Adding function f
    8128--- Entering scope
     29Adding object g
    8230--- Leaving scope containing
    83 Adding type w3
    84 Adding object g3
    85 Adding function sum
     31Adding function h
     32--- Entering scope
     33Adding object p
     34--- Leaving scope containing
     35Adding fwd decl for struct S1
    8636--- Entering scope
    8737--- Entering scope
    8838--- Leaving scope containing
    8939Adding type T
    90 Adding function ?=?
     40--- Leaving scope containing
     41T
     42Adding struct S1
     43Adding fwd decl for struct S1
     44--- Entering scope
    9145--- Entering scope
    9246--- Leaving scope containing
    93 Adding object n
    94 Adding object a
     47Adding type T
     48Adding object i
     49--- Leaving scope containing
     50T
     51Adding struct S1
    9552--- Entering scope
    96 Adding object total
     53--- Leaving scope containing
     54Adding object v1
     55--- Entering scope
     56--- Leaving scope containing
     57Adding object p
     58Adding fwd decl for struct S2
     59--- Entering scope
     60--- Entering scope
     61--- Leaving scope containing
     62Adding type T
    9763Adding object i
     64--- Leaving scope containing
     65T
     66Adding struct S2
     67--- Entering scope
     68--- Leaving scope containing
     69Adding object v2
     70Adding fwd decl for struct __anonymous1
     71--- Entering scope
     72--- Entering scope
     73--- Leaving scope containing
     74Adding type T
     75Adding object i
     76--- Leaving scope containing
     77T
     78Adding struct __anonymous1
     79--- Entering scope
     80--- Leaving scope containing
     81Adding object v2
     82Adding fwd decl for struct node
     83--- Entering scope
     84--- Entering scope
     85--- Leaving scope containing
     86Adding type T
     87Adding object data
     88--- Entering scope
     89--- Leaving scope containing
     90Adding object next
     91--- Leaving scope containing
     92T
     93Adding struct node
     94--- Entering scope
     95--- Entering scope
     96--- Leaving scope containing
     97Adding type T
     98--- Entering scope
     99--- Leaving scope containing
     100--- Leaving scope containing
     101T
     102Adding type List
     103Adding object my_list
     104--- Entering scope
     105--- Leaving scope containing
     106Adding type Complex
     107Adding function main
     108--- Entering scope
     109--- Entering scope
    98110--- Entering scope
    99111--- Leaving scope containing
    100112--- Leaving scope containing
    101113--- Leaving scope containing
    102 T
    103 Adding function twice
    104 --- Entering scope
    105 --- Entering scope
    106 --- Leaving scope containing
    107 Adding type T
    108 Adding function ?=?
    109 --- Entering scope
    110 --- Leaving scope containing
    111 Adding object 0
    112 Adding function ?+?
    113 --- Entering scope
    114 --- Leaving scope containing
    115 Adding function ?++
    116 --- Entering scope
    117 --- Leaving scope containing
    118 Adding function ?+=?
    119 --- Entering scope
    120 --- Leaving scope containing
    121 Adding object t
    122 --- Entering scope
    123 --- Leaving scope containing
    124 --- Leaving scope containing
    125 T
    126 Adding function main
    127 --- Entering scope
    128 --- Entering scope
    129 Adding object x
    130 Adding object y
    131 Adding object a
    132 Adding object f
    133 --- Leaving scope containing
    134 --- Leaving scope containing
  • src/main.cc

    rbfbf97f ra8541d9  
    99// Author           : Richard C. Bilson
    1010// Created On       : Fri May 15 23:12:02 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Tue Jun 09 15:10:05 2015
    13 // Update Count     : 68
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Jun 11 11:06:04 2015
     13// Update Count     : 69
    1414//
    1515
     
    7171        errorp = false;
    7272
    73 enum { Ast, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Prototypes, Resolver, Symbol, Parse, };
     73enum { Ast, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Validate, };
    7474
    7575static struct option long_opts[] = {
     
    8080        { "libcfa", no_argument, 0, LibCFA },
    8181        { "nopreamble", no_argument, 0, Nopreamble },
     82        { "parse", no_argument, 0, Parse },
    8283        { "prototypes", no_argument, 0, Prototypes },
    8384        { "resolver", no_argument, 0, Resolver },
    8485        { "symbol", no_argument, 0, Symbol },
    85         { "parse", no_argument, 0, Parse },
     86        { "validate", no_argument, 0, Validate },
    8687        { 0, 0, 0, 0 }
    8788};
     
    9697       
    9798        int c;
    98         while ( (c = getopt_long( argc, argv, "aefglnpqrsxyzD:", long_opts, &long_index )) != -1 ) {
     99        while ( (c = getopt_long( argc, argv, "aefglnpqrsvyzD:", long_opts, &long_index )) != -1 ) {
    99100                switch ( c ) {
    100101                  case Ast:
     
    138139                        symtabp = true;
    139140                        break;
    140                   case 'x':                                                                             // dump AST after decl validation pass
     141                  case 'v':                                                                             // dump AST after decl validation pass
    141142                        validp = true;
    142143                        break;
Note: See TracChangeset for help on using the changeset viewer.