v3.0
·
242 commits
to master
since this release
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 или больше раз;
- исключение;
- просмотр вперёд:
- позитивный;
- негативный;
- парсеры:
- пустота;
- конец текста;
- определённый текст;
- определённая лексема.
Скриншоты
Лексический анализ
Синтаксический анализ

