Class Compiler.Phase_parser

All Implemented Interfaces:
PCDataVisitor
Enclosing class:
Compiler

protected class Compiler.Phase_parser extends Compiler.Phase
Create a parsing method for each option, and two "switch" methods calling these, one for short and one for long names.
  • Field Details

    • tl_meth_parse_a

      GeneratedMethod tl_meth_parse_a
      Accumulator for the switch-code for a detected abbrev.
    • tl_meth_parse_n

      GeneratedMethod tl_meth_parse_n
      Accumulator for the switch-code for a detected long name.
    • parse_meth

      GeneratedMethod parse_meth
      Accumulator for method to parse the option under visit.
    • block_parse

      List<Format> block_parse
      Accumulator for the statemens in an "if" expression, called on the first appearance of this option on command line. Also used for the compilation of a "repeting group".
    • argindex

      int argindex
      Running number to generate the name of the field in which to store the value.
  • Constructor Details

    • Phase_parser

      protected Phase_parser()
  • Method Details

    • translate

      public void translate(Element_optionlist olist)
      Entry method, reset registers and descend.
    • visit

      public void visit(Element_option element)
      Create a parsing method for the option under visitation.
      Overrides:
      visit in class Compiler.Phase
    • makeparsercall

      protected void makeparsercall(String fun)
      Compile one parse-call statement for one argument type to the global result array. This will be added to the code when the list of types has been visited.
    • visit

      public void visit(Element_int el)
      Add to the growing code the call to a parser for an argument of integer type.
      Overrides:
      visit in class Visitor
    • visit

      public void visit(Element_float el)
      Add to the growing code the call to a parser for an argument of float type.
      Overrides:
      visit in class Visitor
    • visit

      public void visit(Element_rat el)
      Add to the growing code the call to a parser for an argument of Rational type.
      Overrides:
      visit in class Visitor
    • makeNoArgSwitch

      public void makeNoArgSwitch()
      Add to the growing code the call to a parser for an option with no argument, = of "switch" or "flag" type.
    • visit

      public void visit(Element_bool el)
      Add to the growing code the call to a parser for an argument of boolean type.
      Overrides:
      visit in class Visitor
    • visit

      public void visit(Element_string el)
      Add to the growing code the call to a parser for an argument of string type.
      Overrides:
      visit in class Visitor
    • visit

      public void visit(Element_uri el)
      Add to the growing code the call to a parser for an argument of uri/file name type.
      Overrides:
      visit in class Visitor
    • visit

      public void visit(Element_enum el)
      Add to the growing code the call to a parser for an argument of an enumeration type.
      Overrides:
      visit in class Visitor
    • visit

      public void visit(Element_enumset el)
      Add to the growing code the call to a parser for an argument of enum set type.
      Overrides:
      visit in class Visitor
    • visit

      public void visit(Element_rep el)
      Add to the growing code the call to the parser of the repeting group.
      Overrides:
      visit in class Visitor