Initial layout for binder

This commit is contained in:
2019-05-21 18:09:08 +02:00
parent 2df4a71ed8
commit 1e5cd010a1
7 changed files with 89 additions and 9 deletions

View File

@@ -0,0 +1,16 @@
#ifndef PORYGONLANG_PARSEDSCRIPTSTATEMENT_HPP
#define PORYGONLANG_PARSEDSCRIPTSTATEMENT_HPP
#include "ParsedStatement.hpp"
class ParsedScriptStatement : public ParsedBlockStatement{
public:
explicit ParsedScriptStatement(vector<ParsedStatement*> statements) : ParsedBlockStatement(move(statements)){}
ParsedStatementKind GetKind() final{
return ParsedStatementKind ::Script;
}
};
#endif //PORYGONLANG_PARSEDSCRIPTSTATEMENT_HPP

View File

@@ -1,5 +1,7 @@
#include <utility>
#include <utility>
#ifndef PORYGONLANG_PARSEDSTATEMENT_HPP
#define PORYGONLANG_PARSEDSTATEMENT_HPP
@@ -49,15 +51,6 @@ public:
}
};
class ParsedScriptStatement : public ParsedBlockStatement{
public:
explicit ParsedScriptStatement(std::vector<ParsedStatement*> statements) : ParsedBlockStatement(statements){}
ParsedStatementKind GetKind() final{
return ParsedStatementKind ::Script;
}
};
class ParsedExpressionStatement : public ParsedStatement{
ParsedExpression* _expression;
public:

View File

@@ -2,6 +2,7 @@
#include "Parser.hpp"
#include "UnaryOperatorKind.hpp"
#include "BinaryOperatorKind.hpp"
#include "ParsedScriptStatement.hpp"
ParsedScriptStatement* Parser::Parse() {

View File

@@ -6,6 +6,7 @@
#include "ParsedStatements/ParsedStatement.hpp"
#include "../Script.hpp"
#include "ParsedScriptStatement.hpp"
enum class OperatorPrecedence {
No,