Skip to content
Snippets Groups Projects
Select Git revision
  • caml
  • master default protected
  • caml2
  • input_conditionals
  • cache
5 results

dumpcft.cpp

Blame
  • CFTree.cpp 30.96 KiB
    /* ----------------------------------------------------------------------------
       Copyright (C) 2020, Université de Lille, Lille, FRANCE
    
       This file is part of WSymb.
    
       WSymb is free software; you can redistribute it and/or
       modify it under the terms of the GNU Lesser General Public License
       as published by the Free Software Foundation ; either version 2 of
       the License, or (at your option) any later version.
    
       WSymb is distributed in the hope that it will be useful, but
       WITHOUT ANY WARRANTY ; without even the implied warranty of
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
       Lesser General Public License for more details.
    
       You should have received a copy of the GNU Lesser General Public
       License along with this program ; if not, write to the Free Software
       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
       USA
       ---------------------------------------------------------------------------- */
    
    #include "include/CFTree.h"
    #include "include/PWCET.h"
    #include <otawa/ipet.h>
    #include <otawa/flowfact/features.h>
    
    namespace otawa { 
    
    namespace cftree {
    // definition propriete cftree
    
    //--------------------
    //	CLASS CFTREELEAF
    //--------------------
    
    CFTreeLeaf* CFTreeLeaf::toLeaf() {
    	return (CFTreeLeaf*) this;
    }
    CFTreeAlt* CFTreeLeaf::toAlt() {return NULL;}/* abstract */
    CFTreeLoop* CFTreeLeaf::toLoop() {return NULL;}/* abstract */
    CFTreeSeq* CFTreeLeaf::toSeq() {return NULL;}/* abstract */
    
    CFTreeLeaf::CFTreeLeaf(Block *b) {
    	block = b;
    }
    
    Block* CFTreeLeaf::getBlock() { return block; }
    int CFTreeLeaf::getBlockId() const { return block->id(); }
    
    //--------------------
    //	CLASS CFTREEALT
    //--------------------
    CFTreeAlt::CFTreeAlt(std::vector<CFTree*> new_alts) {
    	alts = new_alts;
    }
    
    CFTreeAlt* CFTreeAlt::toAlt() {
    	return (CFTreeAlt*) this;
    }
    CFTreeLeaf* CFTreeAlt::toLeaf() {return NULL;}/* abstract */
    CFTreeLoop* CFTreeAlt::toLoop() {return NULL;}/* abstract */
    CFTreeSeq* CFTreeAlt::toSeq() {return NULL;}/* abstract */
    
    void CFTreeAlt::addAlt(CFTree *s) {
    	alts.push_back(s);
    }
    
    std::vector<CFTree *>::const_iterator CFTreeAlt::childIter() {
    	return alts.begin();
    }