source: icGREP/icgrep-devel/icgrep/re/re_any.h

Last change on this file was 6173, checked in by nmedfort, 9 months ago

Added RE_Inspector.

Migrated RE passes to RE_Transformer.

Incorporated Memoizer functionality into RE_Transformer/Inspector.

Removed Memoizer.

Bug fix for unicode_set.

File size: 914 bytes
Line 
1/*
2 *  Copyright (c) 2017 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 ANY_H
8#define ANY_H
9
10#include "re_re.h"
11#include "re_cc.h"
12#include "re_name.h"
13#include <UCD/unicode_set.h>
14#include <llvm/Support/Casting.h>
15
16namespace re {
17
18class Any {
19public:
20    static inline bool classof(const RE * re) {
21        if (llvm::isa<Name>(re)) {
22            re = llvm::cast<Name>(re)->getDefinition();
23            if (re == nullptr) return false;
24        }
25        return llvm::isa<CC>(re) && llvm::cast<CC>(re)->full();
26    }
27    static inline bool classof(const void *) {
28        return false;
29    }
30private:
31    Any() {}
32};
33
34inline RE * makeAny() {
35    Name * dot = makeName(".", Name::Type::UnicodeProperty);
36    dot->setDefinition(makeCC(0, 0x10FFFF));
37    return dot;
38}
39
40}
41
42#endif // ANY_H
Note: See TracBrowser for help on using the repository browser.