Class Resolver.ReferenceResolver

All Implemented Interfaces:
Rewriter
Enclosing class:
Resolver

protected class Resolver.ReferenceResolver extends Rewrite
Here all declaration objects, all items and all imported modules are already rewritten. What really has to be re-written are the expressions which make the substitution value in an import-rewrite, plus those which are contained in the field .value of all XRegExp.
Visiting starts with the (externally requested) top-level module and follows the import statements.
  • Field Details

    • currentmodule

      protected Module currentmodule
    • currentitem

      protected ImportItem currentitem
    • currentlocalcontext

      protected String currentlocalcontext
    • inTagsRegExp

      protected boolean inTagsRegExp
  • Constructor Details

    • ReferenceResolver

      protected ReferenceResolver()
  • Method Details

    • action

      public void action(Module mod)
      Overrides:
      action in class Rewrite
    • action

      public void action(ImportItem item)
      Overrides:
      action in class Rewrite
    • action

      public void action(CharsRegExp x)
      Overrides:
      action in class Rewrite
    • action

      public void action(TagsRegExp x)
      Overrides:
      action in class Rewrite
    • checkInsertion

      protected void checkInsertion(Expression exp, String origText, Insertion callingInsertion)
      Called if a substitution goes to a reference or "#none", in case the substituted ref is an argument to a "@" FIXME später raus, "@" wird kompositional in NEUEM Algorithmus!
    • checkDefinitionType

      protected void checkDefinitionType(Definition def, Location<XMLDocumentIdentifier> loc, boolean isInsertion)
    • copyImplicit

      protected Expression copyImplicit(Expression expr0, Reference orig)
      FIXME -- BETTER: realize "#implicit" as an OPERATOR, then no special copy action would be necessary.
    • resolveRefText

      protected Expression resolveRefText(Reference ref, Insertion callingInsertion)
      Resolve the source text of a reference to a declaration and store this in "resolved".
      First look, whether the name of the reference appears in a global or local substitution which comes with the import statement. (These have already been visited and resolved !?!)
      Otherwise, set ".resolved" to an XRegExp/Enumeration (declaration) either in an imported module, or in the same module as the expression is. In case the ref is subjet to INSERTION, than a error is generated iff the rewriting does not go again to a reference. (NB The info about the error cause (i.e. the wrong re-writing) is only known here, NOT on the level of "action(Insertion)"! Therefore the resp. error message generation had to be dislocated to here!)
      Parameters:
      ref - the Reference to resolve
      callingInsertion - the Insertion expression directly containing ref, or null.
    • XXdumpone

      void XXdumpone(Definition x)
    • action

      public void action(Reference ref)
      Overrides:
      action in class Rewrite