Ignore:
Timestamp:
Feb 18, 2017, 4:13:44 PM (3 years ago)
Author:
nmedfort
Message:

Continued work on parenthesis matching; addition of Pablo ScanTo? and AdvanceThenScanTo/Thru? statements. Bug fix for Pablo Compiler for escaping variables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/pe_scanthru.h

    r5230 r5329  
    3636};
    3737
     38class ScanTo : public Statement {
     39    friend class PabloBlock;
     40public:
     41    static inline bool classof(const PabloAST * e) {
     42        return e->getClassTypeId() == ClassTypeId::ScanTo;
     43    }
     44    static inline bool classof(const void *) {
     45        return false;
     46    }
     47    virtual ~ScanTo() {
     48    }
     49    PabloAST * getScanFrom() const {
     50        return getOperand(0);
     51    }
     52    PabloAST * getScanTo() const {
     53        return getOperand(1);
     54    }
     55protected:
     56    ScanTo(PabloAST * from, PabloAST * to, const String * name, Allocator & allocator)
     57    : Statement(ClassTypeId::ScanTo, from->getType(), {from, to}, name, allocator) {
     58
     59    }
     60};
     61
     62class AdvanceThenScanThru : public Statement {
     63    friend class PabloBlock;
     64public:
     65    static inline bool classof(const PabloAST * e) {
     66        return e->getClassTypeId() == ClassTypeId::AdvanceThenScanThru;
     67    }
     68    static inline bool classof(const void *) {
     69        return false;
     70    }
     71    virtual ~AdvanceThenScanThru() {
     72    }
     73    PabloAST * getScanFrom() const {
     74        return getOperand(0);
     75    }
     76    PabloAST * getScanThru() const {
     77        return getOperand(1);
     78    }
     79protected:
     80    AdvanceThenScanThru(PabloAST * from, PabloAST * thru, const String * name, Allocator & allocator)
     81    : Statement(ClassTypeId::AdvanceThenScanThru, from->getType(), {from, thru}, name, allocator) {
     82
     83    }
     84};
     85
     86class AdvanceThenScanTo : public Statement {
     87    friend class PabloBlock;
     88public:
     89    static inline bool classof(const PabloAST * e) {
     90        return e->getClassTypeId() == ClassTypeId::AdvanceThenScanTo;
     91    }
     92    static inline bool classof(const void *) {
     93        return false;
     94    }
     95    virtual ~AdvanceThenScanTo() {
     96    }
     97    PabloAST * getScanFrom() const {
     98        return getOperand(0);
     99    }
     100    PabloAST * getScanTo() const {
     101        return getOperand(1);
     102    }
     103protected:
     104    AdvanceThenScanTo(PabloAST * from, PabloAST * to, const String * name, Allocator & allocator)
     105    : Statement(ClassTypeId::AdvanceThenScanTo, from->getType(), {from, to}, name, allocator) {
     106
     107    }
     108};
     109
    38110}
    39111
Note: See TracChangeset for help on using the changeset viewer.