write symbol check
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include <stdexcept>
|
||||
#include <variant>
|
||||
enum class ASTNodeType {
|
||||
// Expression nodes
|
||||
NewArrayExpr,
|
||||
@ -58,4 +59,12 @@ class SemanticError : public std::exception {
|
||||
SemanticError(const std::string &msg, int error_code) : msg(msg), error_code(error_code) {}
|
||||
const char *what() const noexcept override { return msg.c_str(); }
|
||||
int GetErrorCode() const { return error_code; }
|
||||
};
|
||||
};
|
||||
|
||||
using IdentifierType = std::string;
|
||||
struct ArrayType {
|
||||
bool has_base_type;
|
||||
IdentifierType basetype;
|
||||
size_t level;
|
||||
};
|
||||
using ExprTypeInfo = std::variant<IdentifierType, ArrayType>;
|
Reference in New Issue
Block a user