summaryrefslogtreecommitdiff
path: root/Driver.hh
diff options
context:
space:
mode:
authorNagi5Yeq <wu@x-nagi.com>2020-05-12 01:52:49 +0800
committerNagi5Yeq <wu@x-nagi.com>2020-05-12 01:52:49 +0800
commitf146dac784325c9403499046f52f70e3596ae345 (patch)
tree4af8b76cbf83892d3cbfdda7a4b17fa8af34b4a0 /Driver.hh
initial commit
Diffstat (limited to 'Driver.hh')
-rw-r--r--Driver.hh28
1 files changed, 28 insertions, 0 deletions
diff --git a/Driver.hh b/Driver.hh
new file mode 100644
index 0000000..5fc5d83
--- /dev/null
+++ b/Driver.hh
@@ -0,0 +1,28 @@
+#ifndef PCC_DRIVER_H
+#define PCC_DRIVER_H
+
+#include <cstdio>
+
+#include "Context.hh"
+#include "Parser.hh"
+
+#define YY_DECL pcc::Parser::symbol_type yylex(pcc::Driver& driver)
+
+YY_DECL;
+
+namespace pcc {
+class Driver {
+ public:
+ Driver(Context* context);
+ ~Driver();
+ int StartLexer(const std::string& filename);
+ void StopLexer();
+ void Parse(const std::string& filename);
+ llvm::Module* GetModule();
+ llvm::IRBuilder<>* GetBuilder();
+
+ Context* context_;
+};
+} // namespace pcc
+
+#endif