diff options
29 files changed, 50 insertions, 38 deletions
diff --git a/Makefile.am b/Makefile.am index 1aa58d9..cf09ee3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -67,7 +67,7 @@ check_JAVA = bashast/java_libbashLexer.java bashast/java_libbashParser.java AM_JAVACFLAGS = -source 1.4 -classpath @antlr_cp@ AM_CXXFLAGS = -std=c++0x -AM_CPPFLAGS = -I$(top_srcdir)/src +AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include if DEVELOPER_MODE # -Weffc++ seems to be giving false positives on protected non @@ -187,9 +187,21 @@ CLEANFILES = $(GENERATED_PARSER_CPP) \ massif.out \ callgrind.out +libbash_includedir = $(includedir)/libbash-0.1/libbash +libbash_include_HEADERS = include/libbash.h \ + include/common.h \ + include/divide_by_zero_error.h \ + include/illegal_argument_exception.h \ + include/interpreter_exception.h \ + include/parse_exception.h \ + include/readonly_exception.h \ + include/runtime_exception.h \ + include/unsupported_exception.h \ + include/exceptions.h + lib_LTLIBRARIES = libcppbash.la -libcppbash_la_SOURCES = src/common.h \ - src/libbash.h \ +libcppbash_la_SOURCES = include/common.h \ + include/libbash.h \ src/libbash.cpp \ src/cppbash_builtin.cpp \ src/cppbash_builtin.h \ @@ -227,14 +239,14 @@ libcppbash_la_SOURCES = src/common.h \ src/builtins/builtin_exceptions.h \ $(GENERATED_PARSER_C) \ $(GENERATED_PARSER_H) \ - src/core/divide_by_zero_error.h \ - src/core/exceptions.h \ - src/core/illegal_argument_exception.h \ - src/core/interpreter_exception.h \ - src/core/parse_exception.h \ - src/core/readonly_exception.h \ - src/core/runtime_exception.h \ - src/core/unsupported_exception.h \ + include/divide_by_zero_error.h \ + include/exceptions.h \ + include/illegal_argument_exception.h \ + include/interpreter_exception.h \ + include/parse_exception.h \ + include/readonly_exception.h \ + include/runtime_exception.h \ + include/unsupported_exception.h \ src/core/interpreter.cpp \ src/core/interpreter.h \ src/core/symbols.hpp \ diff --git a/bashast/bashast.g b/bashast/bashast.g index 5549439..b7e0d32 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -165,7 +165,7 @@ tokens{ @postinclude { C_INCLUDE #include <boost/numeric/conversion/cast.hpp> - C_INCLUDE #include "core/exceptions.h" + C_INCLUDE #include "exceptions.h" } @lexer::postinclude { #define double_quoted ctx->double_quoted diff --git a/src/common.h b/include/common.h index 7203f02..7203f02 100644 --- a/src/common.h +++ b/include/common.h diff --git a/src/core/divide_by_zero_error.h b/include/divide_by_zero_error.h index 59e0fcb..59e0fcb 100644 --- a/src/core/divide_by_zero_error.h +++ b/include/divide_by_zero_error.h diff --git a/src/core/exceptions.h b/include/exceptions.h index 519d16a..07c203c 100644 --- a/src/core/exceptions.h +++ b/include/exceptions.h @@ -24,12 +24,12 @@ #ifndef LIBBASH_CORE_EXCEPTIOND_H_ #define LIBBASH_CORE_EXCEPTIOND_H_ -#include "core/divide_by_zero_error.h" -#include "core/illegal_argument_exception.h" -#include "core/interpreter_exception.h" -#include "core/parse_exception.h" -#include "core/readonly_exception.h" -#include "core/runtime_exception.h" -#include "core/unsupported_exception.h" +#include "divide_by_zero_error.h" +#include "illegal_argument_exception.h" +#include "interpreter_exception.h" +#include "parse_exception.h" +#include "readonly_exception.h" +#include "runtime_exception.h" +#include "unsupported_exception.h" #endif diff --git a/src/core/illegal_argument_exception.h b/include/illegal_argument_exception.h index 847b6a8..847b6a8 100644 --- a/src/core/illegal_argument_exception.h +++ b/include/illegal_argument_exception.h diff --git a/src/core/interpreter_exception.h b/include/interpreter_exception.h index 11f909f..11f909f 100644 --- a/src/core/interpreter_exception.h +++ b/include/interpreter_exception.h diff --git a/src/libbash.h b/include/libbash.h index f42d278..bc065f3 100644 --- a/src/libbash.h +++ b/include/libbash.h @@ -30,7 +30,7 @@ #include <vector> #include "common.h" -#include "core/exceptions.h" +#include "exceptions.h" namespace libbash { diff --git a/src/core/parse_exception.h b/include/parse_exception.h index 6f19bff..6f19bff 100644 --- a/src/core/parse_exception.h +++ b/include/parse_exception.h diff --git a/src/core/readonly_exception.h b/include/readonly_exception.h index 16d1106..16d1106 100644 --- a/src/core/readonly_exception.h +++ b/include/readonly_exception.h diff --git a/src/core/runtime_exception.h b/include/runtime_exception.h index ed87655..ed87655 100644 --- a/src/core/runtime_exception.h +++ b/include/runtime_exception.h diff --git a/src/core/unsupported_exception.h b/include/unsupported_exception.h index 9920a5c..9920a5c 100644 --- a/src/core/unsupported_exception.h +++ b/include/unsupported_exception.h diff --git a/src/builtins/break_builtin.cpp b/src/builtins/break_builtin.cpp index 0ee20a7..b781e27 100644 --- a/src/builtins/break_builtin.cpp +++ b/src/builtins/break_builtin.cpp @@ -25,7 +25,7 @@ #include <boost/lexical_cast.hpp> #include "builtins/builtin_exceptions.h" -#include "core/interpreter_exception.h" +#include "exceptions.h" int break_builtin::exec(const std::vector<std::string>& bash_args) { diff --git a/src/builtins/builtin_exceptions.h b/src/builtins/builtin_exceptions.h index e1a443a..89a8cc8 100644 --- a/src/builtins/builtin_exceptions.h +++ b/src/builtins/builtin_exceptions.h @@ -26,7 +26,7 @@ #include <stdexcept> -#include "core/exceptions.h" +#include "exceptions.h" /// /// \class return_exception diff --git a/src/builtins/continue_builtin.cpp b/src/builtins/continue_builtin.cpp index 9bb9469..e27b031 100644 --- a/src/builtins/continue_builtin.cpp +++ b/src/builtins/continue_builtin.cpp @@ -25,7 +25,7 @@ #include <boost/lexical_cast.hpp> #include "builtins/builtin_exceptions.h" -#include "core/exceptions.h" +#include "exceptions.h" int continue_builtin::exec(const std::vector<std::string>& bash_args) { diff --git a/src/builtins/declare_builtin.cpp b/src/builtins/declare_builtin.cpp index 2644bb7..1c85d61 100644 --- a/src/builtins/declare_builtin.cpp +++ b/src/builtins/declare_builtin.cpp @@ -25,8 +25,8 @@ #include <algorithm> #include <iostream> -#include "core/exceptions.h" #include "core/interpreter.h" +#include "exceptions.h" int declare_builtin::exec(const std::vector<std::string>& bash_args) { diff --git a/src/builtins/shift_builtin.cpp b/src/builtins/shift_builtin.cpp index c78c6ae..e36a5e6 100644 --- a/src/builtins/shift_builtin.cpp +++ b/src/builtins/shift_builtin.cpp @@ -25,8 +25,8 @@ #include <boost/lexical_cast.hpp> #include "builtins/builtin_exceptions.h" -#include "core/exceptions.h" #include "core/interpreter.h" +#include "exceptions.h" int shift_builtin::exec(const std::vector<std::string>& bash_args) { diff --git a/src/builtins/shopt_builtin.cpp b/src/builtins/shopt_builtin.cpp index f55c49e..fd9e581 100644 --- a/src/builtins/shopt_builtin.cpp +++ b/src/builtins/shopt_builtin.cpp @@ -23,9 +23,9 @@ #include "builtins/shopt_builtin.h" -#include "core/exceptions.h" #include "core/interpreter.h" #include "cppbash_builtin.h" +#include "exceptions.h" void shopt_builtin::set_opt(const std::vector<std::string>& bash_args, bool value) { diff --git a/src/builtins/source_builtin.cpp b/src/builtins/source_builtin.cpp index d7924ab..91f3397 100644 --- a/src/builtins/source_builtin.cpp +++ b/src/builtins/source_builtin.cpp @@ -31,9 +31,9 @@ #include "builtins/builtin_exceptions.h" #include "cppbash_builtin.h" -#include "core/exceptions.h" #include "core/interpreter.h" #include "core/bash_ast.h" +#include "exceptions.h" namespace { std::mutex parse_mutex; diff --git a/src/builtins/tests/declare_tests.cpp b/src/builtins/tests/declare_tests.cpp index 95f4b61..686c816 100644 --- a/src/builtins/tests/declare_tests.cpp +++ b/src/builtins/tests/declare_tests.cpp @@ -27,9 +27,9 @@ #include <gtest/gtest.h> #include "core/bash_ast.h" -#include "core/exceptions.h" #include "core/interpreter.h" #include "cppbash_builtin.h" +#include "exceptions.h" using namespace std; diff --git a/src/builtins/tests/shift_tests.cpp b/src/builtins/tests/shift_tests.cpp index 8625a6c..05537a1 100644 --- a/src/builtins/tests/shift_tests.cpp +++ b/src/builtins/tests/shift_tests.cpp @@ -23,9 +23,9 @@ #include <boost/lexical_cast.hpp> #include <gtest/gtest.h> -#include "core/exceptions.h" #include "core/interpreter.h" #include "cppbash_builtin.h" +#include "exceptions.h" TEST(shift_builtin_test, bad_argument) { diff --git a/src/builtins/tests/shopt_tests.cpp b/src/builtins/tests/shopt_tests.cpp index 9fe4949..dc43dee 100644 --- a/src/builtins/tests/shopt_tests.cpp +++ b/src/builtins/tests/shopt_tests.cpp @@ -23,9 +23,9 @@ #include <gtest/gtest.h> #include "builtins/builtin_exceptions.h" -#include "core/exceptions.h" #include "core/interpreter.h" #include "cppbash_builtin.h" +#include "exceptions.h" namespace { diff --git a/src/core/bash_ast.cpp b/src/core/bash_ast.cpp index ee4fe13..5cca4f4 100644 --- a/src/core/bash_ast.cpp +++ b/src/core/bash_ast.cpp @@ -30,8 +30,8 @@ #include <boost/algorithm/string/trim.hpp> #include <boost/numeric/conversion/cast.hpp> -#include "core/exceptions.h" #include "core/interpreter.h" +#include "exceptions.h" #include "libbashLexer.h" #include "libbashParser.h" #include "libbashWalker.h" diff --git a/src/core/bash_condition.cpp b/src/core/bash_condition.cpp index af57b90..be0aaa2 100644 --- a/src/core/bash_condition.cpp +++ b/src/core/bash_condition.cpp @@ -29,8 +29,8 @@ #include <unistd.h> #include "core/bash_ast.h" -#include "core/exceptions.h" #include "core/interpreter.h" +#include "exceptions.h" namespace { diff --git a/src/core/function.h b/src/core/function.h index 92ae97c..e4b8aa1 100644 --- a/src/core/function.h +++ b/src/core/function.h @@ -24,10 +24,10 @@ #ifndef LIBBASH_CORE_FUNCTION_H_ #define LIBBASH_CORE_FUNCTION_H_ -#include "core/exceptions.h" - #include <antlr3.h> +#include "exceptions.h" + class bash_ast; class interpreter; diff --git a/src/core/symbols.hpp b/src/core/symbols.hpp index 5114df1..15a3fa0 100644 --- a/src/core/symbols.hpp +++ b/src/core/symbols.hpp @@ -35,7 +35,7 @@ #include <boost/lexical_cast.hpp> #include <boost/numeric/conversion/cast.hpp> -#include "core/exceptions.h" +#include "exceptions.h" /// /// \class converter diff --git a/src/core/tests/bash_condition_test.cpp b/src/core/tests/bash_condition_test.cpp index 09f441a..d183e53 100644 --- a/src/core/tests/bash_condition_test.cpp +++ b/src/core/tests/bash_condition_test.cpp @@ -30,8 +30,8 @@ #include <gtest/gtest.h> #include "core/bash_condition.h" -#include "core/exceptions.h" #include "core/interpreter.h" +#include "exceptions.h" namespace { diff --git a/utils/ast_printer.cpp b/utils/ast_printer.cpp index d2dabc9..40e7b08 100644 --- a/utils/ast_printer.cpp +++ b/utils/ast_printer.cpp @@ -36,7 +36,7 @@ #include <boost/fusion/include/adapt_struct.hpp> #include "core/bash_ast.h" -#include "core/exceptions.h" +#include "exceptions.h" #include "libbashLexer.h" #include "libbashParser.h" diff --git a/utils/instruo.cpp b/utils/instruo.cpp index 98116cf..690e843 100644 --- a/utils/instruo.cpp +++ b/utils/instruo.cpp @@ -53,8 +53,8 @@ #include <paludis/package_database.hh> #include <paludis/metadata_key.hh> -#include "core/exceptions.h" #include "command_line.h" +#include "exceptions.h" #include "libbash.h" #include "test.h" #include "utils/metadata.h" |