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

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


    // containing ValueBase should be returned instead of an empty vector
    if (v.derivedFrom ().size () == 0)
      stream.print (" extends org.omg.CORBA.portable.ValueBase"); // <d60929>
    else
    {
      SymtabEntry parent;
      // list the values the abstract value type inherits
      for (int i = 0; i < v.derivedFrom ().size (); i++)
      {
        if (i == 0)
           stream.print (" extends ");
        else
           stream.print (", ");
        parent = (SymtabEntry) v.derivedFrom ().elementAt (i);
        stream.print (Util.javaName (parent));
      }
    }

    // list the interface the abstract value type supports
    if (v.supports ().size () > 0)
    {
      stream.print (", ");
      SymtabEntry intf = (SymtabEntry) v.supports ().elementAt (0);
      stream.print (Util.javaName (intf));
    }
    stream.println ();
    stream.println ("{");
  }
View Full Code Here


    // Generate all of the contained types
    Enumeration e = entry.contained ().elements ();
    while (e.hasMoreElements ())
    {
      SymtabEntry element = (SymtabEntry)e.nextElement ();
      if (element.emit ())
        element.generate (symbolTable, stream);
    }
  } // generate
View Full Code Here

  {
    // Compare the name to the methods of this interface
    Enumeration methods = entry.methods ().elements ();
    while (methods.hasMoreElements ())
    {
      SymtabEntry method = (SymtabEntry)methods.nextElement ();
      if (name.equals (method.name ()))
        return false;
    }

    // Recursively call unique on each derivedFrom interface
    Enumeration derivedFrom = entry.derivedFrom ().elements ();
View Full Code Here

    int startArray = seqOfName.indexOf ('[');
    String arrayDcl = seqOfName.substring (startArray);
    seqOfName = seqOfName.substring (0, startArray);

    // For interfaces having state, e.g., valuetypes.
    SymtabEntry seqOfEntry = (SymtabEntry)Util.symbolTable.get (seqOfName.replace ('.', '/'));
    if (seqOfEntry != null && seqOfEntry instanceof InterfaceEntry && ((InterfaceEntry)seqOfEntry).state () != null)
      // <f46082.51> Remove -stateful feature; javaStatefulName() obsolete.
      //seqOfName = Util.javaStatefulName ((InterfaceEntry)seqOfEntry);
      seqOfName = Util.javaName ((InterfaceEntry)seqOfEntry);
View Full Code Here

      int startArray = baseName.indexOf ('[');
      String arrayDcl = Util.sansArrayInfo (baseName.substring (startArray)) + "[]"; // Add an extra set because the first gets stripped off in the loop.
      baseName = baseName.substring (0, startArray);

      // For interfaces having state, e.g., valuetypes.
      SymtabEntry baseEntry = (SymtabEntry)Util.symbolTable.get (baseName.replace ('.', '/'));
      if (baseEntry instanceof InterfaceEntry && ((InterfaceEntry)baseEntry).state () != null)
        // <f46082.51> Remove -stateful feature; javaStatefulName() obsolete.
        //baseName = Util.javaStatefulName ((InterfaceEntry)baseEntry);
        baseName = Util.javaName ((InterfaceEntry)baseEntry);

      int end1stArray;
      while (!modifier.equals (""))
      {
        int rbracket = modifier.indexOf (']');
        String size = modifier.substring (1, rbracket);
        end1stArray = arrayDcl.indexOf (']');
        arrayDcl = '[' + size + arrayDcl.substring (end1stArray + 2);
        stream.println (indent + name + " = new " + baseName + arrayDcl + ';');
        loopIndex = "_o" + index++;
        stream.println (indent + "for (int " + loopIndex + " = 0;" + loopIndex + " < (" + size + "); ++" + loopIndex + ')');
        stream.println (indent + '{');
        ++closingBrackets;
        modifier = modifier.substring (rbracket + 1);
        indent = indent + "  ";
        name = name + '[' + loopIndex + ']';
      }
      end1stArray = arrayDcl.indexOf (']');
      if (td.type () instanceof SequenceEntry || td.type () instanceof PrimitiveEntry || td.type () instanceof StringEntry)
        index = ((JavaGenerator)td.type ().generator ()).read (index, indent, name, td.type (), stream);
      else if (td.type () instanceof InterfaceEntry && td.type ().fullName ().equals ("org/omg/CORBA/Object"))
        stream.println (indent + name + " = istream.read_Object ();");
      else
        stream.println (indent + name + " = " + Util.helperName (td.type (), true) + ".read (istream);"); // <d61056>
      for (int i = 0; i < closingBrackets; ++i)
      {
        indent = indent.substring (2);
        stream.println (indent + '}');
      }
    }
    else
    {
      SymtabEntry tdtype = Util.typeOf (td.type ());
      if (tdtype instanceof SequenceEntry || tdtype instanceof PrimitiveEntry || tdtype instanceof StringEntry)
        index = ((JavaGenerator)tdtype.generator ()).read (index, indent, name, tdtype, stream);
      else if (tdtype instanceof InterfaceEntry && tdtype.fullName ().equals ("org/omg/CORBA/Object"))
        stream.println (indent + name + " = istream.read_Object ();");
      else
        stream.println (indent + name + " = " + Util.helperName (tdtype, true) + ".read (istream);"); // <d61056>
    }
    return index;
View Full Code Here

        stream.println (indent + '}');
      }
    }
    else
    {
      SymtabEntry tdtype = Util.typeOf (td.type ());
      if (tdtype instanceof SequenceEntry || tdtype instanceof PrimitiveEntry || tdtype instanceof StringEntry)
        index = ((JavaGenerator)tdtype.generator ()).write (index, indent, name, tdtype, stream);
      else if (tdtype instanceof InterfaceEntry && tdtype.fullName ().equals ("org/omg/CORBA/Object"))
        stream.println (indent + "ostream.write_Object (" + name + ");");
      else
        stream.println (indent + Util.helperName (tdtype, true) + ".write (ostream, " + name + ");"); // <d61056>
    }
    return index;
View Full Code Here

        name = "java.io.Serializable";
    else if (entry instanceof ValueBoxEntry)
    {
      ValueBoxEntry v = (ValueBoxEntry) entry;
      TypedefEntry member = ((InterfaceState) v.state ().elementAt (0)).entry;
      SymtabEntry mType = member.type ();
      if (mType instanceof PrimitiveEntry)
      {
         name = containerFullName (entry.container ());
         if (!name.equals (""))
           name = name + '.';
View Full Code Here

      name = "String";
    else if (entry instanceof ValueEntry && entry.name ().equals ("ValueBase"))
      name = "java.io.Serializable";
    else
    {
      SymtabEntry container = entry.container ();
      if (container != null)
        name = container.name ();
      if (name.equals (""))
        name = entry.name ();
      else
        name = containerFullName (entry.container ()) + '.' + entry.name ();
    }
View Full Code Here

   * Fill the info field with the full name (with array info) of the type.
   **/
  static void fillInfo (SymtabEntry infoEntry)
  {
    String      arrayInfo   = "";
    SymtabEntry entry       = infoEntry;
    boolean     alreadyHave = false;

    do
    {
      try
      {
        alreadyHave = entry.dynamicVariable (Compile.typedefInfo) != null;
      }
      catch (NoSuchFieldException e)
      {}
      // If this entry's info has already been processed
      // don't bother processing it again, just take it.
      if (!alreadyHave)
      {
        if (entry instanceof TypedefEntry)
          arrayInfo = arrayInfo + arrayInfo (((TypedefEntry)entry).arrayInfo ());
        else if (entry instanceof SequenceEntry)
        {
          Expression maxSize = ((SequenceEntry)entry).maxSize ();
          if (maxSize == null)
            arrayInfo = arrayInfo + "[]";
          else
            arrayInfo = arrayInfo + '[' + parseExpression (maxSize) + ']';
        }
        if (entry.type () == null)
        {
          // <d59437> Suppress this message.  It tells the developer nothing, and
          // this path does not cause the algorithm to fail.  Value boxes may
          // contain anonymous types, like a struct or enum.
          //System.err.println (getMessage ("PreEmit.indeterminateTypeInfo", entry.typeName ()));
        }
        else
          entry = entry.type ();
      }
    } while (!alreadyHave && entry != null &&
        (entry instanceof TypedefEntry || entry instanceof SequenceEntry));
    // <d59437> Value boxes may contain types lacking typename info., which
    // causes the 2nd case, below, to fail with exception when retrieving the
    // javaName().
    if (entry instanceof ValueBoxEntry)
      fillValueBoxInfo ((ValueBoxEntry)entry);
    try
    {
      if (alreadyHave)
        infoEntry.dynamicVariable (Compile.typedefInfo, (String)entry.dynamicVariable (Compile.typedefInfo) + arrayInfo);
      else
        infoEntry.dynamicVariable (Compile.typedefInfo, javaName (entry) + arrayInfo);
    }
    catch (NoSuchFieldException e)
    {}
View Full Code Here

    stream.println ("  {");

    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

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.