Ejemplo n.º 1
0
 void addAnnotation(boolean visible, String clname) throws jasError {
   if (cur_method != null) {
     cur_annotation = cur_method.addAnnotation(visible, clname);
   } else if (cur_field != null) {
     cur_annotation = cur_field.addAnnotation(visible, clname);
   } else if (class_header) {
     cur_annotation = class_env.addAnnotation(visible, clname);
   } else {
     outside(".annotation");
   }
 }
Ejemplo n.º 2
0
 //
 // called by the .deprecated directive
 //
 //
 void setDeprecated() throws jasError {
   DeprecatedAttr depr = new DeprecatedAttr();
   if (cur_method != null) {
     cur_method.setDeprecated(depr);
   } else if (cur_field != null) {
     cur_field.setDeprecated(depr);
   } else if (class_header) {
     class_env.setDeprecated(depr);
   } else {
     outside(".deprecated");
   }
 }
Ejemplo n.º 3
0
 //
 // called by the .signature directive
 //
 void setSignature(String str) throws jasError {
   SignatureAttr sig = new SignatureAttr(str);
   if (cur_method != null) {
     cur_method.setSignature(sig);
   } else if (cur_field != null) {
     cur_field.setSignature(sig);
   } else if (class_header) {
     class_env.setSignature(str);
   } else {
     outside(".signature");
   }
 }
Ejemplo n.º 4
0
 //
 // called by the .attribute directive
 //
 void addGenericAttr(String name, String file) throws IOException, jasError {
   GenericAttr gattr = new GenericAttr(name, file);
   if (cur_method != null) {
     flushInsnBuffer();
     if (code != null) code.addGenericAttr(gattr);
     else cur_method.addGenericAttr(gattr);
   } else if (cur_field != null) {
     cur_field.addGenericAttr(gattr);
   } else if (class_header) {
     class_env.addGenericAttr(gattr);
   } else {
     outside(".attribute");
   }
 }
Ejemplo n.º 5
0
  //
  // called by the .end method directive to end the definition for a method
  //
  void endMethod() throws jasError {
    if (cur_method == null) throw new jasError(".end method without .method");

    if (cur_annotation != null) opened_annotation("method");

    if (code != null) {

      plantLabel(END_METHOD);
      flushInsnBuffer();

      if (catch_table != null) {
        code.setCatchtable(catch_table);
      }

      if (var_table != null) {
        code.setLocalVarTable(var_table);
      }
      if (vtype_table != null) {
        code.setLocalVarTypeTable(vtype_table);
      }
      if (line_table != null) {
        code.setLineTable(line_table);
      }
      if (stackmap != null) {
        code.setStackMap(stackmap);
      }
    }
    cur_method.setCode(code, except_attr);
    class_env.addMethod(cur_method);

    // clear method state variables
    cur_method = null;
    code = null;
    labels = null;
    catch_table = null;
    line_table = null;
    var_table = null;
    vtype_table = null;
    stackmap = null;
    verifyframe = null;
  }
Ejemplo n.º 6
0
 void addAnnotation(boolean visible, String clname, int paramnum) throws jasError {
   if (cur_method == null) Annotation.ParserError();
   cur_annotation = cur_method.addAnnotation(visible, clname, paramnum);
 }
Ejemplo n.º 7
0
 void addAnnotation() throws jasError {
   if (cur_method == null) Annotation.ParserError();
   cur_annotation = cur_method.addAnnotation();
 }