Visitor to resolve grammar module dependencies.
Note that this visitor
TextTester marks text-only
productions as such. It also
LeftRecurser detects left
recursions and marks direct left recursions. Furthermore, it sets
a grammar's
Properties.GENERIC and
Properties.RECURSIVE properties as appropriate.
author: Robert Grimm version: $Revision: 1.124 $
Apply the specified alternative addition to the specified full
production.
Parameters: p1 - The alternative addition. Parameters: p2 - The full production.
Apply the specified alternative removal to the specified full
production.
Parameters: p1 - The alternative removal. Parameters: p2 - The full production.
Apply the specified production override to the specified full
production.
Parameters: p1 - The production override. Parameters: p2 - The full production.
Apply any module modifications. This method applies all module
modifications appearing in the specified grammar. It also
removes unused modules from the grammar. This method assumes
that all module dependencies have been successfully resolved,
i.e., the specified grammar contains all module dependencies.
This method also assumes that each module modification's
Module.modification modification field has been correctly
initialized.
Parameters: g - The grammar.
Perform basic checking for the specified grammar. This method
does all correctness checking besides checking the contents of
partial productions and checking for left-recursive definitions.
Note that this method initializes the analyzer with the specified
grammar.
Parameters: g - The grammar. The list of global attributes, if any.
Check repetitions for elements that accept the empty input. This
method assumes that all module modifications have been applied.
Parameters: g - The grammar.
Combine the modules in the specified grammar. This method
combines the modules in the grammar by modifying the grammar's
top-level module and then returns that module.
Parameters: g - The grammar. Parameters: attributes - The list of global attributes. The grammar as a single module.
Load the module with the specified name.
Parameters: name - The name. The corresponding grammar module. throws: IllegalArgmentException - Signals that the file is too large. throws: FileNotFoundException - Signals that the file does not exist. throws: IOException - Signals an exceptional condition while accessing the file. throws: ParseException - Signals a parse error.
Load all dependent modules. This method loads the transitive
closure of all dependent modules for the specified top-level
module and returns the closure as a list, with the specified
module being the first list element. It checks that the
specified top-level module is not parameterized, that the
parameters of parameterized modules are well-formed, that
arguments match parameters when instantiating parameterized
modules, that different instantiations are consistent with each
other, that a module does not have more than one modifies clause,
and that module modifications do not result in circular
dependencies. This method also reports any file access and
parsing errors. Finally, this method fills in the auxiliary
modification field for all loaded modules.
Parameters: m - The module. The corresponding grammar or null in thecase of errors.
Rename the specified module. This method renames all module
names in the specified module, including the module's
Module.name name , the module's
Module.dependenciesdependencies , and each production's
Production.qNamequalified name (if it is not null).
Parameters: module - The module. Parameters: renaming - The renaming.