• Returns all rules that can be reached from the topmost rules of the specified grammar (entry and hidden terminal rules).

    Parameters

    • grammar: Grammar

      The grammar that contains all rules

    • allTerminals: boolean

      Whether or not to include terminals that are referenced only by other terminals

    Returns Set<GrammarAST.AbstractRule>

    A list of referenced parser and terminal rules. If the grammar contains no entry rule, this function returns all rules of the specified grammar.