summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-09-05 16:29:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-09-05 16:29:23 +0200
commit4974b4763bd60eb875f93a71dbe2fe82ecfed9fc (patch)
tree9353fb3fec3fa5f77f1faaf6da8185e3d006e7ba /tests
parente2299f6d95ba3264072d6ddc49f153ad73fd9d24 (diff)
Add semantic graph and traversal mechanism
The parser now builds the semantic graph.
Diffstat (limited to 'tests')
-rw-r--r--tests/lexer/driver.cxx4
-rw-r--r--tests/lexer/makefile10
-rw-r--r--tests/parser/driver.cxx4
-rw-r--r--tests/parser/makefile28
4 files changed, 39 insertions, 7 deletions
diff --git a/tests/lexer/driver.cxx b/tests/lexer/driver.cxx
index c888890..2094ca5 100644
--- a/tests/lexer/driver.cxx
+++ b/tests/lexer/driver.cxx
@@ -6,8 +6,8 @@
#include <fstream>
#include <iostream>
-#include <cli/token.hxx>
-#include <cli/lexer.hxx>
+#include <token.hxx>
+#include <lexer.hxx>
using namespace std;
diff --git a/tests/lexer/makefile b/tests/lexer/makefile
index 08859e8..7af0e62 100644
--- a/tests/lexer/makefile
+++ b/tests/lexer/makefile
@@ -18,12 +18,18 @@ driver := $(out_base)/driver
test := $(out_base)/.test
clean := $(out_base)/.clean
+# Import.
+#
+$(call import,\
+ $(scf_root)/import/libcutl/stub.make,\
+ l: cutl.l,cpp-options: cutl.l.cpp-options)
# Build.
#
-$(driver): $(cxx_obj) $(out_root)/cli/lexer.o
+$(driver): $(cxx_obj) $(out_root)/cli/lexer.o $(cutl.l)
-$(cxx_obj) $(cxx_od): cpp_options := -I$(src_base) -I$(src_root)
+$(cxx_obj) $(cxx_od): cpp_options := -I$(src_base) -I$(src_root)/cli
+$(cxx_obj) $(cxx_od): $(cutl.l.cpp-options)
$(call include-dep,$(cxx_od))
diff --git a/tests/parser/driver.cxx b/tests/parser/driver.cxx
index 27490b1..ea7b003 100644
--- a/tests/parser/driver.cxx
+++ b/tests/parser/driver.cxx
@@ -6,7 +6,9 @@
#include <fstream>
#include <iostream>
-#include <cli/parser.hxx>
+#include <parser.hxx>
+#include <semantics.hxx>
+#include <traversal.hxx>
using namespace std;
diff --git a/tests/parser/makefile b/tests/parser/makefile
index 526b529..a43af9a 100644
--- a/tests/parser/makefile
+++ b/tests/parser/makefile
@@ -21,9 +21,33 @@ clean := $(out_base)/.clean
# Build.
#
-$(driver): $(cxx_obj) $(out_root)/cli/lexer.o $(out_root)/cli/parser.o
+# Import.
+#
+$(call import,\
+ $(scf_root)/import/libcutl/stub.make,\
+ l: cutl.l,cpp-options: cutl.l.cpp-options)
-$(cxx_obj) $(cxx_od): cpp_options := -I$(src_base) -I$(src_root)
+# Build.
+#
+cli_obj := \
+lexer.o \
+parser.o \
+semantics/class.o \
+semantics/elements.o \
+semantics/expression.o \
+semantics/namespace.o \
+semantics/option.o \
+semantics/unit.o \
+traversal/class.o \
+traversal/elements.o \
+traversal/namespace.o \
+traversal/option.o \
+traversal/unit.o
+
+$(driver): $(cxx_obj) $(addprefix $(out_root)/cli/,$(cli_obj)) $(cutl.l)
+
+$(cxx_obj) $(cxx_od): cpp_options := -I$(src_base) -I$(src_root)/cli
+$(cxx_obj) $(cxx_od): $(cutl.l.cpp-options)
$(call include-dep,$(cxx_od))