Add ParameterList
This commit is contained in:
@@ -2,12 +2,14 @@
|
||||
#define ASTVISITOR_H
|
||||
|
||||
#include "VariableDefinition.h"
|
||||
#include "ParameterList.h"
|
||||
|
||||
class ASTVisitor {
|
||||
public:
|
||||
ASTVisitor();
|
||||
virtual ~ASTVisitor();
|
||||
|
||||
virtual void visit(ParameterList* e) = 0;
|
||||
virtual void visit(VariableDefinition* e) = 0;
|
||||
};
|
||||
|
||||
|
||||
23
inc/AST/ParameterList.h
Normal file
23
inc/AST/ParameterList.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef PARAMETERLIST_H
|
||||
#define PARAMETERLIST_H
|
||||
|
||||
#include "AST/ASTElement.h"
|
||||
#include "AST/Type.h"
|
||||
#include <vector>
|
||||
|
||||
typedef std::pair<Type*, std::string> Parameter;
|
||||
|
||||
class ParameterList : public ASTElement {
|
||||
public:
|
||||
ParameterList();
|
||||
virtual ~ParameterList();
|
||||
|
||||
virtual void accept(ASTVisitor* visitor);
|
||||
|
||||
void addParameter(Type* type, std::string name);
|
||||
std::vector<Parameter> getParameters();
|
||||
private:
|
||||
std::vector<Parameter> params_;
|
||||
};
|
||||
|
||||
#endif // PARAMETERLIST_H
|
||||
Reference in New Issue
Block a user