Changeset 2709


Ignore:
Timestamp:
Apr 18, 2007, 1:06:59 AM (14 years ago)
Author:
yura
Message:
Location:
to-imperative/trunk/java/org/refal/plus
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/java/org/refal/plus/comp/FormatReader.java

    r2707 r2709  
    6262  }
    6363
     64  class FieldFormatReader implements FieldVisitor
     65  {
     66    public FieldFormatReader () {}
     67
     68    public AnnotationVisitor visitAnnotation (String desc, boolean visible) {
     69      if (desc.equals("Lorg/refal/plus/RefalFormat;"))
     70        return new MethodFormatAnnotationReader();
     71      else
     72        return null;
     73    }
     74    public void visitAttribute (Attribute attr) {}
     75    public void visitEnd () {}
     76  }
     77
    6478  String formats;
    6579
     
    7286  public void visitAttribute (Attribute attr) {}
    7387  public void visitEnd () {}
    74   public FieldVisitor visitField (int access, String name, String desc, String signature, Object value) { return null; }
     88  public FieldVisitor visitField (int access, String name, String desc, String signature, Object value) { return new FieldFormatReader(); }
    7589  public void visitInnerClass (String name, String outerName, String innerName, int access) {}
    7690  public MethodVisitor visitMethod (int access, String name, String desc, String signature, String[] exceptions) { return new MethodFormatReader(); }
  • to-imperative/trunk/java/org/refal/plus/wrapgen/WrapGen.java

    r2692 r2709  
    6161                        if (refName != null) {
    6262                                FieldVisitor fv = super.visitField(access, refName, "Lorg/refal/plus/Expr;", null, null);
     63                                AnnotationVisitor av = fv.visitAnnotation("Lorg/refal/plus/RefalFormat;", false);
     64                                av.visit("value", "$const \""+refName+"\" = "+((Integer)value).intValue()+";");
     65                                av.visitEnd();
    6366                                constants.put(refName, value);
    6467                                fv.visitEnd();
     
    9598                String newDesc = Type.getMethodDescriptor(Type.VOID_TYPE, newArgTypes);
    9699                MethodVisitor mv = super.visitMethod(Opcodes.ACC_PUBLIC+Opcodes.ACC_STATIC, refFun.name, newDesc, null, new String[] {"org/refal/plus/RefalException"});
     100                AnnotationVisitor av = mv.visitAnnotation("Lorg/refal/plus/RefalFormat;", false);
     101                av.visit("value", refFun.toString());
     102                av.visitEnd();
    97103                mv.visitCode();
    98104                if (isConstructor) {
Note: See TracChangeset for help on using the changeset viewer.