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

Examples of com.sun.tools.corba.se.idl.constExpr.Expression


    {
      UnionBranch branch = (UnionBranch)branches.nextElement ();
      Enumeration labels = branch.labels.elements ();
      while (labels.hasMoreElements ())
      {
        Expression expr = (Expression)labels.nextElement ();
        String str ;

        if (unionIsEnum)
          if (useIntsForEnums)
            str = typePackage + "_" + Util.parseExpression( expr ) ;
View Full Code Here


          if (b != branch)
          {
            Enumeration eLabels = b.labels.elements ();
            while (eLabels.hasMoreElements ())
            {
              Expression label = (Expression)eLabels.nextElement ();
              if (!onlyOne)
                stream.print (" || ");
              if (unionIsEnum)
                stream.print ("discriminator == " + typePackage + Util.parseExpression (label));
              else
                stream.print ("discriminator == " + Util.parseExpression (label));
              onlyOne = false;
            }
          }
        }
      }
      else
      {
        Enumeration e = branch.labels.elements ();
        while (e.hasMoreElements ())
        {
          Expression label = (Expression)e.nextElement ();
          if (!onlyOne)
            stream.print (" && ");
          if (unionIsEnum)
            stream.print ("discriminator != " + typePackage + Util.parseExpression (label));
          else
View Full Code Here

            stream.println (indent + "  " + tcOfMembers + ',');
            stream.println (indent + "  null);");
        } else {
            Enumeration enumeration = labels.elements() ;
            while (enumeration.hasMoreElements()) {
                Expression expr = (Expression)(enumeration.nextElement()) ;
                String elem = Util.parseExpression( expr ) ;

                stream.println ();
                stream.println (indent + "// Branch for " + memberName +
                    " (case label " + elem + ")" );
View Full Code Here

        try {
            if (u.branches ().size () == 1 &&
                (u.defaultBranch () != null || firstBranch.labels.size () == 2)) {
                noCases = true;
            } else {
                Expression expr = (Expression)(firstBranch.labels.firstElement()) ;
                Boolean bool = (Boolean)(expr.evaluate()) ;
                firstBranchIsTrue = bool.booleanValue ();
            }
        } catch (EvaluationException ex) {
            // no action
        }
View Full Code Here

        while (e.hasMoreElements ()) {
            UnionBranch branch = (UnionBranch)e.nextElement ();
            Enumeration labels = branch.labels.elements ();

            while (labels.hasMoreElements ()) {
                Expression label = (Expression)labels.nextElement ();

                if (utype instanceof EnumEntry) {
                    String key = Util.parseExpression (label);
                    stream.println (indent + "  case " + typePackage + '_' + key + ':');
                } else
View Full Code Here

    {
      UnionBranch branch = (UnionBranch)e.nextElement ();
      Enumeration labels = branch.labels.elements ();
      while (labels.hasMoreElements ())
      {
        Expression label = (Expression)labels.nextElement ();
        if (utype instanceof EnumEntry)
        {
          String key = Util.parseExpression (label);
          stream.println (indent + "  case " + typePackage + '_' + key + ":");
        }
View Full Code Here

      // Regardles, this code will not be emitted since updated emitters invoke
      // method type() below instead of helperType() when handling sequences

      // This is a recursive sequence
      tcoffsets.set (null);
      Expression maxSize = ((SequenceEntry)entry).maxSize ();
      if (maxSize == null)
        stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_recursive_sequence_tc (0, " + (offsetOfType - tcoffsets.currentOffset ()) + ");");
      else
        stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_recursive_sequence_tc (" + Util.parseExpression (maxSize) + ", " + (offsetOfType - tcoffsets.currentOffset ()) + ");");
      tcoffsets.bumpCurrentOffset (4); // add indirection field
    }
    else
    {
      // This is a normal sequence
      tcoffsets.set (entry);
      index = ((JavaGenerator)entry.type ().generator ()).helperType (index + 1, indent, tcoffsets, name, entry.type (), stream);
      Expression maxSize = ((SequenceEntry)entry).maxSize ();
      if (maxSize == null)
        stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_sequence_tc (0, " + name + ");");
      else
        stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_sequence_tc (" + Util.parseExpression (maxSize) + ", " + name + ");");
    }
View Full Code Here

    else
    {
      // This is a normal sequence
      tcoffsets.set (entry);
      index = ((JavaGenerator)entry.type ().generator ()).type (index + 1, indent, tcoffsets, name, entry.type (), stream);
      Expression maxSize = ((SequenceEntry)entry).maxSize ();
      if (maxSize == null)
        stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_sequence_tc (0, " + name + ");");
      else
        stream.println (indent + name + " = org.omg.CORBA.ORB.init ().create_sequence_tc (" + Util.parseExpression (maxSize) + ", " + name + ");");
    }
View Full Code Here

    while (eBranches.hasMoreElements ())
    {
      Enumeration eLabels = ((UnionBranch)eBranches.nextElement ()).labels.elements ();
      while (eLabels.hasMoreElements ())
      {
        Expression exp = (Expression)eLabels.nextElement ();
        if (exp.equals (label) || exp.value ().equals (label.value ()))
          return true;
      }
    }
    return false;
  } // has
View Full Code Here

        stream.println (indent + name + " (org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_" + type.name () + "));");
    }
    else if (type instanceof StringEntry)
    {
      StringEntry s = (StringEntry)type;
      Expression e  = s.maxSize ();
      if (e == null)
        stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (" + Util.parseExpression (e) + "));");
     else
        stream.println (indent + name + " (org.omg.CORBA.ORB.init ().create_" + type.name () + "_tc (0));");
    }
View Full Code Here

TOP

Related Classes of com.sun.tools.corba.se.idl.constExpr.Expression

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.