Releases: thewizardplusplus/wizard-parser
v4.4
Small refactoring of the general code and significantly reducing and simplifying of the example.
Change Log
- Rename types:
lexer::exception_group:- rename it to
type_group; - update the example;
- rename it to
parser::optional_offset:- rename it to
offset_optional.
- rename it to
- In the
parsermodule:- Add the list parser:
- implement it;
- cover it with tests;
- use it in the example.
- Remove the
empty_parserclass:- remove it;
- remove its tests.
- Unifying header for all parsers:
- implement it;
- use it in the example.
- In the tests:
- Improve tests:
- of the
repetition_parserclass; - of the
parse()function; - of the
parse_all()function.
- of the
- Refactor tests:
- of the
repetition_parserclass; - of the
parse_all()function.
- of the
- Improve tests:
- Add the list parser:
- In the
transformersmodule:- Add the
default_ast_node_handlersconstant:- implement it;
- use it:
- in the
parser::parse()function; - in the
parser::parse_all()function.
- in the
- Add the
transform()function for few handlers:- implement it;
- cover it with tests;
- use it in the
parser::parse()function.
- Add the
- In the example:
- Refactor:
- reduce a list of included headers;
- remove types:
constant_group;function_group;
- lexemes:
- fix a code style;
- built-in functions:
- use the
std::fmod()function for computing a division remainder; - fix a code style;
- fix the explanatory comment;
- use the
evaluate_ast_node()function:- make some functions local for it:
inspect_sequence()function;
- fix a code style;
- make some functions local for it:
main()function:- make some functions local for it:
stop()function;enrich_exception()function;
- fix a code style.
- make some functions local for it:
- Extend tests of errors:
- check unexpected entities:
- constants;
- functions;
- split tests to short and verbose:
- mark existing tests as a short version;
- add a verbose version of tests.
- check unexpected entities:
- Refactor:
Возможности
- лексинг ASCII-текста:
- задание лексем посредством регулярных выражений;
- возможность исключения токенов из результирующего списка;
- парсинг ASCII-текста:
- описание грамматики на EBNF непосредственно в коде программы (посредством DSL);
- результат:
- представление в виде:
- CST;
- AST;
- задание имени ноды в дереве;
- представление в виде:
- парсеры:
- терминальные:
- определённые:
- текст;
- лексема;
- определённые:
- комбинаторы:
- альтернатива (упорядоченная);
- объединяющие:
- следование;
- повторение:
- 0 или 1 раз (опциональность);
- 0 или больше раз;
- 1 или больше раз;
- любое число раз в указанном диапазоне;
- список с разделителем;
- проверяющие:
- исключение;
- просмотр вперёд:
- позитивный;
- негативный.
- терминальные:
Скриншоты
Лексический анализ
Синтаксический анализ
v4.3
Improve error handling in the parser module.
Change Log
- In the
parsermodule:- Fix default values in a constructor of the
repetition_parserclass. - Fix error handling:
- in the
alternation_parser::parse()method; - in the
exception_parser::parse()method; - in the
lookahead_parser::parse()method; - in the
repetition_parser::parse()method.
- in the
- Refactor:
concatenation_parser::parse()method;match_parser::parse()method;typing_parser::parse()method.
- In the tests:
- Upgrade tests:
- of the
alternation_parserclass; - of the
exception_parserclass; - of the
lookahead_parserclass; - of the
repetition_parserclass.
- of the
- Improve tests:
- of the
alternation_parserclass; - of the
concatenation_parserclass; - of the
dummy_parserclass; - of the
exception_parserclass; - of the
lookahead_parserclass; - of the
repetition_parserclass; - of the
typing_parserclass.
- of the
- Complete checking of methods calls:
- in classes:
alternation_parser;concatenation_parser;dummy_parser;exception_parser;lookahead_parser;repetition_parser;typing_parser;
- in functions:
parse_all();parse().
- in classes:
- Upgrade tests:
- Fix default values in a constructor of the
- In the example:
- Enrich positional exceptions:
- mark an unexpected entity:
- position of it;
- length of it;
- add the
verboseoption:- parse it;
- use it.
- mark an unexpected entity:
- Extend tests of errors in the example.
- Enrich positional exceptions:
Возможности
- лексинг ASCII-текста:
- задание лексем посредством регулярных выражений;
- возможность исключения токенов из результирующего списка;
- парсинг ASCII-текста:
- описание грамматики на EBNF непосредственно в коде программы (посредством DSL);
- результат:
- представление в виде:
- CST;
- AST;
- задание имени ноды в дереве;
- представление в виде:
- парсеры:
- терминальные:
- пустота;
- определённые:
- текст;
- лексема;
- комбинаторы:
- альтернатива (упорядоченная);
- объединяющие:
- следование;
- повторение:
- 0 или 1 раз (опциональность);
- 0 или больше раз;
- 1 или больше раз;
- любое число раз в указанном диапазоне;
- проверяющие:
- исключение;
- просмотр вперёд:
- позитивный;
- негативный.
- терминальные:
Скриншоты
Лексический анализ
Синтаксический анализ
v4.2
Restore possibilities for error handling.
Change Log
lexermodule:- Add the
tokenize()function with filters:- implement it;
- cover it with tests;
- use it in the example.
- Add the
tokenize_all()function:- implement it;
- cover it with tests;
- use it in the example.
- Add the
parsermodule:- Add the
parse()function:- implement it;
- cover it with tests;
- use it in the example.
- Add the
parse_all()function:- implement it;
- cover it with tests;
- in the example:
- use it;
- replace the
utilities::integral_infinityconstant to a code size in an exception.
- Add the
exceptionsmodule:- Add it.
- Add the
positional_exceptionclass:- implement it;
- use it in the example.
- Add the
unexpected_entity_exceptionclass:- implement it;
- use it in the example.
Возможности
- лексинг ASCII-текста:
- задание лексем посредством регулярных выражений;
- возможность исключения токенов из результирующего списка;
- парсинг ASCII-текста:
- описание грамматики на EBNF непосредственно в коде программы (посредством DSL);
- результат:
- представление в виде:
- CST;
- AST;
- задание имени ноды в дереве;
- представление в виде:
- парсеры:
- терминальные:
- пустота;
- определённые:
- текст;
- лексема;
- комбинаторы:
- альтернатива (упорядоченная);
- объединяющие:
- следование;
- повторение:
- 0 или 1 раз (опциональность);
- 0 или больше раз;
- 1 или больше раз;
- любое число раз в указанном диапазоне;
- проверяющие:
- исключение;
- просмотр вперёд:
- позитивный;
- негативный.
- терминальные:
Скриншоты
Лексический анализ
Синтаксический анализ
v4.1
Restore possibilities to simplify a CST.
Change Log
- Downgrade a minimal required version of the CMake build tool.
- Improvements:
- Stream insertion operator for the
lexer::token_grouptype:- implement it;
- use it in the example.
- Add the
parser::get_offset()function:- implement it;
- cover it with tests;
- use it in the example.
- Add the
transformersmodule:- add the
transform()function:- implement it;
- cover it with tests;
- use it in the example;
- add the
remove_nothings()function:- implement it;
- cover it with tests;
- use it in the example;
- add the
join_sequences()function:- implement it;
- cover it with tests;
- use it in the example;
- simplify the example.
- add the
- Stream insertion operator for the
- In the example:
- Fix a precision of constants.
- Add the
precisionoption:- parse it;
- use it;
- upgrade tests of evaluation;
- fix parsing of the
expressionparameter.
Возможности
- лексинг ASCII-текста:
- задание лексем посредством регулярных выражений;
- парсинг ASCII-текста:
- описание грамматики на EBNF непосредственно в коде программы (посредством DSL);
- результат:
- представление в виде:
- CST;
- AST;
- задание имени ноды в дереве;
- представление в виде:
- парсеры:
- терминальные:
- пустота;
- определённые:
- текст;
- лексема;
- комбинаторы:
- альтернатива (упорядоченная);
- объединяющие:
- следование;
- повторение:
- 0 или 1 раз (опциональность);
- 0 или больше раз;
- 1 или больше раз;
- любое число раз в указанном диапазоне;
- проверяющие:
- исключение;
- просмотр вперёд:
- позитивный;
- негативный.
- терминальные:
Скриншоты
Лексический анализ
Синтаксический анализ
v4.0
Support evaluation of an expression in the example.
Change Log
- In the example:
- Simplify a grammar:
- simplify:
- implementation;
- description;
- upgrade tests:
- remove useless tests:
- of the
lexermodule; - of the
parsermodule;
- of the
- upgrade rest tests:
- of the
lexermodule; - of the
parsermodule.
- of the
- remove useless tests:
- simplify:
- Simplify a result CST:
- remove nodes with the
nothingtype; - join nodes with the
sequencetype; - fix the
walk_ast_node()function; - upgrade tests of the
parsermodule.
- remove nodes with the
- Add the
targetoption:- fix the options implementation;
- upgrade tests:
- of the
lexermodule; - of the
parsermodule.
- of the
- Evaluate a CST node:
- evaluate:
- numbers;
- constants;
- rest nodes:
- with the
atomtype; - with the
unarytype; - with the
function_calltype; - with the
producttype; - with the
sumtype;
- with the
- add runtime docs:
- add a description:
- of built-in constants;
- of built-in functions;
- add a table of contents.
- add a description:
- evaluate:
- Add tests of evaluation:
- add the
evaluatortest group; - add the
test_text_output()function; - add tests of evaluation:
- of nodes:
- with the
atomtype; - with the
unarytype; - with the
producttype; - with the
sumtype;
- with the
- of expressions in parentheses.
- of nodes:
- add the
- Simplify a grammar:
Возможности
- лексинг ASCII-текста:
- задание лексем посредством регулярных выражений;
- парсинг ASCII-текста:
- описание грамматики на EBNF непосредственно в коде программы (посредством DSL);
- представление результата в виде дерева парсинга:
- задание имени ноды в дереве парсинга;
- парсеры:
- терминальные:
- пустота;
- определённые:
- текст;
- лексема;
- комбинаторы:
- альтернатива (упорядоченная);
- объединяющие:
- следование;
- повторение:
- 0 или 1 раз (опциональность);
- 0 или больше раз;
- 1 или больше раз;
- любое число раз в указанном диапазоне;
- проверяющие:
- исключение;
- просмотр вперёд:
- позитивный;
- негативный.
- терминальные:
Скриншоты
Лексический анализ
Синтаксический анализ
v3.2
Add unit tests.
Change Log
- Improve errors handling in the example tests runner.
- Add tests:
- unit tests:
- in the building configuration:
- describe tests building;
- add a custom target as a workaround for CMake bugs;
- for the
lexermodule:- add utility features for the
tokenclass:- operators:
==operator;- stream insertion operator;
to_tuple()function;
- operators:
- make functions public:
match_lexeme()function;find_matched_token()function;
- add tests for functions:
get_offset()function;match_lexeme()function;find_matched_token()function;tokenize()function;
- add utility features for the
- for the
parsermodule:- add utility features for the
ast_nodeclass:- operators:
==operator;- stream insertion operator;
to_tuple()function;
- operators:
- add tests for classes:
- without mocks:
empty_parserclass;match_parserclass;
- with mocks:
alternation_parserclass;concatenation_parserclass;dummy_parserclass;exception_parserclass;lookahead_parserclass;repetition_parserclass;typing_parserclass;
- without mocks:
- add utility features for the
- in the building configuration:
- for the example:
- add utility features:
- add the
errorstest group; - rename the
io_test()function totest_json_output(); - add the
test_error_output()function;
- add the
- add general test cases for all error types.
- add utility features:
- unit tests:
Возможности
- лексинг ASCII-текста:
- задание лексем посредством регулярных выражений;
- парсинг ASCII-текста:
- описание грамматики на EBNF непосредственно в коде программы (посредством DSL);
- представление результата в виде дерева парсинга:
- задание имени ноды в дереве парсинга;
- парсеры:
- терминальные:
- пустота;
- определённые:
- текст;
- лексема;
- комбинаторы:
- альтернатива (упорядоченная);
- объединяющие:
- следование;
- повторение:
- 0 или 1 раз (опциональность);
- 0 или больше раз;
- 1 или больше раз;
- любое число раз в указанном диапазоне;
- проверяющие:
- исключение;
- просмотр вперёд:
- позитивный;
- негативный.
- терминальные:
Скриншоты
Лексический анализ
Синтаксический анализ
v3.1
Add offsets to nodes, remove lifting, combining and ignoring nodes, remove throwing exceptions, use the ericniebler/range-v3 library.
Change Log
- Fix logic of the
parser::repetition_parser::parse_and_count()method. - Support
--as a separator of options and positional arguments in the example. - Add an offset to a node:
- move the
parser::integral_infinityconstant to theutilitiesmodule; - add:
lexer::get_offset()function;parser::ast_node::offsetfield;
- set a node offset in some parsers:
empty_parserclass;match_parserclass;repetition_parserclass;lookahead_parserclass;
- fix the example:
- replace nodes offsets equal to the
utilities::integral_infinityconstant to a code size; - output offsets:
- in tokens;
- in nodes.
- replace nodes offsets equal to the
- move the
- Remove:
- ignoring
nothingandeoinodes; - combining
sequencenodes:- refactoring:
- of the
parser::concatenation_parser::parse()method; - of the
parser::repetition_parser::parse()method;
- of the
- refactoring:
- lifting:
- remove:
parser::important_assignable_parserclass;parser::lift_parserclass;
- remove:
- exceptions:
- simplify the
lexer::tokenize()function; - remove:
parser::parse()function;parser::eoi_parserclass;exceptionsmodule.
- simplify the
- ignoring
- Refactoring:
- of the
parser::type_assignable_parserclass:- rename it to
typing_parser; - refactoring of the
parse()method; - combine:
assignable_parserandtyping_parserclasses in a single class;typing_parserclass andRULEmacro in a single file;
- rename it to
- use the ericniebler/range-v3 library:
- in the
lexermodule; - in the example.
- in the
- of the
Возможности
- лексинг ASCII-текста:
- задание лексем посредством регулярных выражений;
- парсинг ASCII-текста:
- описание грамматики на EBNF непосредственно в коде программы (посредством DSL);
- представление результата в виде дерева парсинга:
- задание имени ноды в дереве парсинга;
- парсеры:
- терминальные:
- пустота;
- определённые:
- текст;
- лексема;
- комбинаторы:
- альтернатива (упорядоченная);
- объединяющие:
- следование;
- повторение:
- 0 или 1 раз (опциональность);
- 0 или больше раз;
- 1 или больше раз;
- любое число раз в указанном диапазоне;
- проверяющие:
- исключение;
- просмотр вперёд:
- позитивный;
- негативный.
- терминальные:
Скриншоты
Лексический анализ
Синтаксический анализ
v3.0
Revision of errors handling, removing some possibilities and global refactoring.
Change Log
- Processing errors:
- Add the universal exception for an unexpected entity.
- Symplify processing an error:
- with an unexpected symbol;
- with an unexpected token;
- with an unexpected EOI.
- Remove:
- code entities:
- header including all parsers;
- functions:
- function for repeating in a range of times;
- overload of the
parser::parse()function accepting a string;
- operators:
- for repeating an exact number of times;
- for parsing separated lists;
- possibilities:
- ignoring some tokens;
- auto-selection:
- of longest token;
- of longest node;
- serialization to JSON:
- from the
lexermodule; - from the
parsermodule.
- from the
- code entities:
- Refactoring:
- of the
lexermodule:- combine in a single file:
tokenandtoken_grouptypes;
- add new types:
lexeme_grouptype alias;token_spantype alias;
- refactoring:
- of the
find_matched_token()function; - of the
tokenize()function;
- of the
- combine in a single file:
- of the
parsermodule:- simplify a code of parsers;
- combine in a single file:
ast_node_flagandast_nodetypes;parsing_resultandrule_parsertypes;match_typeandmatch_parsertypes;
- add new types:
ast_node_grouptype alias;
- replace:
- magic constants of AST node types to an enumeration;
- custom bitwise operators for the
ast_node_flagenumeration to using the grisumbras/enum-flags library; - mutable instances in parameters to constant references;
- remove:
- some C++ class specifiers;
- usages of move semantics;
- refactoring:
- of the
append_node()function; - of the
repetition_parser::parse()method;
- of the
- of the
utilitiesmodule:- rename it to
exceptions; - replace:
- mutable instances in parameters to constant references;
- remove:
- usages of move semantics;
- rename it to
- of the example:
- combine in a single function:
make_atom_parser()andmake_expression_parser()functions;
- refactoring:
- of the grammar;
- of the
main()function; - of the tests runner.
- combine in a single function:
- of the
Возможности
- лексинг ASCII-текста:
- задание лексем посредством регулярных выражений;
- парсинг ASCII-текста;
- описание грамматики на EBNF непосредственно в коде программы (посредством DSL);
- представление результата в виде AST;
- задание имени ноды в AST;
- комбинаторы:
- следование;
- упорядоченная альтернатива;
- повторение:
- 0 или 1 раз (опциональность);
- 0 или больше раз;
- 1 или больше раз;
- исключение;
- просмотр вперёд:
- позитивный;
- негативный;
- парсеры:
- пустота;
- конец текста;
- определённый текст;
- определённая лексема.
Скриншоты
Лексический анализ
Синтаксический анализ
v2.2
Migrate to the C++17 standard and update dependencies.
Change Log
- Simplify the building configurations
- Migrate to the C++17 standard:
- Specify the standard in the building configurations
- Replace the
optionaltype from the akrzemi1/Optional library to thestd::optionaltype - Replace the
string_spantype from the Microsoft/GSL library to thestd::string_viewtype - Use nested namespaces
- Update dependencies:
- Update the fmtlib/fmt library to
v5.2.1 - Update the Microsoft/GSL library to
v2.0.0 - Update the nlohmann/json library to
v3.4.0 - Update the docopt/docopt.cpp library to
7476f8ecommit
- Update the fmtlib/fmt library to
- Project design:
- Use upper-case names for service files
- Fix the license information
Возможности
- лексинг ASCII-текста:
- задание лексем посредством регулярных выражений;
- возможность исключения токенов из результирующего списка;
- парсинг ASCII-текста;
- описание грамматики на EBNF непосредственно в коде программы (посредством DSL);
- представление результата в виде AST;
- задание имени ноды в AST;
- сериализация AST в JSON;
- комбинаторы:
- следование;
- альтернатива;
- повторение:
- 0 или 1 раз (опциональность);
- конкретное число раз;
- 0 или больше раз;
- 1 или больше раз;
- исключение;
- просмотр вперёд:
- позитивный;
- негативный;
- список с разделителем;
- парсеры:
- пустота;
- конец текста;
- определённый текст;
- определённая лексема.
Скриншоты
Лексический анализ
Синтаксический анализ
v2.1
Рефакторинг, добавление новых парсеров и комбинаторов и покрытие примера тестами.
Изменения
- Убрать ненужную универсальность из парсера флагов #23
- Вынести общую функциональность из парсеров с присваиванием #22
- Добавить парсер пустоты #21
- Добавить комбинатор списка с разделителем #20
- Заменить комбинатор опциональности на комбинатор повторений #19
- Добавить поддержку негативного просмотра вперёд в комбинатор просмотра вперёд #18
- Переименовать комбинатор сокрытия ноды в комбинатор просмотра вперёд #17
- Объединить парсеры определённого текста и определённой лексемы #16
- Добавить поддержку указания лимитов в комбинаторе повторений #15
- Заменить иерархию парсеров на её листья #14
- Заменить итераторы токенов на тип
spanиз библиотеки Microsoft/GSL #13 - Заменить класс
lexer::tokenizerна набор функций #12 - Заменить строковые итераторы на тип
string_spanиз библиотеки Microsoft/GSL #11 - Добавить тесты из Wizard Steps (на основе Bats) для примера #10
- Добавить поддержку чтения выражения из
stdinв пример #9 - Добавить опцию
-t/--tokensдля вывода списка токенов в пример #8 - Использовать библиотеку docopt/docopt.cpp для парсинга опций в примере #7
- Использовать библиотеку fmtlib/fmt для форматирования строк #6
- Заменить флаг
parser::parsing_result::is_parsedна типoptionalиз библиотеки akrzemi1/Optional #5 - Заменить тип
std::pair<T, bool>на типoptionalиз библиотеки akrzemi1/Optional #4 - Удалить функцию
utilities::contains()#3 - Использовать библиотеку nlohmann/json для сериализации #2
- Реализовать функцию
to_string()в пару к каждой функцииoperator<<()#1
Возможности
- лексинг ASCII-текста:
- задание лексем посредством регулярных выражений;
- возможность исключения токенов из результирующего списка;
- парсинг ASCII-текста;
- описание грамматики на EBNF непосредственно в коде программы (посредством DSL);
- представление результата в виде AST;
- задание имени ноды в AST;
- сериализация AST в JSON;
- комбинаторы:
- следование;
- альтернатива;
- повторение:
- 0 или 1 раз (опциональность);
- конкретное число раз;
- 0 или больше раз;
- 1 или больше раз;
- исключение;
- просмотр вперёд:
- позитивный;
- негативный;
- список с разделителем;
- парсеры:
- пустота;
- конец текста;
- определённый текст;
- определённая лексема.
Скриншоты
Лексический анализ
Синтаксический анализ



















