29 lines
640 B
C++
29 lines
640 B
C++
#pragma once
|
|
|
|
#include "AST/Base.h"
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
namespace plsm {
|
|
namespace ast {
|
|
|
|
class VarDecl : public Stmt {
|
|
public:
|
|
const std::string name;
|
|
const std::shared_ptr<TypeName> typeName;
|
|
|
|
std::shared_ptr<Symbol> symbol;
|
|
|
|
VarDecl(LOC_ARG, const std::string &name, TypeName *typeName)
|
|
: Stmt(sourceRange), name(name), typeName(typeName) {}
|
|
|
|
virtual boost::json::value toJson() override;
|
|
static VarDecl *fromJson(boost::json::value json);
|
|
|
|
virtual std::any accept(ASTVisitor *visitor, std::any param) override {
|
|
return visitor->visit(*this, param);
|
|
}
|
|
};
|
|
} // namespace ast
|
|
} // namespace plsm
|