reflection library Null safety

This package contains tools to reflect on and transform parsers.

Classes

Analyzer
Helper to reflect on properties of a grammar.
LinterIssue
Encapsulates a single linter issue.
LinterRule
Encapsulates a single linter rule.

Constants

allLinterRules → const List<LinterRule>
All default linter rules to be run.
[UnresolvedSettable(), UnnecessaryResolvable(), RepeatedChoice(), UnreachableChoice(), NullableRepeater(), LeftRecursion(), NestedChoice(), OverlappingChoice(), UnusedResult()]

Functions

allParser(Parser root) Iterable<Parser>
Returns a lazy iterable over all parsers reachable from root using a depth-first traversal over the connected parser graph. [...]
linter(Parser parser, {LinterCallback? callback, List<LinterRule>? rules, Set<String> excludedRules = const {}, Set<LinterType> excludedTypes = const {LinterType.info}}) List<LinterIssue>
Returns a list of linter issues found when analyzing the parser graph reachable from parser. [...]
removeDuplicates<T>(Parser<T> parser) Parser<T>
Returns a copy of parser with all duplicates parsers collapsed.
removeSettables<T>(Parser<T> parser) Parser<T>
Returns a copy of parser with all settable parsers removed.
@Deprecated('Use `resolve(Parser)` instead.')
transformParser<T>(Parser<T> parser, TransformationHandler handler) Parser<T>
Transforms all parsers reachable from parser with the given handler. The identity function returns a copy of the the incoming parser. [...]

Enums

LinterType
The type of a linter issue.

Typedefs

LinterCallback = void Function(LinterIssue issue)
Function signature of a linter callback that is called whenever a linter rule identifies an issue.
TransformationHandler = Parser<T> Function<T>(Parser<T> parser)
A function transforming one parser to another one.