nicolaswinkler 8 yıl önce
ebeveyn
işleme
a774a9b03a
9 değiştirilmiş dosya ile 56 ekleme ve 0 silme
  1. 9 0
      inTest.cpp
  2. BIN
      src/.Parser.cpp.swp
  3. 17 0
      src/.vscode/launch.json
  4. 30 0
      src/Optimizer.h
  5. BIN
      src/Optimizer.o
  6. 0 0
      src/Optimizer.s
  7. BIN
      src/Parser.o
  8. BIN
      src/main.o
  9. BIN
      src/zombie

+ 9 - 0
inTest.cpp

@@ -0,0 +1,9 @@
+#include <iostream>
+
+int main()
+{
+    char c;
+    std::cin >> c;
+    return c;
+}
+

BIN
src/.Parser.cpp.swp


+ 17 - 0
src/.vscode/launch.json

@@ -0,0 +1,17 @@
+{
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "name": "(lldb) Launch",
+            "type": "cppdbg",
+            "request": "launch",
+            "program": "${workspaceRoot}/zombie",
+            "args": [],
+            "stopAtEntry": false,
+            "cwd": "${workspaceRoot}",
+            "environment": [],
+            "externalConsole": true,
+            "MIMode": "lldb"
+        }
+    ]
+}

+ 30 - 0
src/Optimizer.h

@@ -3,6 +3,8 @@
 
 #include "Parser.h"
 
+#include <unordered_map>
+
 namespace zp
 {
     // forward declarations
@@ -16,8 +18,14 @@ namespace zp
     class AstVisitor;
 
     struct BlockInstruction;
+    struct SimpleBlockInstruction;
+    struct LinearLoopInstruction;
+    struct LoopInstruction;
 
     class Optimizer;
+
+    using Index = int;
+    using Cell = unsigned char;
 }
 
 
@@ -37,7 +45,29 @@ public:
 
 struct zp::BlockInstruction
 {
+    virtual ~BlockInstruction(void) = default;
+};
+
+
+struct zp::SimpleBlockInstruction :
+    public BlockInstruction
+{
+    Index pointerMove;
+    std::unordered_map<Index, Cell> added;
+};
 
+
+struct zp::LinearLoopInstruction :
+    public BlockInstruction
+{
+    
+};
+
+
+struct zp::LoopInstruction :
+    public BlockInstruction
+{
+    std::vector<std::unique_ptr<BlockInstruction>> content;
 };
 
 

BIN
src/Optimizer.o


+ 0 - 0
src/Optimizer.s


BIN
src/Parser.o


BIN
src/main.o


BIN
src/zombie