source: icGREP/icgrep-devel/icgrep/pablo/pe_advance.h @ 4568

Last change on this file since 4568 was 4540, checked in by cameron, 4 years ago

Carry data stored with PabloBlock?, Advance, ScanThru?, MatchStar?

File size: 1.3 KB
Line 
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 PE_ADVANCE_H
8#define PE_ADVANCE_H
9
10#include "pabloAST.h"
11#include <pablo/symbol_generator.h>
12#include <pablo/pe_integer.h>
13
14namespace pablo {
15
16class Advance : public Statement {
17    friend class PabloBlock;
18public:
19    static inline bool classof(const PabloAST * e) {
20        return e->getClassTypeId() == ClassTypeId::Advance;
21    }
22    static inline bool classof(const void *) {
23        return false;
24    }
25    virtual ~Advance() {
26    }
27    inline PabloAST * getExpr() const {
28        return getOperand(0);
29    }
30    inline Integer::integer_t getAdvanceAmount() const {
31        return cast<Integer>(getOperand(1))->value();
32    }
33    inline void setLocalAdvanceIndex(const unsigned idx) {
34        localAdvanceIndex = idx;
35    }
36    inline unsigned getLocalAdvanceIndex() const {
37        return localAdvanceIndex;
38    }
39protected:
40    Advance(PabloAST * expr, PabloAST * shiftAmount, String * name, PabloBlock * parent)
41    : Statement(ClassTypeId::Advance, {expr, shiftAmount}, name, parent)
42    {
43        assert(isa<Integer>(shiftAmount));
44    }
45private:
46    unsigned localAdvanceIndex;
47};
48   
49}
50
51#endif // PE_ADVANCE_H
52
53
54
Note: See TracBrowser for help on using the repository browser.