Explorar o código

improving structure

Nicolas Winkler %!s(int64=6) %!d(string=hai) anos
pai
achega
ec75529cb9
Modificáronse 4 ficheiros con 8 adicións e 5 borrados
  1. 3 1
      src/Driver.cpp
  2. 1 1
      src/makefile
  3. 3 2
      src/sem/Semantic.cpp
  4. 1 1
      src/sem/Semantic.h

+ 3 - 1
src/Driver.cpp

@@ -169,7 +169,9 @@ int Driver::run(void)
 
 bool Driver::parseStage(void)
 {
-    using std::literals;
+    using namespace std::literals;
+    Logger& logger = Logger::getInstance();
+
     this->ast = std::make_unique<ast::Ast>();
     bool errorOccurred = false;
 

+ 1 - 1
src/makefile

@@ -6,7 +6,7 @@ CXX := clang++
 LLVMCONFIG := llvm-config
 
 INCLUDEDIRS := -I$(shell $(LLVMCONFIG) --includedir) -I.. -Isem/ -Iast/ -I.
-CXXFLAGS := -std=c++17 $(INCLUDEDIRS) -w -ferror-limit=5 # -Wall -Wextra
+CXXFLAGS := -std=c++17 $(INCLUDEDIRS) -w # -Wall -Wextra
 
 ifdef STATIC
 LDFLAGS := $(shell $(LLVMCONFIG) --link-static --ldflags --system-libs --libs all) -static -dead-strip -s

+ 3 - 2
src/sem/Semantic.cpp

@@ -17,10 +17,11 @@ namespace sem
 {
 
 std::unique_ptr<GlobalScope>
-    createFromAst(const std::vector<std::unique_ptr<qlow::ast::AstObject>>& objects)
+    createFromAst(const qlow::ast::Ast& ast)
 {
     
     Logger& logger = Logger::getInstance();
+    auto& objects = ast.getObjects();
 
 #ifdef DEBUGGING
     printf("starting building semantic representation (%d objects)\n", (int) objects.size());
@@ -40,7 +41,7 @@ std::unique_ptr<GlobalScope>
 #ifdef DEBUGGING
     printf("created symbol table entries for all classes\n");
 #endif 
-        
+    
     StructureVisitor av;
     
     // create all methods and fields

+ 1 - 1
src/sem/Semantic.h

@@ -19,7 +19,7 @@ namespace qlow
     namespace sem
     {
         std::unique_ptr<GlobalScope>
-            createFromAst(const std::vector<std::unique_ptr<qlow::ast::AstObject>>& objects);
+            createFromAst(const qlow::ast::Ast& ast);
 
         struct Class;