@@ -1,3 +1,7 @@
+// LLVM includes
+#include "llvm/IR/Verifier.h"
+
+// Local includes
#include "Ast.h"
#include "Parser.h"
@@ -1,16 +1,11 @@
#ifndef _AST_H
#define _AST_H
+//LLVM includes
#include "llvm/ADT/STLExtras.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
-#include "llvm/IR/Verifier.h"
-#include <cctype>
-#include <cstdio>
-#include <map>
-#include <string>
-#include <vector>
using namespace llvm;
@@ -1,3 +1,8 @@
+// Standard includes
+#include <cctype>
+#include <cstdio>
#include "Lexer.h"
/// gettok - Return the next token from standard input.
@@ -1,12 +1,8 @@
#ifndef _LEXER_H
#define _LEXER_H
#include <string>
-#include "Ast.h"
namespace lexer{
// The lexer returns tokens [0-255] if it is an unknown character, otherwise one
@@ -1,23 +1,12 @@
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/IR/IRBuilder.h"
-#include "llvm/IR/LLVMContext.h"
-#include "llvm/IR/Module.h"
#include <cstdio>
-#include "Lexer.h"
-using namespace llvm;
-using namespace ast;
-using namespace lexer;
using namespace parser;
-
namespace helper {
// Cloning make_unique here until it's standard in C++14.
// Using a namespace to avoid conflicting with MSVC's std::make_unique (which
@@ -1,4 +1,10 @@
+#include <stdexcept>
+#include "Lexer.h"
using namespace lexer;
namespace parser{
@@ -1,11 +1,10 @@
#ifndef _PARSER_H
#define _PARSER_H
#include <map>
using namespace ast;