-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
314 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
|
||
#include "StatementNode.hpp" | ||
|
||
namespace ast | ||
{ | ||
class BreakNode final : public StatementNode | ||
{ | ||
public: | ||
using ptr = std::shared_ptr<BreakNode>; | ||
static ptr create(); | ||
BreakNode() = default; | ||
~BreakNode() final = default; | ||
|
||
void accept(IVisitor &visitor) final; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
|
||
#include "StatementNode.hpp" | ||
|
||
namespace ast | ||
{ | ||
class ContinueNode final : public StatementNode | ||
{ | ||
public: | ||
using ptr = std::shared_ptr<ContinueNode>; | ||
static ptr create(); | ||
ContinueNode() = default; | ||
~ContinueNode() final = default; | ||
|
||
void accept(IVisitor &visitor) final; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#pragma once | ||
|
||
#include "Jump.hpp" | ||
|
||
namespace runtime | ||
{ | ||
class Break : public Jump | ||
{ | ||
public: | ||
Break(); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#pragma once | ||
|
||
#include "Jump.hpp" | ||
|
||
namespace runtime | ||
{ | ||
class Continue : public Jump | ||
{ | ||
public: | ||
Continue(); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
#include <exception> | ||
#include <string> | ||
|
||
namespace runtime | ||
{ | ||
class Jump : public std::exception | ||
{ | ||
public: | ||
Jump(const std::string &jumpStatement, const std::string &appropriatePlace) noexcept; | ||
|
||
[[nodiscard]] const char *what() const noexcept override; | ||
|
||
private: | ||
std::string _what; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "BreakNode.hpp" | ||
|
||
ast::BreakNode::ptr ast::BreakNode::create() | ||
{ | ||
return std::make_shared<BreakNode>(); | ||
} | ||
|
||
void ast::BreakNode::accept(ast::IVisitor &visitor) | ||
{ | ||
visitor.visit(*this); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "ContinueNode.hpp" | ||
|
||
ast::ContinueNode::ptr ast::ContinueNode::create() | ||
{ | ||
return std::make_shared<ContinueNode>(); | ||
} | ||
|
||
void ast::ContinueNode::accept(ast::IVisitor &visitor) | ||
{ | ||
visitor.visit(*this); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "Break.hpp" | ||
|
||
runtime::Break::Break() | ||
: Jump("break", "loop") | ||
{} |
Oops, something went wrong.