Example #1
0
/* Production 25, chapter 3.4, CORBA 2.3.1 */
  public void init_param_decl() {
 /*@bgen(jjtree) init_param_decl */
  ASTinit_param_decl jjtn000 = new ASTinit_param_decl(this, IDLParserTreeConstants.JJTINIT_PARAM_DECL);
  bool jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      init_param_attribute();
      param_type_spec();
      simple_declarator();
    } 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(ASTinit_param_decl, Object)
  */
 public Object visit(ASTinit_param_decl node, Object data) {
     // direction always in
     ParameterSpec.ParameterDirection direction = (ParameterSpec.ParameterDirection)
         node.jjtGetChild(0).jjtAccept(this, data);
     // determine name and type
     TypeContainer paramType = (TypeContainer)node.jjtGetChild(1).jjtAccept(this, data);
     if (paramType == null) {
         throw new InvalidIdlException(String.Format("init parameter type {0} not (yet) defined for {1}", 
                                                     ((SimpleNode)node.jjtGetChild(1)).GetIdentification(),
                                                     node.GetIdentification()));
     }
     paramType = ReplaceByCustomMappedIfNeeded(paramType);
     String paramName = IdlNaming.MapIdlNameToClsName(((ASTsimple_declarator)node.jjtGetChild(2)).getIdent());
     
     ParameterSpec result = new ParameterSpec(paramName, paramType, direction);
     return result;
 }