source: icGREP/icgrep-devel/icgrep/pablo/ps_if.h @ 4543

Last change on this file since 4543 was 4541, checked in by cameron, 5 years ago

New carry data system -- first stage

File size: 1.3 KB
RevLine 
[3850]1/*
2 *  Copyright (c) 2014 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#ifndef PS_IF_H
8#define PS_IF_H
9
[4244]10#include <pablo/pabloAST.h>
[4345]11#include <vector>
[3850]12
[4199]13namespace pablo {
14
[4404]15class Assign;
16
[4276]17class If : public Statement {
[4227]18    friend class PabloBlock;
[3850]19public:
[4510]20    using DefinedVars = std::vector<PabloAST *, VectorAllocator>;
[4404]21
[4244]22    static inline bool classof(const PabloAST * e) {
[4200]23        return e->getClassTypeId() == ClassTypeId::If;
[4199]24    }
[4200]25    static inline bool classof(const void *) {
26        return false;
27    }
[4199]28    virtual ~If() {
[4432]29        mDefined.clear();
[4199]30    }
[4244]31    inline PabloAST * getCondition() const {
[4432]32        return getOperand(0);
[4199]33    }
[4404]34    inline PabloBlock & getBody() {
[4276]35        return mBody;
36    }
[4404]37    inline const PabloBlock & getBody() const {
[4253]38        return mBody;
[4199]39    }
[4419]40    inline const DefinedVars & getDefined() const {
[4344]41        return mDefined;
42    }
[4200]43protected:
[4524]44    If(PabloAST * expr, const std::initializer_list<Assign *> definedVars, PabloBlock & body, PabloBlock * parent);
[4511]45
46    If(PabloAST * expr, const std::vector<Assign *> & definedVars, PabloBlock & body, PabloBlock * parent);
[3850]47private:
[4419]48    PabloBlock &    mBody;
49    DefinedVars     mDefined;
[3850]50};
51
[4199]52}
53
[3850]54#endif // PS_IF_H
55
56
Note: See TracBrowser for help on using the repository browser.