Beispiel #1
0
/* Production 71, chapter 3.4, corba 2.3.1 */
  public void member() {
 /*@bgen(jjtree) member */
  ASTmember jjtn000 = new ASTmember(this, IDLParserTreeConstants.JJTMEMBER);
  bool jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      type_spec();
      declarators();
      jj_consume_token(12);
    } 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(ASTmember, Object)
  */
 public Object visit(ASTmember node, Object data) {
     CheckParameterForBuildInfo(data, node);
     BuildInfo info = (BuildInfo) data;
     TypeBuilder builder = info.GetContainterType();
     ASTtype_spec typeSpecNode = (ASTtype_spec)node.jjtGetChild(0);
     TypeContainer fieldType = (TypeContainer)typeSpecNode.jjtAccept(this, info);
     if (fieldType == null) {
         throw new InvalidIdlException(
             String.Format("field type {0} not (yet) defined for struct-{1}",
                           typeSpecNode.GetIdentification(), 
                           node.GetIdentification()));
     }
     fieldType = ReplaceByCustomMappedIfNeeded(fieldType);
     ASTdeclarators decl = (ASTdeclarators)node.jjtGetChild(1);
     ArrayList generatedMembers = new ArrayList();
     for (int i = 0; i < decl.jjtGetNumChildren(); i++) {
         string fieldName = IdlNaming.MapIdlNameToClsName(
                                DetermineTypeAndNameForDeclarator((ASTdeclarator)decl.jjtGetChild(i), data,
                                                                  ref fieldType));
         FieldBuilder generatedMember =
             m_ilEmitHelper.AddFieldWithCustomAttrs(builder, fieldName, fieldType,
                                                    FieldAttributes.Public);
         generatedMembers.Add(generatedMember);            
     }
     return generatedMembers;
 }