Skip to content

v4.3

Choose a tag to compare

@thewizardplusplus thewizardplusplus released this 15 Jun 15:13
· 46 commits to master since this release

Improve error handling in the parser module.

Change Log

  • In the parser module:
    • Fix default values in a constructor of the repetition_parser class.
    • 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.
    • Refactor:
      • concatenation_parser::parse() method;
      • match_parser::parse() method;
      • typing_parser::parse() method.
    • In the tests:
      • Upgrade tests:
        • of the alternation_parser class;
        • of the exception_parser class;
        • of the lookahead_parser class;
        • of the repetition_parser class.
      • Improve tests:
        • of the alternation_parser class;
        • of the concatenation_parser class;
        • of the dummy_parser class;
        • of the exception_parser class;
        • of the lookahead_parser class;
        • of the repetition_parser class;
        • of the typing_parser class.
      • 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 the example:
    • Enrich positional exceptions:
      • mark an unexpected entity:
        • position of it;
        • length of it;
      • add the verbose option:
        • parse it;
        • use it.
    • Extend tests of errors in the example.

Возможности

  • лексинг ASCII-текста:
    • задание лексем посредством регулярных выражений;
    • возможность исключения токенов из результирующего списка;
  • парсинг ASCII-текста:
    • описание грамматики на EBNF непосредственно в коде программы (посредством DSL);
  • результат:
    • представление в виде:
      • CST;
      • AST;
    • задание имени ноды в дереве;
  • парсеры:
    • терминальные:
      • пустота;
      • определённые:
        • текст;
        • лексема;
    • комбинаторы:
      • альтернатива (упорядоченная);
      • объединяющие:
        • следование;
        • повторение:
          • 0 или 1 раз (опциональность);
          • 0 или больше раз;
          • 1 или больше раз;
          • любое число раз в указанном диапазоне;
      • проверяющие:
        • исключение;
        • просмотр вперёд:
          • позитивный;
          • негативный.

Скриншоты

Лексический анализ

Лексический анализ

Синтаксический анализ

Синтаксический анализ