[all-commits] [llvm/llvm-project] f383b8: [pseudo] Sort nonterminals based on their reductio...

Haojian Wu via All-commits all-commits at lists.llvm.org
Thu Mar 24 06:31:30 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f383b88d8214dc8f2d8bc9521c3ddd1c4454927f
      https://github.com/llvm/llvm-project/commit/f383b88d8214dc8f2d8bc9521c3ddd1c4454927f
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2022-03-24 (Thu, 24 Mar 2022)

  Changed paths:
    M clang-tools-extra/pseudo/include/clang-pseudo/Grammar.h
    M clang-tools-extra/pseudo/lib/GrammarBNF.cpp
    M clang-tools-extra/pseudo/test/lr-build-basic.test
    M clang-tools-extra/pseudo/test/lr-build-conflicts.test
    M clang-tools-extra/pseudo/unittests/GrammarTest.cpp

  Log Message:
  -----------
  [pseudo] Sort nonterminals based on their reduction order.

Reductions need to be performed in a careful order in GLR parser, to
make sure we gather all alternatives before creating an ambigous forest
node.

This patch encodes the nonterminal order into the rule id, so that we
can efficiently to determinal ordering of reductions in GLR parser.

This patch also abstracts to a TestGrammar, which is shared among tests.

This is a part of the GLR parser, https://reviews.llvm.org/D121368,
https://reviews.llvm.org/D121150

Differential Revision: https://reviews.llvm.org/D122303




More information about the All-commits mailing list