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

