aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/cps/AST.h15
-rw-r--r--include/cps/Lexer.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/include/cps/AST.h b/include/cps/AST.h
index f20b106..8c8c3be 100644
--- a/include/cps/AST.h
+++ b/include/cps/AST.h
@@ -100,6 +100,21 @@ public:
virtual ~StmtAST() = default;
};
+class IncludeStmtAST : public StmtAST {
+ std::string Path;
+public:
+ explicit IncludeStmtAST(std::string Path) : Path(std::move(Path)) {}
+ const std::string &getPath() const { return Path; }
+};
+
+class GlobalBlockAST : public StmtAST {
+ std::vector<std::unique_ptr<StmtAST>> Body;
+public:
+ explicit GlobalBlockAST(std::vector<std::unique_ptr<StmtAST>> Body)
+ : Body(std::move(Body)) {}
+ const auto &getBody() const { return Body; }
+};
+
class TryStmtAST : public StmtAST {
std::vector<std::unique_ptr<StmtAST>> Body, CatchBody;
public:
diff --git a/include/cps/Lexer.h b/include/cps/Lexer.h
index b465591..957ca48 100644
--- a/include/cps/Lexer.h
+++ b/include/cps/Lexer.h
@@ -101,6 +101,8 @@ enum Token {
tok_c_double = -612,
tok_new = -613, tok_delete = -614,
+ tok_include = -650, tok_global = -651, tok_endglobal = -652,
+
tok_try = -700,
tok_catch = -701,
tok_endtry = -702,