Changeset 2720


Ignore:
Timestamp:
Apr 20, 2007, 2:03:29 AM (14 years ago)
Author:
yura
Message:
  • Put in refal format only public functions and fields.
  • Const declaration printing is corrected.
Location:
to-imperative/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/compiler/rfp_asail_java.rf

    r2693 r2720  
    9696  (e.moduleName) (e.java);
    9797
     98$func ReplaceQuotes s = s;
     99
     100ReplaceQuotes s.expr =
     101  (<ToChars s.expr>) $iter {
     102    e.expr : e.head '\'' e.tail = e.items e.head '\\\'' (e.tail);
     103    e.items e.expr ();
     104  } :: e.items (e.expr), e.expr : /*empty*/ =
     105  (e.items) $iter {
     106    e.expr : e.head '\"' e.tail = e.items e.head '\\\"' (e.tail);
     107    e.items e.expr ();
     108  } :: e.items (e.expr), e.expr : /*empty*/ =
     109  <ToWord e.items>;
     110
    98111ASAIL_To_Java e.asail, {
    99112  e.asail : t.item e.rest, t.item : {
     
    108121      { <Get &Entry> : e t.name e = <Store &Entry_Name t.name>;; },
    109122      <Store &Func_Name <Name_To_Java t.name>>,
    110       { ('@RefalFormat("'<PrintFunctionFormat t.name>'")');; } :: e.refalFormat,
     123      { ('@RefalFormat("'<ReplaceQuotes <PrintFunctionFormat t.name>>'")');; } :: e.refalFormat,
    111124      ()
    112125      e.refalFormat
     
    226239      } :: e.n,
    227240      <Const_Expr_To_Java e.expr> :: e.a (e.j_expr),
    228       e.a ('static '<Access_Mode s.linkage>' final Expr 'e.n' = 'e.j_expr';');
     241      { ('@RefalFormat("'<ReplaceQuotes <PrintConstDefinition t.name>>'")');; } :: e.refalDecl,
     242      e.a e.refalDecl
     243      ('static '<Access_Mode s.linkage>' final Expr 'e.n' = 'e.j_expr';');
    229244    (OBJ s.linkage s.tag t.name) =
    230245      <ToChars s.tag> : s1 e2,
    231246      s1 <ToLower e2> :: e.class_name,
    232247      t.name :  (e s.n),
     248      { ('@RefalFormat("'<ReplaceQuotes <PrintObjectDefinition t.name>>'")');; } :: e.refalDecl,
     249      e.refalDecl
    233250      ('static '<Access_Mode s.linkage>' final Expr '<Name_To_Java t.name>
    234251        ' = new Expr (new org.refal.plus.'e.class_name'.Named ("'s.n'"));');
  • to-imperative/trunk/compiler/rfp_helper.rf

    r2718 r2720  
    8585  e.format () $iter {
    8686    e.format : t.item e.rest,
    87       t.item : {
    88         s.object = s.object;
    89         (CONST (e s.name)) = "&" s.name;
    90         (REF (e s.name)) = "&" s.name;
    91         (PAREN e.subformat) = "(" <PrintFormat  e.subformat> ")";
    92         (SVAR e) = "s";
    93         (TVAR e) = "t";
    94         (VVAR e) = "v";
    95         (EVAR e) = "e";
    96         e = "UNKNOWN";
    97       } :: e.subres,
     87      {
     88        <IsChar t.item> =
     89          t.item (e.rest) F $iter {
     90            e.rest : t.head e.tail, <IsChar t.head> = e.items t.head (e.tail) F;
     91            e.items (e.rest) T;
     92          } :: e.items (e.rest) s.tag, s.tag : T =
     93          '\'' e.items '\'' (e.rest);
     94        t.item : {
     95          s.object, <IsChar s.object> = '\'' s.object '\'';
     96          s.object, <IsWord s.object> = '\"' s.object '\"';
     97          s.object, <IsInt s.object> = s.object;
     98          (CONST (e s.name)) = "&" s.name;
     99          (REF (e s.name)) = "&" s.name;
     100          (PAREN e.subformat) = "(" <PrintFormat  e.subformat> ")";
     101          (SVAR e) = "s";
     102          (TVAR e) = "t";
     103          (VVAR e) = "v";
     104          (EVAR e) = "e";
     105          e = "UNKNOWN";
     106        } :: e.subres =
     107          e.subres (e.rest);
     108      } :: e.subres (e.rest),
    98109      {
    99110        e.res : /*empty*/ = e.subres;
  • to-imperative/trunk/java/org/refal/plus/comp/FormatReader.java

    r2709 r2720  
    8686  public void visitAttribute (Attribute attr) {}
    8787  public void visitEnd () {}
    88   public FieldVisitor visitField (int access, String name, String desc, String signature, Object value) { return new FieldFormatReader(); }
     88  public FieldVisitor visitField (int access, String name, String desc, String signature, Object value) {
     89    return ((access & Opcodes.ACC_PUBLIC) != 0)?new FieldFormatReader():null;
     90  }
    8991  public void visitInnerClass (String name, String outerName, String innerName, int access) {}
    90   public MethodVisitor visitMethod (int access, String name, String desc, String signature, String[] exceptions) { return new MethodFormatReader(); }
     92  public MethodVisitor visitMethod (int access, String name, String desc, String signature, String[] exceptions) {
     93    return ((access & Opcodes.ACC_PUBLIC) != 0)?new MethodFormatReader():null;
     94  }
    9195  public void visitOuterClass (String owner, String name, String desc) {}
    9296  public void visitSource (String source, String debug) {}
Note: See TracChangeset for help on using the changeset viewer.