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

