├── .gitignore
├── download.png
├── preshell.png
├── README.md
├── .travis.yml
├── lib
├── CMakeLists.txt
└── core
│ ├── default_include.hpp
│ ├── default_sysinclude.hpp
│ ├── default_defines.hpp
│ ├── version_desc.hpp
│ ├── CMakeLists.txt
│ ├── macro_map.cpp
│ ├── util.cpp
│ ├── macro_definition.cpp
│ ├── config.cpp
│ ├── version.cpp
│ ├── indenter.cpp
│ ├── wave_context.cpp
│ ├── context.cpp
│ ├── preshell_preprocessing_hooks.cpp
│ ├── parse_config.cpp
│ ├── shell.cpp
│ └── preshell.cpp
├── test
├── main.cpp
├── test_util.cpp
├── test_util.hpp
├── CMakeLists.txt
├── temp_header.hpp
├── is_pragma_usage.cpp
├── temp_header.cpp
├── test_shell.hpp
├── parse_config.cpp
├── join.cpp
├── test_shell.cpp
├── definition_logging.cpp
├── history.cpp
├── clang_compatibility.cpp
├── replay_history.cpp
├── shell.cpp
└── preshell.cpp
├── include
├── preshell
│ ├── string.hpp
│ ├── version.hpp
│ ├── file_position.hpp
│ ├── if_state.hpp
│ ├── token.hpp
│ ├── macro_map.hpp
│ ├── parse_config.hpp
│ ├── util.hpp
│ ├── result.hpp
│ ├── context.hpp
│ ├── indenter.hpp
│ ├── config.hpp
│ ├── wave_context_workaround.hpp
│ ├── wave_context.hpp
│ ├── shell.hpp
│ ├── macro_definition.hpp
│ ├── preshell.hpp
│ └── preshell_preprocessing_hooks.hpp
└── just
│ ├── console.hpp
│ ├── test.hpp
│ └── process.hpp
├── app
├── interrupt_handler_override.hpp
├── override_guard.hpp
├── CMakeLists.txt
├── main.cpp
├── readline_shell.hpp
├── interrupt_handler_override.cpp
└── readline_shell.cpp
├── tools
├── gcc_builtin_macros
├── gcc_default_path
└── gen_toc
├── cmake
└── Modules
│ └── FindReadline.cmake
└── CMakeLists.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | bin
2 |
--------------------------------------------------------------------------------
/download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sabel83/preshell/master/download.png
--------------------------------------------------------------------------------
/preshell.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sabel83/preshell/master/preshell.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Preshell
2 |
3 | Preshell is no longer maintained. Its functionality has been migrated to
4 | [Metashell](https://github.com/sabel83/metashell). You can find a tutorial for
5 | getting started with Macro debugging in Metashell at
6 | [http://metashell.readthedocs.org/en/latest/manual/getting_started/#testing-macros](http://metashell.readthedocs.org/en/latest/manual/getting_started/#testing-macros)
7 |
8 | The last commit of Preshell is
9 | [here](https://github.com/sabel83/preshell/tree/b659d2b6f709128a4754a47c63476d81e067e378).
10 |
11 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: cpp
2 | compiler:
3 | - gcc
4 | - clang
5 | before_install:
6 | - sudo apt-get install libboost1.48-dev libboost-test1.48-dev libboost-program-options1.48-dev libboost-wave1.48-dev libboost-system1.48-dev libboost-thread1.48-dev libboost-filesystem1.48-dev libreadline-dev
7 | script:
8 | # Test the code
9 | - tools/gcc_builtin_macros > lib/core/default_defines.hpp
10 | - tools/gcc_default_path > lib/core/default_sysinclude.hpp
11 | - mkdir bin
12 | - cd bin
13 | - cmake .. -DCMAKE_CXX_FLAGS:STRING="-Wall -Werror -pedantic"
14 | - make
15 | - make test
16 |
--------------------------------------------------------------------------------
/lib/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Preshell - Interactive C/C++ preprocessor shell
2 | # Copyright (C) 2015, Abel Sinkovics (abel@sinkovics.hu)
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU General Public License as published by
6 | # the Free Software Foundation, either version 3 of the License, or
7 | # (at your option) any later version.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU General Public License
15 | # along with this program. If not, see .
16 |
17 | subdirs(core)
18 |
19 |
--------------------------------------------------------------------------------
/lib/core/default_include.hpp:
--------------------------------------------------------------------------------
1 | // Preshell - Interactive C/C++ preprocessor shell
2 | // Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu)
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
--------------------------------------------------------------------------------
/lib/core/default_sysinclude.hpp:
--------------------------------------------------------------------------------
1 | // Preshell - Interactive C/C++ preprocessor shell
2 | // Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu)
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 |
--------------------------------------------------------------------------------
/lib/core/default_defines.hpp:
--------------------------------------------------------------------------------
1 | // Preshell - Interactive C/C++ preprocessor shell
2 | // Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu)
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | ""
18 |
19 |
--------------------------------------------------------------------------------
/test/main.cpp:
--------------------------------------------------------------------------------
1 | // Preshell - Interactive C/C++ preprocessor shell
2 | // Copyright (C) 2014, Abel Sinkovics (abel@sinkovics.hu)
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | #include
18 |
19 | JUST_TEST_DEFINE_MAIN
20 |
21 |
--------------------------------------------------------------------------------
/lib/core/version_desc.hpp:
--------------------------------------------------------------------------------
1 | // Metashell - Interactive C++ template metaprogramming shell
2 | // Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu)
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | // You can put a message here that appears under the version number
18 | // in the splash message.
19 | ""
20 |
21 |
--------------------------------------------------------------------------------
/lib/core/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Preshell - Interactive C/C++ preprocessor shell
2 | # Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu)
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU General Public License as published by
6 | # the Free Software Foundation, either version 3 of the License, or
7 | # (at your option) any later version.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU General Public License
15 | # along with this program. If not, see .
16 |
17 | aux_source_directory(. SOURCES)
18 | add_library(preshell_core_lib STATIC ${SOURCES})
19 |
20 | # Readline
21 | include_directories(${READLINE_INCLUDE_DIR})
22 |
23 |
--------------------------------------------------------------------------------
/test/test_util.cpp:
--------------------------------------------------------------------------------
1 | // Preshell - Interactive C/C++ preprocessor shell
2 | // Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu)
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // (at your option) any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 |
17 | #include "test_util.hpp"
18 |
19 | #include
20 |
21 | void should_not_be_called(std::string)
22 | {
23 | JUST_ASSERT(false);
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/test/test_util.hpp:
--------------------------------------------------------------------------------
1 | #ifndef PRESHELL_TEST_UTIL_HPP
2 | #define PRESHELL_TEST_UTIL_HPP
3 |
4 | // Preshell - Interactive C/C++ preprocessor shell
5 | // Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu)
6 | //
7 | // This program is free software: you can redistribute it and/or modify
8 | // it under the terms of the GNU General Public License as published by
9 | // the Free Software Foundation, either version 3 of the License, or
10 | // (at your option) any later version.
11 | //
12 | // This program is distributed in the hope that it will be useful,
13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | // GNU General Public License for more details.
16 | //
17 | // You should have received a copy of the GNU General Public License
18 | // along with this program. If not, see .
19 |
20 | #include
21 |
22 | void should_not_be_called(std::string);
23 |
24 | #endif
25 |
26 |
--------------------------------------------------------------------------------
/include/preshell/string.hpp:
--------------------------------------------------------------------------------
1 | #ifndef PRESHELL_STRING_HPP
2 | #define PRESHELL_STRING_HPP
3 |
4 | // Preshell - Interactive C/C++ preprocessor shell
5 | // Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu)
6 | //
7 | // This program is free software: you can redistribute it and/or modify
8 | // it under the terms of the GNU General Public License as published by
9 | // the Free Software Foundation, either version 3 of the License, or
10 | // (at your option) any later version.
11 | //
12 | // This program is distributed in the hope that it will be useful,
13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | // GNU General Public License for more details.
16 | //
17 | // You should have received a copy of the GNU General Public License
18 | // along with this program. If not, see .
19 |
20 | #include
21 |
22 | namespace preshell
23 | {
24 | typedef token::string_type string;
25 | }
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/include/preshell/version.hpp:
--------------------------------------------------------------------------------
1 | #ifndef PRESHELL_VERSION_HPP
2 | #define PRESHELL_VERSION_HPP
3 |
4 | // Preshell - Interactive C/C++ preprocessor shell
5 | // Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu)
6 | //
7 | // This program is free software: you can redistribute it and/or modify
8 | // it under the terms of the GNU General Public License as published by
9 | // the Free Software Foundation, either version 3 of the License, or
10 | // (at your option) any later version.
11 | //
12 | // This program is distributed in the hope that it will be useful,
13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | // GNU General Public License for more details.
16 | //
17 | // You should have received a copy of the GNU General Public License
18 | // along with this program. If not, see .
19 |
20 | #include
21 |
22 | namespace preshell
23 | {
24 | std::string version();
25 |
26 | std::string wave_version();
27 | std::string readline_version();
28 | }
29 |
30 | #endif
31 |
32 |
--------------------------------------------------------------------------------
/include/preshell/file_position.hpp:
--------------------------------------------------------------------------------
1 | #ifndef PRESHELL_FILE_POSTIION_HPP
2 | #define PRESHELL_FILE_POSTIION_HPP
3 |
4 | // Preshell - Interactive C/C++ preprocessor shell
5 | // Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu)
6 | //
7 | // This program is free software: you can redistribute it and/or modify
8 | // it under the terms of the GNU General Public License as published by
9 | // the Free Software Foundation, either version 3 of the License, or
10 | // (at your option) any later version.
11 | //
12 | // This program is distributed in the hope that it will be useful,
13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | // GNU General Public License for more details.
16 | //
17 | // You should have received a copy of the GNU General Public License
18 | // along with this program. If not, see .
19 |
20 | #include
21 |
22 | namespace preshell
23 | {
24 | typedef boost::wave::util::file_position_type file_position;
25 | }
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/include/preshell/if_state.hpp:
--------------------------------------------------------------------------------
1 | #ifndef PRESHELL_IF_STATE_HPP
2 | #define PRESHELL_IF_STATE_HPP
3 |
4 | // Preshell - Interactive C/C++ preprocessor shell
5 | // Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu)
6 | //
7 | // This program is free software: you can redistribute it and/or modify
8 | // it under the terms of the GNU General Public License as published by
9 | // the Free Software Foundation, either version 3 of the License, or
10 | // (at your option) any later version.
11 | //
12 | // This program is distributed in the hope that it will be useful,
13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | // GNU General Public License for more details.
16 | //
17 | // You should have received a copy of the GNU General Public License
18 | // along with this program. If not, see .
19 |
20 | namespace preshell
21 | {
22 | enum if_state
23 | {
24 | if0_then = 0, // 00
25 | if0_else = 1, // 01
26 | if1_then = 2, // 10
27 | if1_else = 3 // 11
28 | };
29 | }
30 |
31 | #endif
32 |
33 |
--------------------------------------------------------------------------------
/include/preshell/token.hpp:
--------------------------------------------------------------------------------
1 | #ifndef PRESHELL_TOKEN_HPP
2 | #define PRESHELL_TOKEN_HPP
3 |
4 | // Preshell - Interactive C/C++ preprocessor shell
5 | // Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu)
6 | //
7 | // This program is free software: you can redistribute it and/or modify
8 | // it under the terms of the GNU General Public License as published by
9 | // the Free Software Foundation, either version 3 of the License, or
10 | // (at your option) any later version.
11 | //
12 | // This program is distributed in the hope that it will be useful,
13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | // GNU General Public License for more details.
16 | //
17 | // You should have received a copy of the GNU General Public License
18 | // along with this program. If not, see .
19 |
20 | #include
21 |
22 | #include
23 |
24 | namespace preshell
25 | {
26 | typedef boost::wave::cpplexer::lex_token token;
27 | }
28 |
29 | #endif
30 |
31 |
--------------------------------------------------------------------------------
/app/interrupt_handler_override.hpp:
--------------------------------------------------------------------------------
1 | #ifndef INTERRUPT_HANDLER_OVERRIDE_HPP
2 | #define INTERRUPT_HANDLER_OVERRIDE_HPP
3 |
4 | // Preshell - Interactive C/C++ preprocessor shell
5 | // Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu)
6 | //
7 | // This program is free software: you can redistribute it and/or modify
8 | // it under the terms of the GNU General Public License as published by
9 | // the Free Software Foundation, either version 3 of the License, or
10 | // (at your option) any later version.
11 | //
12 | // This program is distributed in the hope that it will be useful,
13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | // GNU General Public License for more details.
16 | //
17 | // You should have received a copy of the GNU General Public License
18 | // along with this program. If not, see .
19 |
20 | #include
21 | #include
22 |
23 | class interrupt_handler_override : boost::noncopyable
24 | {
25 | public:
26 | interrupt_handler_override(const boost::function& handler_);
27 | ~interrupt_handler_override();
28 | };
29 |
30 | #endif
31 |
32 |
--------------------------------------------------------------------------------
/include/preshell/macro_map.hpp:
--------------------------------------------------------------------------------
1 | #ifndef PRESHELL_MACRO_MAP_HPP
2 | #define PRESHELL_MACRO_MAP_HPP
3 |
4 | // Preshell - Interactive C/C++ preprocessor shell
5 | // Copyright (C) 2013, Abel Sinkovics (abel@sinkovics.hu)
6 | //
7 | // This program is free software: you can redistribute it and/or modify
8 | // it under the terms of the GNU General Public License as published by
9 | // the Free Software Foundation, either version 3 of the License, or
10 | // (at your option) any later version.
11 | //
12 | // This program is distributed in the hope that it will be useful,
13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | // GNU General Public License for more details.
16 | //
17 | // You should have received a copy of the GNU General Public License
18 | // along with this program. If not, see .
19 |
20 | #include
21 | #include
22 |
23 | #include