Skip to content

v3.2

Choose a tag to compare

@thewizardplusplus thewizardplusplus released this 13 Mar 00:23
· 166 commits to master since this release

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 lexer module:
        • add utility features for the token class:
          • operators:
            • == operator;
            • stream insertion operator;
          • to_tuple() function;
        • 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;
      • for the parser module:
        • add utility features for the ast_node class:
          • operators:
            • == operator;
            • stream insertion operator;
          • to_tuple() function;
        • add tests for classes:
          • without mocks:
            • empty_parser class;
            • match_parser class;
          • with mocks:
            • alternation_parser class;
            • concatenation_parser class;
            • dummy_parser class;
            • exception_parser class;
            • lookahead_parser class;
            • repetition_parser class;
            • typing_parser class;
    • for the example:
      • add utility features:
        • add the errors test group;
        • rename the io_test() function to test_json_output();
        • add the test_error_output() function;
      • add general test cases for all error types.

Возможности

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

Скриншоты

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

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

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

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