Ignore:
Timestamp:
Feb 1, 2022, 8:22:12 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
fde0a58
Parents:
729c991
Message:

change class name WhileStmt? to WhileDoStmt?, add else clause to WhileDoStmt? and ForStmt?, change names thenPart/ElsePart to then/else_

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r729c991 r3b0bc16  
    99// Author           : Thierry Delisle
    1010// Created On       : Thu May 09 15::37::05 2019
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Jul 14 16:15:00 2021
    13 // Update Count     : 37
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Tue Feb  1 16:27:15 2022
     13// Update Count     : 39
    1414//
    1515
     
    393393                auto stmt = new IfStmt(
    394394                        get<Expression>().accept1( node->cond ),
    395                         get<Statement>().accept1( node->thenPart ),
    396                         get<Statement>().accept1( node->elsePart ),
     395                        get<Statement>().accept1( node->then ),
     396                        get<Statement>().accept1( node->else_ ),
    397397                        get<Statement>().acceptL( node->inits )
    398398                );
     
    419419        }
    420420
    421         const ast::Stmt * visit( const ast::WhileStmt * node ) override final {
     421        const ast::Stmt * visit( const ast::WhileDoStmt * node ) override final {
    422422                if ( inCache( node ) ) return nullptr;
    423423                auto inits = get<Statement>().acceptL( node->inits );
    424                 auto stmt = new WhileStmt(
     424                auto stmt = new WhileDoStmt(
    425425                        get<Expression>().accept1( node->cond ),
    426426                        get<Statement>().accept1( node->body ),
     
    18721872                        old->location,
    18731873                        GET_ACCEPT_1(condition, Expr),
    1874                         GET_ACCEPT_1(thenPart, Stmt),
    1875                         GET_ACCEPT_1(elsePart, Stmt),
     1874                        GET_ACCEPT_1(then, Stmt),
     1875                        GET_ACCEPT_1(else_, Stmt),
    18761876                        GET_ACCEPT_V(initialization, Stmt),
    18771877                        GET_LABELS_V(old->labels)
     
    19021902        }
    19031903
    1904         virtual void visit( const WhileStmt * old ) override final {
     1904        virtual void visit( const WhileDoStmt * old ) override final {
    19051905                if ( inCache( old ) ) return;
    1906                 this->node = new ast::WhileStmt(
     1906                this->node = new ast::WhileDoStmt(
    19071907                        old->location,
    19081908                        GET_ACCEPT_1(condition, Expr),
Note: See TracChangeset for help on using the changeset viewer.