]> git.mdlowis.com Git - archive/dlang.git/commitdiff
Renamed macro class to Syntax
authorMichael D. Lowis <mike@mdlowis.com>
Wed, 30 May 2012 04:55:25 +0000 (00:55 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Wed, 30 May 2012 04:55:25 +0000 (00:55 -0400)
Makefile
source/dlparser/dlparser.h
source/dlparser/macro/macro.cpp [deleted file]
source/dlparser/syntax/syntax.cpp [new file with mode: 0644]
source/dlparser/syntax/syntax.h [moved from source/dlparser/macro/macro.h with 84% similarity]
source/main.cpp
source/visitors/expprocessor.cpp
source/visitors/expprocessor.h

index f0b1e0c329bd7efb89d1dc955b4f4077c1b362ac..1bb68dcfd41a243226cb40dc0a9deb898a69e83f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -63,7 +63,7 @@ all: release test
 release: $(PROJ_NAME)
 
 test: $(TEST_RUNNER)
-       $(TEST_RUNNER)
+       ./$(TEST_RUNNER)
 
 # Binaries
 $(PROJ_NAME): parseutils $(SRC_OBJS)
index 4ffb96228fdd1751f6132f06aa5a466678dba620..0b48ee7358cf6988cf90029fec5bbf6a15316bfd 100644 (file)
@@ -4,13 +4,13 @@
 #include <map>
 #include "btparser.h"
 #include "dllexer.h"
-#include "macro.h"
+#include "syntax.h"
 
 class DLParser : public BTParser
 {
     private:
         std::map<std::string,eTokenTypes> core_forms;
-        std::map<std::string,Macro*> macros;
+        std::map<std::string,Syntax*> macros;
     public:
         DLParser();
         ~DLParser();
diff --git a/source/dlparser/macro/macro.cpp b/source/dlparser/macro/macro.cpp
deleted file mode 100644 (file)
index 6554616..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#include "macro.h"
-
-Macro::Macro() : str_name(""), str_terminator("")
-{
-}
-
-Macro::~Macro()
-{
-}
-
-const std::string& Macro::name() const
-{
-    return str_name;
-}
-
-void Macro::name(std::string& name)
-{
-    str_name = name;
-}
-
-const std::string& Macro::terminator() const
-{
-    return str_terminator;
-}
-
-void Macro::terminator(std::string& term)
-{
-    str_terminator = term;
-}
-
diff --git a/source/dlparser/syntax/syntax.cpp b/source/dlparser/syntax/syntax.cpp
new file mode 100644 (file)
index 0000000..3382a90
--- /dev/null
@@ -0,0 +1,30 @@
+#include "syntax.h"
+
+Syntax::Syntax() : str_name(""), str_terminator("")
+{
+}
+
+Syntax::~Syntax()
+{
+}
+
+const std::string& Syntax::name() const
+{
+    return str_name;
+}
+
+void Syntax::name(std::string& name)
+{
+    str_name = name;
+}
+
+const std::string& Syntax::terminator() const
+{
+    return str_terminator;
+}
+
+void Syntax::terminator(std::string& term)
+{
+    str_terminator = term;
+}
+
similarity index 84%
rename from source/dlparser/macro/macro.h
rename to source/dlparser/syntax/syntax.h
index 06728f2e028fc7df77248a0e6fe282a759d65dc5..43ebe133906d9c331d02f4fc40a08fe9605de1ad 100644 (file)
@@ -1,15 +1,15 @@
-#ifndef MACRO_H
-#define MACRO_H
+#ifndef Syntax_H
+#define Syntax_H
 
 #include <string>
 
-class Macro {
+class Syntax {
     private:
         std::string str_name;
         std::string str_terminator;
     public:
-        Macro();
-        ~Macro();
+        Syntax();
+        ~Syntax();
         const std::string& name() const;
         void name(std::string& name);
         //const std::string& keywords() const;
index bc55de87765e3a9a0e8c73d73a8e7f7168c5c136..781db542e815c73f418d7dccb8b959bbd49b5dc0 100644 (file)
@@ -5,7 +5,6 @@
 #include "dlparser.h"
 #include "scheme.h"
 #include "common.h"
-#include "macro.h"
 #include "options.h"
 #include "astprinter.h"
 
index 4d558e3e1d857058f8787c4cacf458d263cac6d7..78eb6c3ec82be547d286ae6607c8afd3d4508dd5 100644 (file)
@@ -1,6 +1,6 @@
 #include "expprocessor.h"
 
-ExpProcessor::ExpProcessor(std::map<std::string,Macro*> &macros) : macro_registry(macros)
+ExpProcessor::ExpProcessor(std::map<std::string,Syntax*> &macros) : macro_registry(macros)
 {
 }
 
@@ -27,7 +27,7 @@ void ExpProcessor::afterChildren(AST* cur, int depth)
     if (cur->type() == SYNTAX)
     {
         std::string name = (*(cur->children()->begin()))->text();
-        Macro* macro = new Macro();
+        Syntax* macro = new Syntax();
         macro->name( name );
         macro_registry[ macro->name() ] = macro;
     }
index 36778ce0779b3a97dc124876afa7d8955c2cb60f..0c0b2f20bdd02c123bc95236d9ce84867feba227 100644 (file)
@@ -4,13 +4,13 @@
 #include <map>
 #include "ivisitor.h"
 #include "dllexer.h"
-#include "macro.h"
+#include "syntax.h"
 
 class ExpProcessor : public IVisitor {
     protected:
-        std::map<std::string,Macro*>& macro_registry;
+        std::map<std::string,Syntax*>& macro_registry;
     public:
-        ExpProcessor(std::map<std::string,Macro*>& macros);
+        ExpProcessor(std::map<std::string,Syntax*>& macros);
     private:
         void beforeVisit(AST* cur, int depth);
         void afterVisit(AST* cur, int depth);