31 lines
630 B
C++
31 lines
630 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "llir_type.h"
|
|
|
|
namespace antlrSysY {
|
|
class Value {
|
|
public:
|
|
std::string name;
|
|
Type type;
|
|
Value(const std::string &name, const Type &type) : name(name), type(type) {}
|
|
virtual ~Value() = default;
|
|
};
|
|
|
|
class Function : public Value {};
|
|
|
|
class BasicBlock : public Value {};
|
|
|
|
class ConstantInt : public Value {
|
|
public:
|
|
int value;
|
|
int is_bool; // bool 0 or int 1
|
|
ConstantInt(const std::string &name, int value, int is_bool)
|
|
: Value(name, Type::IntegerType), value(value), is_bool(is_bool) {}
|
|
};
|
|
|
|
class ConstantArr : public Value {};
|
|
|
|
} // namespace antlrSysY
|