com.sun.tools.corba.se.idl.UnionEntry Java Examples

The following examples show how to use com.sun.tools.corba.se.idl.UnionEntry. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UnionGen.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
public void generate (Hashtable symbolTable, UnionEntry u, PrintWriter s)
{
  this.symbolTable = symbolTable;
  this.u           = u;
  init ();

  openStream ();
  if (stream == null)
    return;
  generateHelper ();
  generateHolder ();
  writeHeading ();
  writeBody ();
  writeClosing ();
  closeStream ();
  generateContainedTypes ();
}
 
Example #2
Source File: UnionGen.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public int read (int index, String indent, String name,
    SymtabEntry entry, PrintWriter stream)
{
    UnionEntry u = (UnionEntry)entry;
    String disName = "_dis" + index++;
    SymtabEntry utype = Util.typeOf (u.type ());
    Util.writeInitializer (indent, disName, "", utype, stream);

    if (utype instanceof PrimitiveEntry)
        index = ((JavaGenerator)utype.generator ()).read (index, indent, disName, utype, stream);
    else
        stream.println (indent + disName + " = " + Util.helperName (utype, true) + ".read (istream);");

    if (utype.name ().equals ("boolean"))
        index = readBoolean (disName, index, indent, name, u, stream);
    else
        index = readNonBoolean (disName, index, indent, name, u, stream);

    return index;
}
 
Example #3
Source File: Util.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private static String doContainerFullName (SymtabEntry container)
{
  String name = "";

  if (container == null)
    name = "";
  else
  {
    if (container instanceof InterfaceEntry ||
        container instanceof StructEntry ||
        container instanceof UnionEntry)
      name = container.name () + "Package";
    else
      name = container.name ();

    if (container.container () != null &&
      !container.container ().name ().equals (""))
      name = doContainerFullName (container.container ()) + '/' + name;
  }

  return name;
}
 
Example #4
Source File: UnionGen.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/

// Computes the total number of labels in the union, which is the sum
// of the number of labels in each branch of the union.  Note that the
// label for the default branch has size 0, but still counts in the total
// size.
private int unionLabelSize( UnionEntry un )
{
  int size = 0 ;
  Vector branches = un.branches() ;
  for (int i = 0; i < branches.size (); ++i) {
      UnionBranch branch = (UnionBranch)(branches.get(i)) ;
      int branchSize = branch.labels.size() ;
      size += ((branchSize == 0) ? 1 : branchSize) ;
  }
  return size ;
}
 
Example #5
Source File: UnionGen.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public int read (int index, String indent, String name,
    SymtabEntry entry, PrintWriter stream)
{
    UnionEntry u = (UnionEntry)entry;
    String disName = "_dis" + index++;
    SymtabEntry utype = Util.typeOf (u.type ());
    Util.writeInitializer (indent, disName, "", utype, stream);

    if (utype instanceof PrimitiveEntry)
        index = ((JavaGenerator)utype.generator ()).read (index, indent, disName, utype, stream);
    else
        stream.println (indent + disName + " = " + Util.helperName (utype, true) + ".read (istream);");

    if (utype.name ().equals ("boolean"))
        index = readBoolean (disName, index, indent, name, u, stream);
    else
        index = readNonBoolean (disName, index, indent, name, u, stream);

    return index;
}
 
Example #6
Source File: Util.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private static String doContainerFullName (SymtabEntry container)
{
  String name = "";

  if (container == null)
    name = "";
  else
  {
    if (container instanceof InterfaceEntry ||
        container instanceof StructEntry ||
        container instanceof UnionEntry)
      name = container.name () + "Package";
    else
      name = container.name ();

    if (container.container () != null &&
      !container.container ().name ().equals (""))
      name = doContainerFullName (container.container ()) + '/' + name;
  }

  return name;
}
 
Example #7
Source File: UnionGen.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public int read (int index, String indent, String name,
    SymtabEntry entry, PrintWriter stream)
{
    UnionEntry u = (UnionEntry)entry;
    String disName = "_dis" + index++;
    SymtabEntry utype = Util.typeOf (u.type ());
    Util.writeInitializer (indent, disName, "", utype, stream);

    if (utype instanceof PrimitiveEntry)
        index = ((JavaGenerator)utype.generator ()).read (index, indent, disName, utype, stream);
    else
        stream.println (indent + disName + " = " + Util.helperName (utype, true) + ".read (istream);");

    if (utype.name ().equals ("boolean"))
        index = readBoolean (disName, index, indent, name, u, stream);
    else
        index = readNonBoolean (disName, index, indent, name, u, stream);

    return index;
}
 
Example #8
Source File: UnionGen.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/

// Computes the total number of labels in the union, which is the sum
// of the number of labels in each branch of the union.  Note that the
// label for the default branch has size 0, but still counts in the total
// size.
private int unionLabelSize( UnionEntry un )
{
  int size = 0 ;
  Vector branches = un.branches() ;
  for (int i = 0; i < branches.size (); ++i) {
      UnionBranch branch = (UnionBranch)(branches.get(i)) ;
      int branchSize = branch.labels.size() ;
      size += ((branchSize == 0) ? 1 : branchSize) ;
  }
  return size ;
}
 
Example #9
Source File: UnionGen.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
public void generate (Hashtable symbolTable, UnionEntry u, PrintWriter s)
{
  this.symbolTable = symbolTable;
  this.u           = u;
  init ();

  openStream ();
  if (stream == null)
    return;
  generateHelper ();
  generateHolder ();
  writeHeading ();
  writeBody ();
  writeClosing ();
  closeStream ();
  generateContainedTypes ();
}
 
Example #10
Source File: Util.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private static String doContainerFullName (SymtabEntry container)
{
  String name = "";

  if (container == null)
    name = "";
  else
  {
    if (container instanceof InterfaceEntry ||
        container instanceof StructEntry ||
        container instanceof UnionEntry)
      name = container.name () + "Package";
    else
      name = container.name ();

    if (container.container () != null &&
      !container.container ().name ().equals (""))
      name = doContainerFullName (container.container ()) + '/' + name;
  }

  return name;
}
 
Example #11
Source File: Util.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private static String doContainerFullName (SymtabEntry container)
{
  String name = "";

  if (container == null)
    name = "";
  else
  {
    if (container instanceof InterfaceEntry ||
        container instanceof StructEntry ||
        container instanceof UnionEntry)
      name = container.name () + "Package";
    else
      name = container.name ();

    if (container.container () != null &&
      !container.container ().name ().equals (""))
      name = doContainerFullName (container.container ()) + '/' + name;
  }

  return name;
}
 
Example #12
Source File: UnionGen.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
public void generate (Hashtable symbolTable, UnionEntry u, PrintWriter s)
{
  this.symbolTable = symbolTable;
  this.u           = u;
  init ();

  openStream ();
  if (stream == null)
    return;
  generateHelper ();
  generateHolder ();
  writeHeading ();
  writeBody ();
  writeClosing ();
  closeStream ();
  generateContainedTypes ();
}
 
Example #13
Source File: UnionGen.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/

// Computes the total number of labels in the union, which is the sum
// of the number of labels in each branch of the union.  Note that the
// label for the default branch has size 0, but still counts in the total
// size.
private int unionLabelSize( UnionEntry un )
{
  int size = 0 ;
  Vector branches = un.branches() ;
  for (int i = 0; i < branches.size (); ++i) {
      UnionBranch branch = (UnionBranch)(branches.get(i)) ;
      int branchSize = branch.labels.size() ;
      size += ((branchSize == 0) ? 1 : branchSize) ;
  }
  return size ;
}
 
Example #14
Source File: UnionGen.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public int read (int index, String indent, String name,
    SymtabEntry entry, PrintWriter stream)
{
    UnionEntry u = (UnionEntry)entry;
    String disName = "_dis" + index++;
    SymtabEntry utype = Util.typeOf (u.type ());
    Util.writeInitializer (indent, disName, "", utype, stream);

    if (utype instanceof PrimitiveEntry)
        index = ((JavaGenerator)utype.generator ()).read (index, indent, disName, utype, stream);
    else
        stream.println (indent + disName + " = " + Util.helperName (utype, true) + ".read (istream);");

    if (utype.name ().equals ("boolean"))
        index = readBoolean (disName, index, indent, name, u, stream);
    else
        index = readNonBoolean (disName, index, indent, name, u, stream);

    return index;
}
 
Example #15
Source File: Util.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private static String doContainerFullName (SymtabEntry container)
{
  String name = "";

  if (container == null)
    name = "";
  else
  {
    if (container instanceof InterfaceEntry ||
        container instanceof StructEntry ||
        container instanceof UnionEntry)
      name = container.name () + "Package";
    else
      name = container.name ();

    if (container.container () != null &&
      !container.container ().name ().equals (""))
      name = doContainerFullName (container.container ()) + '/' + name;
  }

  return name;
}
 
Example #16
Source File: UnionGen.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
public void generate (Hashtable symbolTable, UnionEntry u, PrintWriter s)
{
  this.symbolTable = symbolTable;
  this.u           = u;
  init ();

  openStream ();
  if (stream == null)
    return;
  generateHelper ();
  generateHolder ();
  writeHeading ();
  writeBody ();
  writeClosing ();
  closeStream ();
  generateContainedTypes ();
}
 
Example #17
Source File: UnionGen.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/

// Computes the total number of labels in the union, which is the sum
// of the number of labels in each branch of the union.  Note that the
// label for the default branch has size 0, but still counts in the total
// size.
private int unionLabelSize( UnionEntry un )
{
  int size = 0 ;
  Vector branches = un.branches() ;
  for (int i = 0; i < branches.size (); ++i) {
      UnionBranch branch = (UnionBranch)(branches.get(i)) ;
      int branchSize = branch.labels.size() ;
      size += ((branchSize == 0) ? 1 : branchSize) ;
  }
  return size ;
}
 
Example #18
Source File: UnionGen.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public int read (int index, String indent, String name,
    SymtabEntry entry, PrintWriter stream)
{
    UnionEntry u = (UnionEntry)entry;
    String disName = "_dis" + index++;
    SymtabEntry utype = Util.typeOf (u.type ());
    Util.writeInitializer (indent, disName, "", utype, stream);

    if (utype instanceof PrimitiveEntry)
        index = ((JavaGenerator)utype.generator ()).read (index, indent, disName, utype, stream);
    else
        stream.println (indent + disName + " = " + Util.helperName (utype, true) + ".read (istream);");

    if (utype.name ().equals ("boolean"))
        index = readBoolean (disName, index, indent, name, u, stream);
    else
        index = readNonBoolean (disName, index, indent, name, u, stream);

    return index;
}
 
Example #19
Source File: Util.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private static String doContainerFullName (SymtabEntry container)
{
  String name = "";

  if (container == null)
    name = "";
  else
  {
    if (container instanceof InterfaceEntry ||
        container instanceof StructEntry ||
        container instanceof UnionEntry)
      name = container.name () + "Package";
    else
      name = container.name ();

    if (container.container () != null &&
      !container.container ().name ().equals (""))
      name = doContainerFullName (container.container ()) + '/' + name;
  }

  return name;
}
 
Example #20
Source File: UnionGen.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
public void generate (Hashtable symbolTable, UnionEntry u, PrintWriter s)
{
  this.symbolTable = symbolTable;
  this.u           = u;
  init ();

  openStream ();
  if (stream == null)
    return;
  generateHelper ();
  generateHolder ();
  writeHeading ();
  writeBody ();
  writeClosing ();
  closeStream ();
  generateContainedTypes ();
}
 
Example #21
Source File: UnionGen.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/

// Computes the total number of labels in the union, which is the sum
// of the number of labels in each branch of the union.  Note that the
// label for the default branch has size 0, but still counts in the total
// size.
private int unionLabelSize( UnionEntry un )
{
  int size = 0 ;
  Vector branches = un.branches() ;
  for (int i = 0; i < branches.size (); ++i) {
      UnionBranch branch = (UnionBranch)(branches.get(i)) ;
      int branchSize = branch.labels.size() ;
      size += ((branchSize == 0) ? 1 : branchSize) ;
  }
  return size ;
}
 
Example #22
Source File: UnionGen.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public int read (int index, String indent, String name,
    SymtabEntry entry, PrintWriter stream)
{
    UnionEntry u = (UnionEntry)entry;
    String disName = "_dis" + index++;
    SymtabEntry utype = Util.typeOf (u.type ());
    Util.writeInitializer (indent, disName, "", utype, stream);

    if (utype instanceof PrimitiveEntry)
        index = ((JavaGenerator)utype.generator ()).read (index, indent, disName, utype, stream);
    else
        stream.println (indent + disName + " = " + Util.helperName (utype, true) + ".read (istream);");

    if (utype.name ().equals ("boolean"))
        index = readBoolean (disName, index, indent, name, u, stream);
    else
        index = readNonBoolean (disName, index, indent, name, u, stream);

    return index;
}
 
Example #23
Source File: Util.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private static String doContainerFullName (SymtabEntry container)
{
  String name = "";

  if (container == null)
    name = "";
  else
  {
    if (container instanceof InterfaceEntry ||
        container instanceof StructEntry ||
        container instanceof UnionEntry)
      name = container.name () + "Package";
    else
      name = container.name ();

    if (container.container () != null &&
      !container.container ().name ().equals (""))
      name = doContainerFullName (container.container ()) + '/' + name;
  }

  return name;
}
 
Example #24
Source File: UnionGen.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
public void generate (Hashtable symbolTable, UnionEntry u, PrintWriter s)
{
  this.symbolTable = symbolTable;
  this.u           = u;
  init ();

  openStream ();
  if (stream == null)
    return;
  generateHelper ();
  generateHolder ();
  writeHeading ();
  writeBody ();
  writeClosing ();
  closeStream ();
  generateContainedTypes ();
}
 
Example #25
Source File: UnionGen.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/

// Computes the total number of labels in the union, which is the sum
// of the number of labels in each branch of the union.  Note that the
// label for the default branch has size 0, but still counts in the total
// size.
private int unionLabelSize( UnionEntry un )
{
  int size = 0 ;
  Vector branches = un.branches() ;
  for (int i = 0; i < branches.size (); ++i) {
      UnionBranch branch = (UnionBranch)(branches.get(i)) ;
      int branchSize = branch.labels.size() ;
      size += ((branchSize == 0) ? 1 : branchSize) ;
  }
  return size ;
}
 
Example #26
Source File: UnionGen.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public int read (int index, String indent, String name,
    SymtabEntry entry, PrintWriter stream)
{
    UnionEntry u = (UnionEntry)entry;
    String disName = "_dis" + index++;
    SymtabEntry utype = Util.typeOf (u.type ());
    Util.writeInitializer (indent, disName, "", utype, stream);

    if (utype instanceof PrimitiveEntry)
        index = ((JavaGenerator)utype.generator ()).read (index, indent, disName, utype, stream);
    else
        stream.println (indent + disName + " = " + Util.helperName (utype, true) + ".read (istream);");

    if (utype.name ().equals ("boolean"))
        index = readBoolean (disName, index, indent, name, u, stream);
    else
        index = readNonBoolean (disName, index, indent, name, u, stream);

    return index;
}
 
Example #27
Source File: Util.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private static String doContainerFullName (SymtabEntry container)
{
  String name = "";

  if (container == null)
    name = "";
  else
  {
    if (container instanceof InterfaceEntry ||
        container instanceof StructEntry ||
        container instanceof UnionEntry)
      name = container.name () + "Package";
    else
      name = container.name ();

    if (container.container () != null &&
      !container.container ().name ().equals (""))
      name = doContainerFullName (container.container ()) + '/' + name;
  }

  return name;
}
 
Example #28
Source File: UnionGen.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
public void generate (Hashtable symbolTable, UnionEntry u, PrintWriter s)
{
  this.symbolTable = symbolTable;
  this.u           = u;
  init ();

  openStream ();
  if (stream == null)
    return;
  generateHelper ();
  generateHolder ();
  writeHeading ();
  writeBody ();
  writeClosing ();
  closeStream ();
  generateContainedTypes ();
}
 
Example #29
Source File: UnionGen.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/

// Computes the total number of labels in the union, which is the sum
// of the number of labels in each branch of the union.  Note that the
// label for the default branch has size 0, but still counts in the total
// size.
private int unionLabelSize( UnionEntry un )
{
  int size = 0 ;
  Vector branches = un.branches() ;
  for (int i = 0; i < branches.size (); ++i) {
      UnionBranch branch = (UnionBranch)(branches.get(i)) ;
      int branchSize = branch.labels.size() ;
      size += ((branchSize == 0) ? 1 : branchSize) ;
  }
  return size ;
}
 
Example #30
Source File: UnionGen.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public int read (int index, String indent, String name,
    SymtabEntry entry, PrintWriter stream)
{
    UnionEntry u = (UnionEntry)entry;
    String disName = "_dis" + index++;
    SymtabEntry utype = Util.typeOf (u.type ());
    Util.writeInitializer (indent, disName, "", utype, stream);

    if (utype instanceof PrimitiveEntry)
        index = ((JavaGenerator)utype.generator ()).read (index, indent, disName, utype, stream);
    else
        stream.println (indent + disName + " = " + Util.helperName (utype, true) + ".read (istream);");

    if (utype.name ().equals ("boolean"))
        index = readBoolean (disName, index, indent, name, u, stream);
    else
        index = readNonBoolean (disName, index, indent, name, u, stream);

    return index;
}