Class GenerateFieldsVisitor


  • public class GenerateFieldsVisitor
    extends Visitor
    A visitor which generates Java source code of the instruction decoder fields for rules and values. Each rule (which has at least one returning variant) and string-returning variant is given a unique integral constant which can be later used in a disassembler and emulator.
    • Constructor Summary

      Constructors 
      Constructor Description
      GenerateFieldsVisitor​(java.io.Writer writer)
      Constucts the visitor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void visit​(Decoder decoder)
      Writes the constants.
      void visit​(Rule rule)
      Adds the field names for the particular rule to the list.
      void visit​(Variant variant)
      Adds the field to the list and sets the flag if the variant returns something.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GenerateFieldsVisitor

        public GenerateFieldsVisitor​(java.io.Writer writer)
        Constucts the visitor.
        Parameters:
        writer - the output stream to write the code to
    • Method Detail

      • visit

        public void visit​(Variant variant)
        Adds the field to the list and sets the flag if the variant returns something.
        Overrides:
        visit in class Visitor
        Parameters:
        variant - the variant node