Package com.sun.tools.corba.se.idl

Examples of com.sun.tools.corba.se.idl.SymtabEntry


   * Determine the import lines for template types.
   **/
  static private void checkForBounds (SymtabEntry entry, Vector importTypes, Vector importList)
  {
    // Obtain actual type, just to be complete.
    SymtabEntry entryType = entry;
    while (entryType instanceof TypedefEntry)
      entryType = entryType.type ();

    if (entryType instanceof StringEntry && ((StringEntry)entryType).maxSize () != null)
      checkForGlobalConstants (((StringEntry)entryType).maxSize ().rep (), importTypes, importList);
    else
      if (entryType instanceof SequenceEntry && ((SequenceEntry)entryType).maxSize () != null)
View Full Code Here


      // When token contains '/', it represents the division symbol or
      // a nested type (e.g., I/x). Ignore the division symbol, and don't
      // forget constants declared within global interfaces!
      if (!token.equals ("/"))
      {
        SymtabEntry typeEntry = (SymtabEntry)symbolTable.get (token);
        if (typeEntry instanceof ConstEntry)
        {
          int slashIdx = token.indexOf ('/');
          if (slashIdx < 0// Possible global constant
          {
            if (importTypes.contains (typeEntry))
              addTo (importList, typeEntry.name ());
          }
          else  // Possible constant in global interface
          {
            SymtabEntry constContainer = (SymtabEntry)symbolTable.get (token.substring (0, slashIdx));
            if (constContainer instanceof InterfaceEntry && importTypes.contains (constContainer))
              addTo (importList, constContainer.name ());
          }
        }
      }
    }
  } // checkForGlobalConstants
View Full Code Here

      // long, long long, unsigned short, unsigned long, unsigned long long)
      // could be aliased (typedef'ed) to any arbitrary levels, the code
      // below walks up the alias chain to get to the primitive type.

      // Get the symbol table entry corresponding to the 'type'.
      SymtabEntry typeEntry = (SymtabEntry) symbolTable.get(e.type());

      // Get to the primitive type.
      while (typeEntry.type() != null) {
          typeEntry = typeEntry.type();
      }
      String type = typeEntry.name();

      if (type.equals("unsigned long long") &&
          ((BigInteger)e.value ()).compareTo (Expression.llMax) > 0) // value > long long Max?
      {
        // Convert to signed value, which will always be negative.
View Full Code Here

  {
    this.symbolTable = symbolTable;
    this.v = v;

    TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry;
    SymtabEntry mType = member.type ();
    // if it's primitive type, generate a java class
    if (mType instanceof PrimitiveEntry)
    {
      openStream ();
      if (stream == null)
        return;
      writeHeading ();
      writeBody ();
      writeClosing ();
      closeStream ();
    }
    else
    {
      // If a constructed type is nested in the value box,
      // value v struct s {...};
      // the bindings for the nested type must be handled here
      Enumeration e = v.contained ().elements ();
      while (e.hasMoreElements ())
      {
        SymtabEntry contained = (SymtabEntry) e.nextElement ();

        // in case of value box w/ nested enum, ex: value v enum e {e0, e1,...};
        // the SymtabEntry for the enum and labels are contained in the vector.
        // Must check the type to ignore the SymtabEntry for labels.
        if (contained.type () != null)
          contained.type ().generate (symbolTable, stream);
      }
    }
    generateHelper ();
    generateHolder ();
  } // generate
View Full Code Here

   *
   **/
  protected void writeBody ()
  {
    InterfaceState member = (InterfaceState) v.state ().elementAt (0);
    SymtabEntry entry = (SymtabEntry) member.entry;
    Util.fillInfo (entry);
    if (entry.comment () != null)
      entry.comment ().generate (" ", stream);
    stream.println ("  public " +  Util.javaName (entry) + " value;");
    stream.println ("  public " +  v.name () + " (" + Util.javaName (entry) + " initial)");
    stream.println ("  {");
    stream.println ("    value = initial;");
    stream.println ("  }");
View Full Code Here

  public int helperType (int index, String indent, TCOffsets tcoffsets, String name, SymtabEntry entry, PrintWriter stream)
  {
    ValueEntry vt = (ValueEntry) entry;
    TypedefEntry member = (TypedefEntry) ((InterfaceState) (vt.state ()).elementAt (0)).entry;
    SymtabEntry mType = Util.typeOf (member);
    index = ((JavaGenerator)mType.generator ()).type (index, indent, tcoffsets, name, mType, stream);
    stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_value_box_tc ("
      + "_id, "
      + '"' + entry.name () + "\", "
      + name
      + ");");
View Full Code Here

    // end of <d59418> changes

    String indent = "    ";
    Vector vMembers = ((ValueBoxEntry) entry).state ();
    TypedefEntry member = ((InterfaceState) vMembers.elementAt (0)).entry;
    SymtabEntry mType = member.type ();
    if (mType instanceof PrimitiveEntry ||
        mType instanceof SequenceEntry ||
        mType instanceof TypedefEntry ||
        mType instanceof StringEntry ||
        !member.arrayInfo ().isEmpty ()) {
View Full Code Here

  public int write (int index, String indent, String name, SymtabEntry entry, PrintWriter stream)
  {
    Vector vMembers = ( (ValueEntry) entry ).state ();
    TypedefEntry member = ((InterfaceState) vMembers.elementAt (0)).entry;
    SymtabEntry mType = member.type ();

    if (mType instanceof PrimitiveEntry || !member.arrayInfo ().isEmpty ())
      index = ((JavaGenerator)member.generator ()).write (index, indent, name + ".value", member, stream);
    else if (mType instanceof SequenceEntry || mType instanceof StringEntry || mType instanceof TypedefEntry || !member.arrayInfo ().isEmpty ())
      index = ((JavaGenerator)member.generator ()).write (index, indent, name, member, stream);
View Full Code Here

  protected void streamableRead (String entryName, SymtabEntry entry, PrintWriter stream)
  {
    Vector vMembers = ( (ValueBoxEntry) entry ).state ();
    TypedefEntry member = ((InterfaceState) vMembers.elementAt (0)).entry;
    SymtabEntry mType = member.type ();
    if (mType instanceof PrimitiveEntry || mType instanceof SequenceEntry || mType instanceof TypedefEntry ||
        mType instanceof StringEntry || !member.arrayInfo ().isEmpty ())
    {
      SymtabEntry mEntry = (SymtabEntry) ((InterfaceState) vMembers.elementAt (0)).entry;
      ((JavaGenerator)member.generator ()).read (0, "    ", entryName + ".value", member, stream);
    }
    else if (mType instanceof ValueEntry || mType instanceof ValueBoxEntry)
      stream.println ("    " + entryName + ".value = (" + Util.javaQualifiedName (mType) + ") ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value (" + Util.helperName(mType, true) + ".get_instance ());"); // <d60929> // <d61056>
    else
View Full Code Here

    this.m           = m;
    this.stream      = stream;
    if (m.comment () != null)
      m.comment ().generate ("", stream);
    stream.print ("  ");
    SymtabEntry container = (SymtabEntry)m.container ();
    boolean isAbstract = false;
    boolean valueContainer = false;
    if (container instanceof ValueEntry)
    {
      isAbstract = ((ValueEntry)container).isAbstract ();
View Full Code Here

TOP

Related Classes of com.sun.tools.corba.se.idl.SymtabEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.