Class Compiler.Phase

All Implemented Interfaces:
PCDataVisitor
Direct Known Subclasses:
Compiler.Phase_gui, Compiler.Phase_parser, Compiler.Phase_usage, Compiler.Phase1
Enclosing class:
Compiler

protected class Compiler.Phase extends Visitor
Base class for compiler phases.

The only visit method visit(Element_option) sets the values of the global visitor registers abbrev, name, etc.
Consequently, here are all methods which incorporate this info, including ERROR(String).
  • Field Details

    • currentOptionElement

      protected Element_option currentOptionElement
      The currently visited Element_option
    • name

      @Opt protected @Opt String name
      The extracted long name of the option under visit, if any.
    • abbrev

      @Opt protected @Opt String abbrev
      The extracted short abbrev of the option under visit, if any.
    • option_qualifier

      public String option_qualifier
      The text fragment for constructing field and method identifiers for the option under visit. (Currently "_"+longestName() ise used.)
  • Constructor Details

    • Phase

      protected Phase()
  • Method Details

    • longestname

      protected String longestname()
      Return the long name, if found, else the abbrev.
    • shortestname

      protected String shortestname()
      Return the abbrev, if found, else the long name.
    • longesttag

      protected String longesttag()
      Return the long name tag (wiht double minus lead in), if found, else the short tag.
    • shortesttag

      protected String shortesttag()
      Return the abbrev tag (with single minus lead in), if found, else the long tag.
    • bothtags_formatted

      protected String bothtags_formatted()
      Return (for the formatted usage() output) both tags separated by "/" in one string, or the only tag, at its correct position in this string format.
    • bothtags

      protected String bothtags()
      Return (as utmost compact string) both tags separated by "/" or the only tag, without formatting. Used in error messages.
    • ERROR

      protected void ERROR(String text)
      Send error to central message receiver Compiler.msgr after adding the name of the current option as the context info of the error.
    • WARNING

      protected void WARNING(String text)
      Send warning to central message receiver Compiler.msgr after adding the name of the current option as the context info of the warning.

      ATTENTION both name==null&&abbrev==null in case of Phase_usage_enumerations
    • visit

      public void visit(Element_option element)
      Set all local fields as representing this option, --- will be called from derived classes for field initialization. Does NOT descend.
      Overrides:
      visit in class Visitor