Class ConstGen

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected ConstEntry c  
      protected java.io.PrintWriter stream  
      protected java.util.Hashtable symbolTable  
    • Constructor Summary

      Constructors 
      Constructor Description
      ConstGen()
      Public zero-argument constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void closeStream()
      Close the print stream, causing the file to be written.
      void generate​(java.util.Hashtable symbolTable, ConstEntry c, java.io.PrintWriter s)
      Generate Java code for an IDL constant.
      protected void generateConst()
      Generate the class defining the constant.
      protected void init()
      Initialize members unique to this generator.
      protected void openStream()
      Open a new print stream only if the constant is not a member of an interface.
      protected void writeBody()
      Write the constant expression and any comment, if present.
      protected void writeClosing()
      Generate any last words and close the class.
      protected void writeConstExpr()
      Write the entire constant expression and any comment, if present.
      private void writeConstValue​(SymtabEntry type)
      Write the constant's value according to its type.
      protected void writeHeading()
      Write the heading for the class defining the constant.
      • Methods inherited from class java.lang.Object

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

      • symbolTable

        protected java.util.Hashtable symbolTable
      • stream

        protected java.io.PrintWriter stream
    • Constructor Detail

      • ConstGen

        public ConstGen()
        Public zero-argument constructor.
    • Method Detail

      • generate

        public void generate​(java.util.Hashtable symbolTable,
                             ConstEntry c,
                             java.io.PrintWriter s)
        Generate Java code for an IDL constant. A constant is written to a new class only when it is not a member of an interface; otherwise it written to the interface class in which it resides.
        Specified by:
        generate in interface ConstGen
      • init

        protected void init()
        Initialize members unique to this generator.
      • generateConst

        protected void generateConst()
        Generate the class defining the constant.
      • openStream

        protected void openStream()
        Open a new print stream only if the constant is not a member of an interface.
      • writeHeading

        protected void writeHeading()
        Write the heading for the class defining the constant.
      • writeBody

        protected void writeBody()
        Write the constant expression and any comment, if present.
      • writeConstExpr

        protected void writeConstExpr()
        Write the entire constant expression and any comment, if present.
      • writeConstValue

        private void writeConstValue​(SymtabEntry type)
        Write the constant's value according to its type.
      • writeClosing

        protected void writeClosing()
        Generate any last words and close the class.
      • closeStream

        protected void closeStream()
        Close the print stream, causing the file to be written.