release: $(PROJ_NAME)
test: $(TEST_RUNNER)
- $(TEST_RUNNER)
+ ./$(TEST_RUNNER)
# Binaries
$(PROJ_NAME): parseutils $(SRC_OBJS)
#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();
+++ /dev/null
-#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;
-}
-
--- /dev/null
+#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;
+}
+
-#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;
#include "dlparser.h"
#include "scheme.h"
#include "common.h"
-#include "macro.h"
#include "options.h"
#include "astprinter.h"
#include "expprocessor.h"
-ExpProcessor::ExpProcessor(std::map<std::string,Macro*> ¯os) : macro_registry(macros)
+ExpProcessor::ExpProcessor(std::map<std::string,Syntax*> ¯os) : macro_registry(macros)
{
}
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;
}
#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);