summaryrefslogtreecommitdiff
path: root/tests/parser
diff options
context:
space:
mode:
Diffstat (limited to 'tests/parser')
-rw-r--r--tests/parser/driver.cxx46
-rw-r--r--tests/parser/makefile94
-rw-r--r--tests/parser/test-000.cli5
-rw-r--r--tests/parser/test-000.std0
-rw-r--r--tests/parser/test-001-base.cli0
-rw-r--r--tests/parser/test-001-common.cli1
-rw-r--r--tests/parser/test-001.cli6
-rw-r--r--tests/parser/test-001.std0
-rw-r--r--tests/parser/test-002.cli15
-rw-r--r--tests/parser/test-002.std0
-rw-r--r--tests/parser/test-003.cli23
-rw-r--r--tests/parser/test-003.std0
-rw-r--r--tests/parser/test-004.cli8
-rw-r--r--tests/parser/test-004.std0
-rw-r--r--tests/parser/test-005.cli67
-rw-r--r--tests/parser/test-005.std0
-rw-r--r--tests/parser/test-006.cli16
-rw-r--r--tests/parser/test-006.std0
-rw-r--r--tests/parser/test-007-base.cli11
-rw-r--r--tests/parser/test-007.cli30
-rw-r--r--tests/parser/test-007.std0
21 files changed, 0 insertions, 322 deletions
diff --git a/tests/parser/driver.cxx b/tests/parser/driver.cxx
deleted file mode 100644
index bc963b5..0000000
--- a/tests/parser/driver.cxx
+++ /dev/null
@@ -1,46 +0,0 @@
-// file : tests/parser/driver.cxx
-// author : Boris Kolpackov <boris@codesynthesis.com>
-// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
-// license : MIT; see accompanying LICENSE file
-
-#include <fstream>
-#include <iostream>
-
-#include <parser.hxx>
-#include <semantics.hxx>
-#include <traversal.hxx>
-
-using namespace std;
-
-int
-main (int argc, char* argv[])
-{
- if (argc != 2)
- {
- cerr << "usage: " << argv[0] << " file.cli" << endl;
- return 1;
- }
-
- try
- {
- semantics::path path (argv[1]);
-
- ifstream ifs;
- ifs.exceptions (ifstream::failbit | ifstream::badbit);
- ifs.open (path.string ().c_str ());
-
- parser::paths include_paths;
- parser p (include_paths);
- p.parse (ifs, path);
- }
- catch (semantics::invalid_path const& e)
- {
- cerr << "error: '" << e.path () << "' is not a valid filesystem path"
- << endl;
- return 1;
- }
- catch (parser::invalid_input const&)
- {
- return 1;
- }
-}
diff --git a/tests/parser/makefile b/tests/parser/makefile
deleted file mode 100644
index 490fbf3..0000000
--- a/tests/parser/makefile
+++ /dev/null
@@ -1,94 +0,0 @@
-# file : tests/parser/makefile
-# author : Boris Kolpackov <boris@codesynthesis.com>
-# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
-# license : MIT; see accompanying LICENSE file
-
-include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make
-
-cxx_tun := driver.cxx
-
-tests := 000 001 002 003 004 005 006 007
-
-#
-#
-cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o))
-cxx_od := $(cxx_obj:.o=.o.d)
-
-driver := $(out_base)/driver
-test := $(out_base)/.test
-clean := $(out_base)/.clean
-
-# Build.
-#
-# Import.
-#
-$(call import,\
- $(scf_root)/import/libcutl/stub.make,\
- l: cutl.l,cpp-options: cutl.l.cpp-options)
-
-# 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))
-
-# Alias for default target.
-#
-$(out_base)/: $(driver)
-
-# Test.
-#
-test_targets := $(addprefix $(out_base)/.test-,$(tests))
-
-$(test): $(test_targets)
-$(test_targets): driver := $(driver)
-
-.PHONY: $(out_base)/.test-%
-$(out_base)/.test-%: $(driver) $(src_base)/test-%.cli $(src_base)/test-%.std
- $(call message,test $(out_base)/$*,$(driver) $(src_base)/test-$*.cli | diff -u $(src_base)/test-$*.std -)
-
-# Clean.
-#
-$(clean): \
- $(driver).o.clean \
- $(addsuffix .cxx.clean,$(cxx_obj)) \
- $(addsuffix .cxx.clean,$(cxx_od))
-
-# Generated .gitignore.
-#
-ifeq ($(out_base),$(src_base))
-$(driver): | $(out_base)/.gitignore
-
-$(out_base)/.gitignore: files := driver
-$(clean): $(out_base)/.gitignore.clean
-
-$(call include,$(bld_root)/git/gitignore.make)
-endif
-
-# How to.
-#
-$(call include,$(bld_root)/cxx/o-e.make)
-$(call include,$(bld_root)/cxx/cxx-o.make)
-$(call include,$(bld_root)/cxx/cxx-d.make)
-
-# Dependencies.
-#
-$(call import,$(src_root)/cli/makefile)
diff --git a/tests/parser/test-000.cli b/tests/parser/test-000.cli
deleted file mode 100644
index 04c6576..0000000
--- a/tests/parser/test-000.cli
+++ /dev/null
@@ -1,5 +0,0 @@
-// def-unit
-//
-include <string>;
-namespace n {}
-class c {};
diff --git a/tests/parser/test-000.std b/tests/parser/test-000.std
deleted file mode 100644
index e69de29..0000000
--- a/tests/parser/test-000.std
+++ /dev/null
diff --git a/tests/parser/test-001-base.cli b/tests/parser/test-001-base.cli
deleted file mode 100644
index e69de29..0000000
--- a/tests/parser/test-001-base.cli
+++ /dev/null
diff --git a/tests/parser/test-001-common.cli b/tests/parser/test-001-common.cli
deleted file mode 100644
index 73fb928..0000000
--- a/tests/parser/test-001-common.cli
+++ /dev/null
@@ -1 +0,0 @@
-include "test-001-base.cli";
diff --git a/tests/parser/test-001.cli b/tests/parser/test-001.cli
deleted file mode 100644
index 52f7f8e..0000000
--- a/tests/parser/test-001.cli
+++ /dev/null
@@ -1,6 +0,0 @@
-// include-decl-seq, include-decl
-//
-include <string>;
-include "types.hxx";
-include "test-001-common.cli";
-include "../parser/test-001-base.cli";
diff --git a/tests/parser/test-001.std b/tests/parser/test-001.std
deleted file mode 100644
index e69de29..0000000
--- a/tests/parser/test-001.std
+++ /dev/null
diff --git a/tests/parser/test-002.cli b/tests/parser/test-002.cli
deleted file mode 100644
index f8f368e..0000000
--- a/tests/parser/test-002.cli
+++ /dev/null
@@ -1,15 +0,0 @@
-// namespace-def, namespace-def-body
-//
-namespace n1 {}
-
-namespace n1
-{
- namespace n2 {}
- class c {};
- namespace n2
- {
- namespace n3 {}
- }
-}
-
-namespace n4 {}
diff --git a/tests/parser/test-002.std b/tests/parser/test-002.std
deleted file mode 100644
index e69de29..0000000
--- a/tests/parser/test-002.std
+++ /dev/null
diff --git a/tests/parser/test-003.cli b/tests/parser/test-003.cli
deleted file mode 100644
index 2920b16..0000000
--- a/tests/parser/test-003.cli
+++ /dev/null
@@ -1,23 +0,0 @@
-// class-def, inheritance-spec, abstract-spec
-//
-class c1
-{
-};
-
-class c2 = 0
-{
-};
-
-class c3: c1, ::c2
-{
-};
-
-namespace n1
-{
- class c {};
-}
-
-class c4: n1::c = 0
-{
-};
-
diff --git a/tests/parser/test-003.std b/tests/parser/test-003.std
deleted file mode 100644
index e69de29..0000000
--- a/tests/parser/test-003.std
+++ /dev/null
diff --git a/tests/parser/test-004.cli b/tests/parser/test-004.cli
deleted file mode 100644
index e913288..0000000
--- a/tests/parser/test-004.cli
+++ /dev/null
@@ -1,8 +0,0 @@
-// option-def-seq
-//
-class c
-{
- bool -a;
- int -b;
- float -c;
-};
diff --git a/tests/parser/test-004.std b/tests/parser/test-004.std
deleted file mode 100644
index e69de29..0000000
--- a/tests/parser/test-004.std
+++ /dev/null
diff --git a/tests/parser/test-005.cli b/tests/parser/test-005.cli
deleted file mode 100644
index 7798552..0000000
--- a/tests/parser/test-005.cli
+++ /dev/null
@@ -1,67 +0,0 @@
-// option-def, type-spec, fundamental-type-spec, option-name-seq,
-// option-name, initializer, initializer-expr
-//
-class c
-{
- bool --bool;
- char --char;
-
- int -i1;
- unsigned int -i2;
- int unsigned -i3;
- long -i4;
- long int -i5;
- int long -i6;
- unsigned long -i7;
- long unsigned -i8;
-
- unsigned long int -i9;
- long unsigned int -i10;
- int long unsigned -i11;
- unsigned int long -i12;
-
- short -i13;
- unsigned short -i14;
- short unsigned -i15;
-
- char -i16;
- signed char -i17;
- char signed -i18;
- unsigned char -i19;
- char unsigned -i20;
-
- long long -ll1;
- long long int -ll2;
- long long unsigned -ll3;
- int long long -ll4;
- unsigned long long -ll5;
- long long int unsigned -ll6;
- long long unsigned int -ll7;
- unsigned long long int -ll8;
- unsigned int long long -ll9;
- int long long unsigned -ll10;
- int unsigned long long -ll11;
-
- double -d1;
- long double -d2;
- double long -d3;
-
- foo -o1;
- ::foo -o2;
- ::foo<bar> -o3;
- foo::bar -o4;
- ::foo::bar -o5;
- ::foo<bar>::baz -o6;
- ::foo<bar>::baz< ::fox<2> > -o7;
-
- bool -n1|--name1|/name1;
- bool "-n2"|"--name2";
-
- string -init1 = "string";
- char -init2 = 'c';
- int -init3 = -5;
- bool -inti4 = true;
- long -init5 = (2 * 4 - 5);
- type -init6 = type::default_value;
- type -init7 (abc, 2 - 1);
-};
diff --git a/tests/parser/test-005.std b/tests/parser/test-005.std
deleted file mode 100644
index e69de29..0000000
--- a/tests/parser/test-005.std
+++ /dev/null
diff --git a/tests/parser/test-006.cli b/tests/parser/test-006.cli
deleted file mode 100644
index 5b555e4..0000000
--- a/tests/parser/test-006.cli
+++ /dev/null
@@ -1,16 +0,0 @@
-// option-doc
-//
-class c
-{
- bool --help | -h {"Help me"};
-
- int --comp = 5
- {
- "<level>",
- "Set compression level",
- "Set compression level to <level>.
-
- The minimum value for this options is 0 and
- maximum is 9."
- };
-};
diff --git a/tests/parser/test-006.std b/tests/parser/test-006.std
deleted file mode 100644
index e69de29..0000000
--- a/tests/parser/test-006.std
+++ /dev/null
diff --git a/tests/parser/test-007-base.cli b/tests/parser/test-007-base.cli
deleted file mode 100644
index 7c02a39..0000000
--- a/tests/parser/test-007-base.cli
+++ /dev/null
@@ -1,11 +0,0 @@
-class b1 {};
-
-namespace n1
-{
- class b2 {};
-
- namespace i1
- {
- class b3 {};
- }
-}
diff --git a/tests/parser/test-007.cli b/tests/parser/test-007.cli
deleted file mode 100644
index b890a34..0000000
--- a/tests/parser/test-007.cli
+++ /dev/null
@@ -1,30 +0,0 @@
-// base class lookup
-//
-
-include "test-007-base.cli";
-
-class c1 {};
-class c2: c1 {};
-class c3: ::c1 {};
-
-namespace n1
-{
- class c4 {};
- class c5: c4 {};
- class c6: n1::c4 {};
- class c7: ::n1::c4 {};
-
- class c8: b2 {}; // From included.
- class c9: i1::b3 {}; // From included.
-
- namespace i1
- {
- class c10: c4 {}; // Outer scope.
- class c11: b3 {}; // From included.
- class c12: b2 {}; // Outer scope from included.
- class c4: n1::c4 {}; // Qualified name from outer scope.
- }
-}
-
-class c13: n1::c4 {};
-class c14: ::n1::c4 {};
diff --git a/tests/parser/test-007.std b/tests/parser/test-007.std
deleted file mode 100644
index e69de29..0000000
--- a/tests/parser/test-007.std
+++ /dev/null