source: icGREP/icgrep-devel/icgrep/pablo/symbol_generator.h @ 5267

Last change on this file since 5267 was 5267, checked in by nmedfort, 3 years ago

Code clean-up. Removed Pablo Call, SetIthBit? and Prototype.

File size: 1.2 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 SYMBOL_GENERATOR_H
8#define SYMBOL_GENERATOR_H
9
10#include <pablo/pabloAST.h>
11#include <unordered_map>
12#include <string>
13
14namespace IDISA { class IDISA_Builder; }
15namespace pablo { class String; }
16namespace pablo { class Integer; }
17
18namespace pablo {
19
20class SymbolGenerator {
21    friend class PabloBlock;
22    using Allocator = PabloAST::Allocator;
23public:
24    typedef int64_t integer_t;
25    String * get(const std::string name, IDISA::IDISA_Builder * builder);
26    String * make(const std::string prefix, IDISA::IDISA_Builder *builder);
27    Integer * getInteger(const integer_t value, IDISA::IDISA_Builder * builder);
28    SymbolGenerator(Allocator & allocator) : mAllocator(allocator) {}
29    ~SymbolGenerator() = default;
30private:
31    Allocator &                                 mAllocator;
32    std::unordered_map<std::string, integer_t>  mPrefixMap;
33    std::unordered_map<std::string, String *>   mStringMap;
34    std::unordered_map<integer_t, Integer *>    mIntegerMap;
35};
36
37}
38
39#endif // SYMBOL_GENERATOR_H
Note: See TracBrowser for help on using the repository browser.