Skip to content

Commit

Permalink
Refactor parser dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernhard Scholz authored and Bernhard Scholz committed Aug 4, 2020
1 parent b0aecd2 commit ed93317
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 28 deletions.
32 changes: 16 additions & 16 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ souffle_sources = \
GraphUtils.h \
IOSystem.h \
LogStatement.h \
ParserDriver.cpp \
ParserDriver.h \
ParserUtils.cpp \
ParserUtils.h \
parser/ParserDriver.cpp \
parser/ParserDriver.h \
parser/ParserUtils.cpp \
parser/ParserUtils.h \
ProfileEvent.h \
RamTypes.h \
ReadStream.h \
Expand Down Expand Up @@ -270,8 +270,8 @@ souffle_sources = \
interpreter/InterpreterProgInterface.h \
interpreter/InterpreterRelation.cpp \
interpreter/InterpreterRelation.h \
parser.cc \
parser.hh \
parser/parser.cc \
parser/parser.hh \
ram/Condition.h \
ram/Expression.h \
ram/Node.h \
Expand Down Expand Up @@ -318,8 +318,8 @@ souffle_sources = \
ram/transform/ReportIndex.h \
ram/transform/TupleId.cpp \
ram/transform/TupleId.h \
scanner.cc \
stack.hh \
parser/scanner.cc \
parser/stack.hh \
synthesiser/Synthesiser.cpp \
synthesiser/Synthesiser.h \
synthesiser/SynthesiserRelation.cpp \
Expand All @@ -342,7 +342,7 @@ souffle_profile_SOURCES = souffle_prof.cpp

dist_bin_SCRIPTS = souffle-compile souffle-config

EXTRA_DIST = parser.yy scanner.ll
EXTRA_DIST = parser/parser.yy parser/scanner.ll

soufflepublicdir = $(includedir)/souffle

Expand Down Expand Up @@ -397,17 +397,17 @@ souffleutilitydir = $(soufflepublicdir)/utility
souffleutility_HEADERS = $(souffle_utility_sources)

# files to clean
CLEANFILES = $(BUILT_SOURCES) parser.cc scanner.cc parser.hh stack.hh
CLEANFILES = $(BUILT_SOURCES) parser/parser.cc parser/scanner.cc parser/parser.hh parser/stack.hh

# run Bison
$(builddir)/parser.hh: $(srcdir)/parser.yy
$(BISON) -Wall -Werror -Wno-error=deprecated -Wno-error=other -v -d -o parser.cc $(srcdir)/parser.yy
$(builddir)/parser/parser.hh: $(srcdir)/parser/parser.yy
$(BISON) -Wall -Werror -Wno-error=deprecated -Wno-error=other -v -d -o parser/parser.cc $(srcdir)/parser/parser.yy

# and FLEX
$(builddir)/scanner.cc: $(srcdir)/scanner.ll
$(FLEX) -o scanner.cc $(srcdir)/scanner.ll
$(builddir)/parser/scanner.cc: $(srcdir)/parser/scanner.ll
$(FLEX) -o parser/scanner.cc $(srcdir)/parser/scanner.ll

# driver depends on the generated header
$(builddir)/parser.cc $(builddir)/stack.hh $(builddir)/scanner.cc \
$(builddir)/main.cpp $(builddir)/ParserDriver.cpp: $(builddir)/parser.hh
$(builddir)/parser/parser.cc $(builddir)/parser/stack.hh $(builddir)/parser/scanner.cc \
$(builddir)/main.cpp $(builddir)/parser/ParserDriver.cpp: $(builddir)/parser/parser.hh

2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "ErrorReport.h"
#include "Explain.h"
#include "Global.h"
#include "ParserDriver.h"
#include "RamTypes.h"
#include "ast/Node.h"
#include "ast/Program.h"
Expand Down Expand Up @@ -65,6 +64,7 @@
#include "config.h"
#include "interpreter/InterpreterEngine.h"
#include "interpreter/InterpreterProgInterface.h"
#include "parser/ParserDriver.h"
#include "profile/Tui.h"
#include "ram/Node.h"
#include "ram/Program.h"
Expand Down
2 changes: 1 addition & 1 deletion src/ParserDriver.cpp → src/parser/ParserDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
***********************************************************************/

#include "ParserDriver.h"
#include "parser/ParserDriver.h"
#include "ErrorReport.h"
#include "Global.h"
#include "ast/Clause.h"
Expand Down
2 changes: 1 addition & 1 deletion src/ParserDriver.h → src/parser/ParserDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "SrcLocation.h"
#include "ast/QualifiedName.h"
#include "ast/TranslationUnit.h"
#include "parser.hh"
#include "parser/parser.hh"
#include <cstdio>
#include <memory>
#include <set>
Expand Down
2 changes: 1 addition & 1 deletion src/ParserUtils.cpp → src/parser/ParserUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
***********************************************************************/

#include "ParserUtils.h"
#include "parser/ParserUtils.h"
#include "ast/Atom.h"
#include "ast/Clause.h"
#include "ast/Constraint.h"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/parser.yy → src/parser/parser.yy
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
#include "ast/UnionType.h"
#include "ast/UnnamedVariable.h"
#include "ast/UserDefinedFunctor.h"
#include "ParserUtils.h"
#include "parser/ParserUtils.h"
#include "ast/Variable.h"
#include "BinaryConstraintOps.h"
#include "FunctorOps.h"
Expand Down
4 changes: 2 additions & 2 deletions src/scanner.ll → src/parser/scanner.ll
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
#include "SrcLocation.h"
#define YYLTYPE SrcLocation

#include "ParserDriver.h"
#include "parser/ParserDriver.h"
#include "RamTypes.h"
#include "parser.hh"
#include "parser/parser.hh"

#include "utility/StringUtil.h"
#include "utility/FileUtil.h"
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ast_parser_utils_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "tests/test.h"

#include "ParserUtils.h"
#include "parser/ParserUtils.h"
#include "ast/Atom.h"
#include "ast/Clause.h"
#include "ast/Node.h"
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ast_print_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "AggregateOp.h"
#include "DebugReport.h"
#include "ErrorReport.h"
#include "ParserDriver.h"
#include "parser/ParserDriver.h"
#include "ast/Argument.h"
#include "ast/Atom.h"
#include "ast/Clause.h"
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ast_program_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "AggregateOp.h"
#include "DebugReport.h"
#include "ErrorReport.h"
#include "ParserDriver.h"
#include "parser/ParserDriver.h"
#include "ast/Argument.h"
#include "ast/Atom.h"
#include "ast/Attribute.h"
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ast_transformers_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "DebugReport.h"
#include "ErrorReport.h"
#include "ParserDriver.h"
#include "parser/ParserDriver.h"
#include "ast/Clause.h"
#include "ast/Node.h"
#include "ast/Program.h"
Expand Down
2 changes: 1 addition & 1 deletion src/tests/ast_utils_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "BinaryConstraintOps.h"
#include "DebugReport.h"
#include "ErrorReport.h"
#include "ParserDriver.h"
#include "parser/ParserDriver.h"
#include "ast/Argument.h"
#include "ast/Atom.h"
#include "ast/BinaryConstraint.h"
Expand Down

0 comments on commit ed93317

Please sign in to comment.