Exemplo n.º 1
0
/* Production 19, chapter 3.4, CORBA 2.3.1, separated into two productions */
  public void value_base_inheritance_spec() {
 /*@bgen(jjtree) value_base_inheritance_spec */
  ASTvalue_base_inheritance_spec jjtn000 = new ASTvalue_base_inheritance_spec(this, IDLParserTreeConstants.JJTVALUE_BASE_INHERITANCE_SPEC);
  bool jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      jj_consume_token(19);
      switch ((jj_ntk==-1)?jj_ntk_calc():jj_ntk) {
      case 24:
        jj_consume_token(24);
        break;
      default:
        jj_la1[24] = jj_gen;
        ;
        break;
      }
      value_name();
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk_calc():jj_ntk) {
        case 20:
          ;
          break;
        default:
          jj_la1[25] = jj_gen;
          goto label_8;
          break;
        }
        jj_consume_token(20);
        value_name();
      }
      label_8: ;
      
    } catch (Exception jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
    {if (true) throw ;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  }
 /**
  * @see parser.IDLParserVisitor#visit(ASTvalue_base_inheritance_spec, Object)
  * @param data the buildinfo of the container of the type, having this inheritance relationship
  * @return an array of System.Type containing all direct supertypes
  */
 public Object visit(ASTvalue_base_inheritance_spec node, Object data) {
     CheckParameterForBuildInfo(data, node);
     Type[] result = ParseInheritanceRelation(node, (BuildInfo)data);
     for (int i = 0; i < result.Length; i++) {
         if ((i > 0) && (result[i].IsClass)) {
             throw new InvalidIdlException("invalid supertype: " + result[i].FullName + " for type: " + 
                                           node.GetEmbedderDesc() +
                                           " for value types, only one concrete value type parent is possible at the first position in the inheritance spec");
         }
         AttributeExtCollection attrs = AttributeExtCollection.ConvertToAttributeCollection(result[i].GetCustomAttributes(typeof(InterfaceTypeAttribute), true));
         if (attrs.IsInCollection(typeof(InterfaceTypeAttribute))) {
             InterfaceTypeAttribute ifAttr = (InterfaceTypeAttribute)attrs.GetAttributeForType(typeof(InterfaceTypeAttribute));
             if (!(ifAttr.IdlType.Equals(IdlTypeInterface.AbstractValueType))) {
                 throw new InvalidIdlException("invalid supertype: " + result[i].FullName + " for type: " + 
                                            node.GetEmbedderDesc() +
                                            " only abstract value types are allowed in value inheritance clause and no interfaces");
             }
         }
     }        
     return result;
 }