⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 astsetorsequencetype.java

📁 ASN.1工具源代码,包括编译源码生成工具和各种基本类型构造类型的编解码实现代码
💻 JAVA
字号:
/* Generated By:JJTree: Do not edit this line. ASTSetOrSequenceType.java */package com.k_int.codec.comp;import java.io.File;import java.io.Writer;import java.io.StringWriter;import java.io.FileWriter;public class ASTSetOrSequenceType extends SimpleNode {  public int which = 0;  public ASTSetOrSequenceType(int id) {    super(id);  }  public ASTSetOrSequenceType(AsnParser p, int id) {    super(p, id);  }  public void getSequenceMembers(SequenceTypeInfo sti)  {    CodecBuilderInfo info = CodecBuilderInfo.getInfo();                                                                               System.err.println("          ASTSetOrSequenceType::getSequenceMembers");    ASTElementTypeList choice_elements = (ASTElementTypeList)jjtGetChild(0);    int i, k = choice_elements.jjtGetNumChildren();    for (i = 0; i < k; i++)    {      ASTElementType choice_element = (ASTElementType)(choice_elements.jjtGetChild(i));      if ( choice_element.which == 1 )      {        ASTNamedType name = (ASTNamedType)(choice_element.jjtGetChild(0));        String element_name = name.getName().replace ( '-', '_' );        // String element_name = name.getName();        ASTType element_type_info = name.getType();        boolean has_tagging = false;        int tag_class = -1;        int tag_number = -1;        boolean is_implicit = ( info.default_tagging_is_explicit == true ? false : true );                                                                // Find out if the type is tagged        if ( element_type_info.which == 1 ) // It's a builtin type        {          ASTBuiltinType bit = (ASTBuiltinType) (element_type_info.jjtGetChild(0));           if ( bit.which == 6 )          {            has_tagging = true;            // It's a tagged type, extract tagging information and proceed            // with the actual type info...            ASTTaggedType tt = (ASTTaggedType) (bit.jjtGetChild(0));            is_implicit = tt.isImplicit();            // The real type we want to process is inside the tagging info            element_type_info = tt.getType();            // Extract the tagging info            ASTTag tag = tt.getTag();            if ( tag.hasTagClass )              tag_class = tag.getTagClass().tag_class;            else              tag_class = 0x80; // Assume context tag class if none given               ASTClassNumber cn = tag.getClassNumber();               if ( cn.which == 1 )            {              // It's a number              tag_number = cn.getNumber().getNumber().intValue();            }            else            {              System.err.println("Unhandled tag number type");              System.exit(0);              // LATER: Should throw an exception here            }          }        }        String type_name = element_type_info.getTypeName();        // If it's a tagged built in type, just check some specials        if ( element_type_info.which == 1 ) // It's a builtin type        {          ASTBuiltinType bit = (ASTBuiltinType) (element_type_info.jjtGetChild(0));          switch ( bit.which )          {            case 2:  // SetOrSequence              // ASTSetOrSequenceType sos = (ASTSetOrSequenceType)(bit.jjtGetChild(0));              type_name=element_name+"_inline"+info.getNextInlineCounter();              // if ( sos.which == 1 )              // {                info.createTypeInfoFor(type_name, element_type_info);              // }              // else              // {                               info.createTypeInfoFor(type_name, element_type_info);              // }              break;            case 3:  // SetOrSequenceOf              // ASTSetOrSequenceOfType soso = (ASTSetOrSequenceOfType)(bit.jjtGetChild(0));              // ASTType sot = (ASTType) (soso.jjtGetChild(0));              type_name=element_name+"_inline"+info.getNextInlineCounter();              info.createTypeInfoFor(type_name, element_type_info);              // if ( sot.which == 1 )              // {              //   ASTBuiltinType sub_bit = (ASTBuiltinType) (sot.jjtGetChild(0));                // subtype_reference depends upon internal type....              //   switch ( sub_bit.which )              //   {              //     case 2:              //       System.err.println("SEQUENCEOF SEQUENCE");              //       info.createTypeInfoFor(type_name, element_type_info);                    // info.createTypeInfoFor(type_name, sot);              //       break;              //     case 4: // SequenceOf Choice              //       System.err.println("SEQUENCEOF CHOICE ");              //       info.createTypeInfoFor(type_name, element_type_info);                    // info.createTypeInfoFor(type_name, sot);              //       break;              //     default:              //       System.err.println("SOST SEQUENCEOF something ok.. "+sub_bit.which+" "+info.getInternalClass(bit.which));              //       info.createTypeInfoFor(type_name, sot);              //       // info.createTypeInfoFor(type_name, sot);              //       break;              //   }              // }              // else              // {              //   ASTDefinedType sub_dt = (ASTDefinedType) (sot.jjtGetChild(0));              //   System.err.println("SEQUENCEOF defined type "+ sub_dt.getTypeReference().typeref);              //   info.createTypeInfoFor(type_name, element_type_info);                // type_name =  sub_dt.getTypeReference().typeref;              // }                                                                                                                                          break;            case 4:  // Choice              type_name=element_name+"_inline"+info.getNextInlineCounter();              info.createTypeInfoFor(type_name, element_type_info);              break;            default:              break;          }        }        sti.registerTaggedMember(element_name,                                 tag_class,                                 tag_number,                                 is_implicit,                                 type_name,                                 choice_element.optional);        System.err.println("            Adding Sequence element "+tag_class+                           " "+tag_number+" "+is_implicit+                           " "+element_name+                           " "+ type_name + ( choice_element.optional == true ? " OPTIONAL " : "" ) );      }    }  }  // public String getBaseClassName(String element_name)  // {  //   return element_name+"_codec ";  // }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -