2019-05-21 16:09:08 +00:00
|
|
|
|
|
|
|
#ifndef PORYGONLANG_BINDER_HPP
|
|
|
|
#define PORYGONLANG_BINDER_HPP
|
2019-05-21 18:59:26 +00:00
|
|
|
#include "../Parser/ParsedStatements/ParsedStatement.hpp"
|
2019-05-21 16:09:08 +00:00
|
|
|
#include "BoundStatements/BoundStatement.hpp"
|
2019-05-22 10:22:52 +00:00
|
|
|
#include "../Script.hpp"
|
2019-05-28 15:49:03 +00:00
|
|
|
#include "BoundVariables/BoundScope.hpp"
|
2019-05-21 16:09:08 +00:00
|
|
|
|
2019-05-21 18:59:26 +00:00
|
|
|
|
2019-05-21 16:09:08 +00:00
|
|
|
class Binder {
|
2019-05-28 15:49:03 +00:00
|
|
|
Script* _scriptData;
|
|
|
|
BoundScope* _scope;
|
2019-06-07 13:23:13 +00:00
|
|
|
shared_ptr<FunctionScriptType> _currentFunction;
|
2019-05-28 15:49:03 +00:00
|
|
|
|
|
|
|
~Binder();
|
2019-05-22 10:22:52 +00:00
|
|
|
|
2019-05-21 18:59:26 +00:00
|
|
|
BoundStatement *BindStatement(ParsedStatement *statement);
|
|
|
|
BoundStatement *BindBlockStatement(ParsedStatement *statement);
|
2019-05-21 20:15:51 +00:00
|
|
|
BoundStatement *BindExpressionStatement(ParsedStatement *statement);
|
2019-05-28 15:49:03 +00:00
|
|
|
BoundStatement *BindAssignmentStatement(ParsedStatement *statement);
|
2019-06-01 10:33:52 +00:00
|
|
|
BoundStatement *BindFunctionDeclarationStatement(ParsedStatement * statement);
|
2019-06-07 13:23:13 +00:00
|
|
|
BoundStatement *BindReturnStatement(ParsedStatement *statement);
|
2019-06-08 12:25:15 +00:00
|
|
|
BoundStatement *BindConditionalStatement(ParsedStatement *statement);
|
2019-05-21 18:59:26 +00:00
|
|
|
|
|
|
|
BoundExpression *BindExpression(ParsedExpression *expression);
|
2019-05-30 13:23:48 +00:00
|
|
|
BoundExpression *BindVariableExpression(VariableExpression *expression);
|
2019-05-21 20:15:51 +00:00
|
|
|
BoundExpression *BindBinaryOperator(BinaryExpression *expression);
|
2019-05-22 10:22:52 +00:00
|
|
|
BoundExpression *BindUnaryOperator(UnaryExpression *expression);
|
2019-06-01 17:20:31 +00:00
|
|
|
BoundExpression *BindFunctionCall(FunctionCallExpression *expression);
|
2019-06-06 15:35:51 +00:00
|
|
|
BoundExpression *BindIndexExpression(IndexExpression *expression);
|
2019-05-21 20:15:51 +00:00
|
|
|
public:
|
2019-05-28 15:49:03 +00:00
|
|
|
static BoundScriptStatement* Bind(Script* script, ParsedScriptStatement* s, BoundScope* scriptScope);
|
2019-05-21 18:59:26 +00:00
|
|
|
|
2019-05-21 16:09:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //PORYGONLANG_BINDER_HPP
|