Some work on Expressions
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef ASTVISITOR_H
|
||||
#define ASTVISITOR_H
|
||||
|
||||
#include "ConstantExpression.h"
|
||||
#include "VariableDefinition.h"
|
||||
#include "ParameterList.h"
|
||||
|
||||
@@ -9,6 +10,7 @@ public:
|
||||
ASTVisitor();
|
||||
virtual ~ASTVisitor();
|
||||
|
||||
virtual void visit(ConstantExpression* e) = 0;
|
||||
virtual void visit(ParameterList* e) = 0;
|
||||
virtual void visit(VariableDefinition* e) = 0;
|
||||
};
|
||||
|
||||
19
inc/AST/ConstantExpression.h
Normal file
19
inc/AST/ConstantExpression.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef CONSTANTEXPRESSION_H
|
||||
#define CONSTANTEXPRESSION_H
|
||||
|
||||
#include "AST/Expression.h"
|
||||
#include <string>
|
||||
|
||||
class ConstantExpression : public Expression {
|
||||
public:
|
||||
ConstantExpression(std::string value);
|
||||
virtual ~ConstantExpression();
|
||||
|
||||
virtual void accept(ASTVisitor* visitor);
|
||||
|
||||
std::string getValue();
|
||||
private:
|
||||
std::string value_;
|
||||
};
|
||||
|
||||
#endif // CONSTANTEXPRESSION_H
|
||||
14
inc/AST/Expression.h
Normal file
14
inc/AST/Expression.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef EXPRESSION_H
|
||||
#define EXPRESSION_H
|
||||
|
||||
#include "AST/ASTElement.h"
|
||||
|
||||
class Expression : public ASTElement {
|
||||
public:
|
||||
Expression();
|
||||
virtual ~Expression();
|
||||
|
||||
virtual void accept(ASTVisitor* visitor) = 0;
|
||||
};
|
||||
|
||||
#endif // EXPRESSION_H
|
||||
Reference in New Issue
Block a user