/**
  * does nothing, node is used by parent
  * @see parser.IDLParserVisitor#visit(ASTdeclarator, Object)
  */
 public Object visit(ASTdeclarator node, Object data) {
     return null; //nothing to do, used by parent node
 }
Exemplo n.º 2
0
/* Production 50, chapter 3.4, corba 2.3.1 */
  public void declarator() {
 /*@bgen(jjtree) declarator */
  ASTdeclarator jjtn000 = new ASTdeclarator(this, IDLParserTreeConstants.JJTDECLARATOR);
  bool jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      if (jj_2_18(2)) {
        complex_declarator();
      } else {
        switch ((jj_ntk==-1)?jj_ntk_calc():jj_ntk) {
        case IDLParserConstants.ID:
          simple_declarator();
          break;
        default:
          jj_la1[57] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
          break;
        }
      }
    } catch (Exception jjte000) {
    if (jjtc000) {
      jjtree.clearNodeScope(jjtn000);
      jjtc000 = false;
    } else {
      jjtree.popNode();
    }
  {if (true) throw ;}
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
    }
    }
  }
 /// <summary>
 /// returns the name of the declared identity. For array declarators, creates the array type out of the typeSpecType
 /// </summary>
 private string DetermineTypeAndNameForDeclarator(ASTdeclarator node, object visitorData, ref TypeContainer typeSpecType) {
     Node child = node.jjtGetChild(0); // child of declarator
     if (child is ASTsimple_declarator) {
         // a simple delcarator
         ASTsimple_declarator simpleDecl = (ASTsimple_declarator) child;
         return simpleDecl.getIdent();
     } else if (child is ASTcomplex_declarator) {
         ASTarray_declarator arrayDecl = (ASTarray_declarator) child.jjtGetChild(0);
         int[] dimensions = (int[])arrayDecl.jjtAccept(this, visitorData);
         typeSpecType = GetTypeContainerForMultiDimArray(typeSpecType, dimensions);
         return arrayDecl.getIdent();
     } else {
         throw new NotSupportedException("unexpected delcarator: " + child.GetType()); // should never occur
     }
 }