More stuff! Tons of stuff!
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#ifndef ASTELEMENT_H
|
||||
#define ASTELEMENT_H
|
||||
|
||||
#include "AST/ASTVisitor.h"
|
||||
class ASTVisitor;
|
||||
|
||||
class ASTElement {
|
||||
public:
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
#ifndef ASTVISITOR_H
|
||||
#define ASTVISITOR_H
|
||||
|
||||
#include "VariableDefinition.h"
|
||||
|
||||
class ASTVisitor {
|
||||
public:
|
||||
ASTVisitor();
|
||||
virtual ~ASTVisitor();
|
||||
|
||||
virtual void visit(VariableDefinition* e) = 0;
|
||||
};
|
||||
|
||||
#endif // ASTVISITOR_H
|
||||
|
||||
14
inc/AST/Statement.h
Normal file
14
inc/AST/Statement.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef STATEMENT_H
|
||||
#define STATEMENT_H
|
||||
|
||||
#include "AST/ASTElement.h"
|
||||
|
||||
class Statement : public ASTElement {
|
||||
public:
|
||||
Statement();
|
||||
virtual ~Statement();
|
||||
|
||||
virtual void accept(ASTVisitor* visitor) = 0;
|
||||
};
|
||||
|
||||
#endif // STATEMENT_H
|
||||
16
inc/AST/Type.h
Normal file
16
inc/AST/Type.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef TYPE_H
|
||||
#define TYPE_H
|
||||
|
||||
#include <string>
|
||||
|
||||
class Type {
|
||||
public:
|
||||
Type(std::string name);
|
||||
~Type();
|
||||
|
||||
std::string getName();
|
||||
private:
|
||||
std::string name_;
|
||||
};
|
||||
|
||||
#endif // TYPE_H
|
||||
25
inc/AST/VariableDefinition.h
Normal file
25
inc/AST/VariableDefinition.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef VARIABLEDEFINITION_H
|
||||
#define VARIABLEDEFINITION_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "AST/Statement.h"
|
||||
|
||||
class VariableDefinition : public Statement
|
||||
{
|
||||
public:
|
||||
VariableDefinition(int type, std::string name);
|
||||
virtual ~VariableDefinition();
|
||||
|
||||
virtual void accept(ASTVisitor* visitor);
|
||||
|
||||
// Type* getType();
|
||||
int getType();
|
||||
std::string getName();
|
||||
private:
|
||||
// Type* type_
|
||||
int type_;
|
||||
std::string name_;
|
||||
};
|
||||
|
||||
#endif // VARIABLEDEFINITION_H
|
||||
Reference in New Issue
Block a user