source: icGREP/icgrep-devel/icgrep/pablo/pe_lookahead.h @ 5646

Last change on this file since 5646 was 5646, checked in by nmedfort, 21 months ago

Minor clean up. Bug fix for object cache when the same cached kernel is used twice in a single run. Improvement to RE Minimizer.

File size: 1.1 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_LOOKAHEAD_H
8#define PE_LOOKAHEAD_H
9
10#include <pablo/pabloAST.h>
11#include <pablo/pe_integer.h>
12
13namespace pablo {
14
15class Lookahead final : public Statement {
16    friend class PabloBlock;
17public:
18    static inline bool classof(const PabloAST * e) {
19        return e->getClassTypeId() == ClassTypeId::Lookahead;
20    }
21    static inline bool classof(const void *) {
22        return false;
23    }
24    virtual ~Lookahead() {
25    }
26    inline PabloAST * getExpression() const {
27        return getOperand(0);
28    }
29    inline int64_t getAmount() const {
30        return llvm::cast<Integer>(getOperand(1))->value();
31    }
32protected:
33    Lookahead(PabloAST * expr, PabloAST * shiftAmount, const String * name, Allocator & allocator)
34    : Statement(ClassTypeId::Lookahead, expr->getType(), {expr, shiftAmount}, name, allocator) {
35        assert(llvm::isa<Integer>(shiftAmount));
36    }
37};
38
39}
40
41#endif // PE_LOOKAHEAD_H
42
43
44
Note: See TracBrowser for help on using the repository browser.