From: Michael D. Lowis Date: Wed, 30 May 2012 04:55:25 +0000 (-0400) Subject: Renamed macro class to Syntax X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=becfce7d334a83c7f2e21dda5932c25a64135101;p=archive%2Fdlang.git Renamed macro class to Syntax --- diff --git a/Makefile b/Makefile index f0b1e0c..1bb68dc 100644 --- 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) diff --git a/source/dlparser/dlparser.h b/source/dlparser/dlparser.h index 4ffb962..0b48ee7 100644 --- a/source/dlparser/dlparser.h +++ b/source/dlparser/dlparser.h @@ -4,13 +4,13 @@ #include #include "btparser.h" #include "dllexer.h" -#include "macro.h" +#include "syntax.h" class DLParser : public BTParser { private: std::map core_forms; - std::map macros; + std::map macros; public: DLParser(); ~DLParser(); diff --git a/source/dlparser/macro/macro.cpp b/source/dlparser/macro/macro.cpp deleted file mode 100644 index 6554616..0000000 --- a/source/dlparser/macro/macro.cpp +++ /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 index 0000000..3382a90 --- /dev/null +++ b/source/dlparser/syntax/syntax.cpp @@ -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; +} + diff --git a/source/dlparser/macro/macro.h b/source/dlparser/syntax/syntax.h similarity index 84% rename from source/dlparser/macro/macro.h rename to source/dlparser/syntax/syntax.h index 06728f2..43ebe13 100644 --- a/source/dlparser/macro/macro.h +++ b/source/dlparser/syntax/syntax.h @@ -1,15 +1,15 @@ -#ifndef MACRO_H -#define MACRO_H +#ifndef Syntax_H +#define Syntax_H #include -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; diff --git a/source/main.cpp b/source/main.cpp index bc55de8..781db54 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -5,7 +5,6 @@ #include "dlparser.h" #include "scheme.h" #include "common.h" -#include "macro.h" #include "options.h" #include "astprinter.h" diff --git a/source/visitors/expprocessor.cpp b/source/visitors/expprocessor.cpp index 4d558e3..78eb6c3 100644 --- a/source/visitors/expprocessor.cpp +++ b/source/visitors/expprocessor.cpp @@ -1,6 +1,6 @@ #include "expprocessor.h" -ExpProcessor::ExpProcessor(std::map ¯os) : macro_registry(macros) +ExpProcessor::ExpProcessor(std::map ¯os) : 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; } diff --git a/source/visitors/expprocessor.h b/source/visitors/expprocessor.h index 36778ce..0c0b2f2 100644 --- a/source/visitors/expprocessor.h +++ b/source/visitors/expprocessor.h @@ -4,13 +4,13 @@ #include #include "ivisitor.h" #include "dllexer.h" -#include "macro.h" +#include "syntax.h" class ExpProcessor : public IVisitor { protected: - std::map& macro_registry; + std::map& macro_registry; public: - ExpProcessor(std::map& macros); + ExpProcessor(std::map& macros); private: void beforeVisit(AST* cur, int depth); void afterVisit(AST* cur, int depth);