Changeset a08ba92 for translator/Parser


Ignore:
Timestamp:
May 19, 2015, 4:58:14 PM (11 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
843054c2
Parents:
01aeade
Message:

licencing: sixth groups of files

Location:
translator/Parser
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • translator/Parser/ExpressionNode.cc

    r01aeade ra08ba92  
    8181}
    8282
    83 CommaExprNode *ExpressionNode::add_to_list( ExpressionNode *exp ){
     83CommaExprNode *ExpressionNode::add_to_list( ExpressionNode *exp ) {
    8484        return new CommaExprNode( this, exp );
    8585}
     
    111111}
    112112
    113 void ConstantNode::classify( std::string &str ){
    114         switch ( type ){
     113void ConstantNode::classify( std::string &str ) {
     114        switch ( type ) {
    115115          case Integer:
    116116          case Float:
     
    130130                        std::transform( sfx.begin(), sfx.end(), sfx.begin(), tolower_hack );
    131131
    132                         if ( sfx.find("ll") != string::npos ){
     132                        if ( sfx.find("ll") != string::npos ) {
    133133                                longs = 2;
    134                         } else if ( sfx.find("l") != string::npos ){
     134                        } else if ( sfx.find("l") != string::npos ) {
    135135                                longs = 1;
    136136                        } // if
     
    163163ConstantNode *ConstantNode::append( std::string *newValue ) {
    164164        if ( newValue ) {
    165                 if ( type == String ){
     165                if ( type == String ) {
    166166                        std::string temp = *newValue;
    167167                        value.resize( value.size() - 1 );
     
    209209        BasicType *bt;
    210210
    211         switch ( get_type()){
     211        switch ( get_type()) {
    212212          case Integer:
    213213                /* Cfr. standard 6.4.4.1 */
     
    354354                return new UntypedExpr( function->build(), args, maybeBuild< Expression >( get_argName() ));
    355355        } else {
    356                 switch ( op->get_type()){
     356                switch ( op->get_type()) {
    357357                  case OperatorNode::Incr:
    358358                  case OperatorNode::Decr:
     
    563563}
    564564
    565 void CompositeExprNode::set_function( ExpressionNode *f ){
     565void CompositeExprNode::set_function( ExpressionNode *f ) {
    566566        function = f;
    567567}
    568568
    569 void CompositeExprNode::set_args( ExpressionNode *args ){
     569void CompositeExprNode::set_args( ExpressionNode *args ) {
    570570        arguments = args;
    571571}
     
    579579}
    580580
    581 void CompositeExprNode::add_arg( ExpressionNode *arg ){
     581void CompositeExprNode::add_arg( ExpressionNode *arg ) {
    582582        if ( arguments )
    583583                arguments->set_link( arg );
     
    594594}
    595595
    596 CommaExprNode *CommaExprNode::add_to_list( ExpressionNode *exp ){
     596CommaExprNode *CommaExprNode::add_to_list( ExpressionNode *exp ) {
    597597        add_arg( exp );
    598598
     
    646646}
    647647
    648 ForCtlExprNode::~ForCtlExprNode(){
     648ForCtlExprNode::~ForCtlExprNode() {
    649649        delete init;
    650650        delete condition;
  • translator/Parser/ParseNode.cc

    r01aeade ra08ba92  
    1010// Created On       : Sat May 16 13:26:29 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat May 16 13:27:51 2015
    13 // Update Count     : 2
     12// Last Modified On : Tue May 19 16:48:30 2015
     13// Update Count     : 3
    1414//
    1515
     
    2424
    2525ParseNode *ParseNode::set_name( string _name ) {
    26     name = _name;
    27     return this;
     26        name = _name;
     27        return this;
    2828}
    2929
    3030ParseNode *ParseNode::set_name( string *_name ) {
    31     name = *_name; // deep copy
    32     delete _name;
     31        name = *_name; // deep copy
     32        delete _name;
    3333
    34     return this;
     34        return this;
    3535}
    3636
    3737ParseNode::~ParseNode( void ) {
    38     delete next;
     38        delete next;
    3939};
    4040
    4141string ParseNode::get_name( void ) {
    42     return name;
     42        return name;
    4343}
    4444
    4545ParseNode *ParseNode::get_link( void ) const {
    46     return next;
     46        return next;
    4747}
    4848
    4949ParseNode *ParseNode::get_last(void) {
    50     ParseNode *current = this;
     50        ParseNode *current = this;
    5151
    52     while ( current->get_link() != 0 )
     52        while ( current->get_link() != 0 )
    5353        current = current->get_link();
    5454
    55     return current;
     55        return current;
    5656}
    5757
    58 ParseNode *ParseNode::set_link(ParseNode *_next){
    59     ParseNode *follow;
     58ParseNode *ParseNode::set_link(ParseNode *_next) {
     59        ParseNode *follow;
    6060
    61     if ( _next == 0 ) return this;
     61        if ( _next == 0 ) return this;
    6262
    63     for ( follow = this; follow->next != 0; follow = follow->next );
    64     follow->next = _next;
     63        for ( follow = this; follow->next != 0; follow = follow->next );
     64        follow->next = _next;
    6565
    66     return this;
     66        return this;
    6767}
    6868
    6969const string ParseNode::get_name(void) const {
    70     return name;
     70        return name;
    7171}
    7272
     
    7575
    7676void ParseNode::printList( std::ostream &os, int indent ) const {
    77     print( os, indent );
     77        print( os, indent );
    7878
    79     if ( next ) {
     79        if ( next ) {
    8080        next->printList( os, indent );
    81     }
     81        }
    8282}
    8383
    8484ParseNode &ParseNode::operator,( ParseNode &p ) {
    85     set_link( &p );
     85        set_link( &p );
    8686
    87     return *this;
     87        return *this;
    8888}
    8989
    9090ParseNode *mkList( ParseNode &pn ) {
    91     // it just relies on `operator,' to take care of the "arguments" and provides a nice interface to an awful-looking
    92     // address-of, rendering, for example (StatementNode *)(&(*$5 + *$7)) into (StatementNode *)mkList(($5, $7))
    93     // (although "nice" is probably not the word)
    94     return &pn;
     91        // it just relies on `operator,' to take care of the "arguments" and provides a nice interface to an awful-looking
     92        // address-of, rendering, for example (StatementNode *)(&(*$5 + *$7)) into (StatementNode *)mkList(($5, $7))
     93        // (although "nice" is probably not the word)
     94        return &pn;
    9595}
    9696
  • translator/Parser/StatementNode.cc

    r01aeade ra08ba92  
    171171void StatementNode::print( std::ostream &os, int indent ) const {
    172172        if ( labels != 0 )
    173                 if (! labels->empty()) {
     173                if ( ! labels->empty()) {
    174174                        std::list<std::string>::const_iterator i;
    175175
  • translator/Parser/TypedefTable.cc

    r01aeade ra08ba92  
    123123        for ( tableType::iterator i = table.begin(); i != table.end(); ) {
    124124                list<Entry> &declList = (*i ).second;
    125                 while (! declList.empty() && declList.front().scope == currentScope ) {
     125                while ( ! declList.empty() && declList.front().scope == currentScope ) {
    126126                        declList.pop_front();
    127127                }
  • translator/Parser/lex.l

    r01aeade ra08ba92  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Sat May 16 12:14:18 2015
    13  * Update Count     : 330
     12 * Last Modified On : Tue May 19 15:41:54 2015
     13 * Update Count     : 331
    1414 */
    1515
Note: See TracChangeset for help on using the changeset viewer.