ruleInfo

Returns for all grammar rules:

- the recursion type (no recursion, direct or indirect recursion). - the left-recursion type (no left-recursion, direct left-recursion, hidden, or indirect) - the null-match for a grammar's rules: whether the rule can succeed while consuming nothing. - the possibility of an infinite loop (if 'e' can null-match, then 'e*' can enter an infinite loop).

This kind of potential problem can be detected statically and should be transmitted to the grammar designer.

  1. RuleInfo[string] ruleInfo(ParseTree p)
    pure
    RuleInfo[string]
    ruleInfo
    (
    ParseTree p
    )
  2. RuleInfo[string] ruleInfo(string grammar)

Meta