Changeset 3423


Ignore:
Timestamp:
Feb 22, 2008, 8:28:43 PM (13 years ago)
Author:
yura
Message:
  • Refactoring
Location:
to-imperative/trunk/java/runtime/refal/plus
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/java/runtime/refal/plus/Access.java

    r2882 r3423  
    77package refal.plus;
    88
    9 import org.refal.plus.*;
    109import java.math.BigInteger;
     10
     11import org.refal.plus.Expr;
     12import org.refal.plus.RefalException;
     13import org.refal.plus.RefalFormat;
     14import org.refal.plus.Result;
     15import org.refal.plus.Util;
    1116
    1217public final class Access {
  • to-imperative/trunk/java/runtime/refal/plus/Apply.java

    r3419 r3423  
    77package refal.plus;
    88
    9 import org.refal.plus.*;
     9import org.refal.plus.Expr;
     10import org.refal.plus.Func;
     11import org.refal.plus.RefalException;
     12import org.refal.plus.RefalFormat;
     13import org.refal.plus.Result;
    1014
    1115public final class Apply {
  • to-imperative/trunk/java/runtime/refal/plus/Arithm.java

    r2882 r3423  
    77package refal.plus;
    88
    9 import org.refal.plus.*;
    109import java.math.BigInteger;
     10
     11import org.refal.plus.Expr;
     12import org.refal.plus.RefalException;
     13import org.refal.plus.RefalFormat;
     14import org.refal.plus.Result;
    1115
    1216public final class Arithm {
     
    101105        }
    102106    }
    103    
     107
    104108    @RefalFormat("$func Abs s.Int = s.Int;")
    105109    public static void Abs (Expr s, Result res) throws RefalException {
     
    111115        }
    112116    }
    113 
    114117
    115118    @RefalFormat("$func Max s.Int1 s.Int2 = s.Max;")
  • to-imperative/trunk/java/runtime/refal/plus/Bit.java

    r2882 r3423  
    77package refal.plus;
    88
    9 import org.refal.plus.*;
     9import java.lang.System;
    1010import java.math.BigInteger;
    11 import java.lang.System;
     11
     12import org.refal.plus.Expr;
     13import org.refal.plus.RefalException;
     14import org.refal.plus.RefalFormat;
     15import org.refal.plus.Result;
     16import org.refal.plus.Util;
    1217
    1318public final class Bit {
  • to-imperative/trunk/java/runtime/refal/plus/Box.java

    r3419 r3423  
    77package refal.plus;
    88
    9 import org.refal.plus.*;
     9import org.refal.plus.Expr;
     10import org.refal.plus.RefalException;
     11import org.refal.plus.RefalFormat;
     12import org.refal.plus.Result;
    1013
    1114public final class Box {
  • to-imperative/trunk/java/runtime/refal/plus/Class.java

    r3419 r3423  
    77package refal.plus;
    88
    9 import org.refal.plus.*;
     9import java.lang.String;
    1010import java.util.List;
    1111import java.util.Map;
    12 import java.lang.String;
     12
     13import org.refal.plus.Expr;
     14import org.refal.plus.RefalFormat;
     15import org.refal.plus.Reference;
    1316
    1417public final class Class {
  • to-imperative/trunk/java/runtime/refal/plus/Compare.java

    r3419 r3423  
    77package refal.plus;
    88
    9 import org.refal.plus.*;
     9import org.refal.plus.Expr;
     10import org.refal.plus.RefalFormat;
     11import org.refal.plus.Result;
    1012
    1113public final class Compare {
     
    1719    private static final Expr eq = new Expr(new Character('='));
    1820
     21    /** @return: '<', '>', '=' */
    1922    @SuppressWarnings("all")
    20     @RefalFormat("$func Compare (e.Exp1) (e.Exp2) = s.Res;") // '<', '>', '='
     23    @RefalFormat("$func Compare (e.Exp1) (e.Exp2) = s.Res;")
    2124    public static void Compare (Expr a, Expr b, Result res) {
    2225        int r = a.compareTo(b);
  • to-imperative/trunk/java/runtime/refal/plus/Convert.java

    r2888 r3423  
    77package refal.plus;
    88
    9 import org.refal.plus.*;
     9import java.lang.String;
    1010import java.math.BigInteger;
    11 import java.lang.String;
     11
     12import org.refal.plus.Expr;
     13import org.refal.plus.RefalException;
     14import org.refal.plus.RefalFormat;
     15import org.refal.plus.Result;
    1216
    1317public class Convert {
     
    101105    // ///////////////////// Begining of generated part ///////////////////
    102106
    103   @RefalFormat("$func? Read_Expr e = e;")
    104   static public boolean Read_Expr (Expr _ve_xpr, Result _v_res1) throws RefalException
    105   {
    106     Result _ge_auxcall1 = new Result ();
    107     ToChars (_ve_xpr, _ge_auxcall1);
    108     Result _vs_tream = new Result ();
    109     refal.plus.Stream.Expr_Open (_ge_auxcall1.getExpr (), _vs_tream);
    110     Expr _ve_res = Expr.empty;
    111     _ve_res = Expr.empty;
    112     _exit__iter1: for ( ; ; )
    113     {
    114       _iter1: {
    115         if (!refal.plus.Stream.IsEnd_of_Stream (_vs_tream.getExpr ()))
    116         {
    117           break _iter1;
     107    @RefalFormat("$func? Read_Expr e = e;")
     108    static public boolean Read_Expr (Expr _ve_xpr, Result _v_res1) throws RefalException {
     109        Result _ge_auxcall1 = new Result();
     110        ToChars(_ve_xpr, _ge_auxcall1);
     111        Result _vs_tream = new Result();
     112        refal.plus.Stream.Expr_Open(_ge_auxcall1.getExpr(), _vs_tream);
     113        Expr _ve_res = Expr.empty;
     114        _ve_res = Expr.empty;
     115        _exit__iter1: for (;;) {
     116            _iter1: {
     117                if (!refal.plus.Stream.IsEnd_of_Stream(_vs_tream.getExpr())) {
     118                    break _iter1;
     119                }
     120                _v_res1.assign(_ve_res);
     121                break _exit__iter1;
     122            }
     123            Result _v_IsRead__Term1 = new Result();
     124            if (!refal.plus.Lexer.IsRead_Term(_vs_tream.getExpr(), _v_IsRead__Term1)) {
     125                return false;
     126            }
     127            _ve_res = Expr.concat(_ve_res, _v_IsRead__Term1.getExpr());
    118128        }
    119         _v_res1.assign (_ve_res);
    120         break _exit__iter1;
    121       }
    122       Result _v_IsRead__Term1 = new Result ();
    123       if (!refal.plus.Lexer.IsRead_Term (_vs_tream.getExpr (), _v_IsRead__Term1))
    124       {
    125         return false;
    126       }
    127       _ve_res = Expr.concat (_ve_res, _v_IsRead__Term1.getExpr ());
     129        return true;
    128130    }
    129     return true;
    130   }
    131131
    132     /////////////////////// End of generated part ///////////////////
     132    // ///////////////////// End of generated part ///////////////////
    133133
    134134}
  • to-imperative/trunk/java/runtime/refal/plus/Dir.java

    r2882 r3423  
    77package refal.plus;
    88
    9 import org.refal.plus.*;
    109import java.io.File;
    1110import java.lang.String;
     11
     12import org.refal.plus.Expr;
     13import org.refal.plus.RefalException;
     14import org.refal.plus.RefalFormat;
     15import org.refal.plus.RefalRuntime;
     16import org.refal.plus.Result;
    1217
    1318public final class Dir implements Comparable<Dir> {
  • to-imperative/trunk/java/runtime/refal/plus/Dos.java

    r3419 r3423  
    77package refal.plus;
    88
    9 import org.refal.plus.*;
    109import java.lang.System;
    1110import java.math.BigInteger;
     
    1312import java.util.Random;
    1413
     14import org.refal.plus.Expr;
     15import org.refal.plus.RefalException;
     16import org.refal.plus.RefalFormat;
     17import org.refal.plus.RefalRuntime;
     18import org.refal.plus.Result;
     19import org.refal.plus.Util;
     20
    1521public class Dos {
    16     private static final java.lang.String[] months = {
    17         "Jan", "Feb", "Mar", "Apr", "May", "Jun",
    18         "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
    19     };
     22    private static final java.lang.String[] months = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
     23            "Oct", "Nov", "Dec" };
    2024
    2125    private static final Character space = new Character(' ');
     
    2428
    2529    @RefalFormat("$func Time = e.String;")
    26     public static void Time (Result e)
    27     {
     30    public static void Time (Result e) {
    2831        Calendar c = Calendar.getInstance();
    29         Comparable<?>[] time = {
    30             BigInteger.valueOf(c.get(Calendar.DAY_OF_MONTH)),
    31             space,
    32             months[c.get(Calendar.MONTH)],
    33             space,
    34             BigInteger.valueOf(c.get(Calendar.YEAR)),
    35             space,
    36             BigInteger.valueOf(c.get(Calendar.HOUR_OF_DAY)),
    37             colon,
    38             BigInteger.valueOf(c.get(Calendar.MINUTE)),
    39             colon,
    40             BigInteger.valueOf(c.get(Calendar.SECOND)),
    41             point,
    42             BigInteger.valueOf(c.get(Calendar.MILLISECOND) / 10)
    43         };
     32        Comparable<?>[] time = { BigInteger.valueOf(c.get(Calendar.DAY_OF_MONTH)), space,
     33                months[c.get(Calendar.MONTH)], space, BigInteger.valueOf(c.get(Calendar.YEAR)), space,
     34                BigInteger.valueOf(c.get(Calendar.HOUR_OF_DAY)), colon, BigInteger.valueOf(c.get(Calendar.MINUTE)),
     35                colon, BigInteger.valueOf(c.get(Calendar.SECOND)), point,
     36                BigInteger.valueOf(c.get(Calendar.MILLISECOND) / 10) };
    4437        e.assign(Expr.fromArray(time));
    4538    }
     
    9689    }
    9790
    98     @RefalFormat("$func Random s.Limit = s.Rand;") // 0 <= s.Rand < s.Limit
     91    @RefalFormat("$func Random s.Limit = s.Rand;")
     92    // 0 <= s.Rand < s.Limit
    9993    public static void Random (Expr max, Result rand) throws RefalException {
    10094        assert max.length() == 1;
  • to-imperative/trunk/java/runtime/refal/plus/File.java

    r2882 r3423  
    77package refal.plus;
    88
    9 import org.refal.plus.*;
    10 import java.math.BigInteger;
    119import java.lang.String;
    1210import java.lang.System;
     11import java.math.BigInteger;
     12
     13import org.refal.plus.Expr;
     14import org.refal.plus.RefalException;
     15import org.refal.plus.RefalFormat;
     16import org.refal.plus.Result;
    1317
    1418public final class File {
     
    1620    private File () {}
    1721
    18     @RefalFormat("$box PathSeparator;") // Ex: ':' or ';'
    19     public static final Expr PathSeparator = new Expr(new org.refal.plus.Box(new Character(java.io.File.pathSeparatorChar)));
     22    /** {@value} Ex: ':' or ';' */
     23    @RefalFormat("$box PathSeparator;")
     24    public static final Expr PathSeparator = new Expr(new org.refal.plus.Box(new Character(
     25            java.io.File.pathSeparatorChar)));
    2026
    21     @RefalFormat("$box DirSeparator;") // Ex: '/' or '\\'
     27    /** {@value} Ex: '/' or '\\' */
     28    @RefalFormat("$box DirSeparator;")
    2229    public static final Expr DirSeparator = new Expr(new org.refal.plus.Box(new Character(java.io.File.separatorChar)));
    2330
  • to-imperative/trunk/java/runtime/refal/plus/Java.java

    r2882 r3423  
    77package refal.plus;
    88
    9 import org.refal.plus.*;
     9import org.refal.plus.Expr;
     10import org.refal.plus.RefalFormat;
     11import org.refal.plus.Result;
     12import org.refal.plus.Symbol;
    1013
    1114public final class Java {
  • to-imperative/trunk/java/runtime/refal/plus/StdIO.java

    r3075 r3423  
    77package refal.plus;
    88
    9 import org.refal.plus.*;
    10 
    11 import java.io.*;
    129import java.io.File;
     10import java.io.IOException;
    1311import java.lang.String;
    1412import java.lang.System;
    1513import java.math.BigInteger;
     14
     15import org.refal.plus.Channel;
     16import org.refal.plus.Expr;
     17import org.refal.plus.Func;
     18import org.refal.plus.RefalException;
     19import org.refal.plus.RefalFormat;
     20import org.refal.plus.Result;
     21import org.refal.plus.Symbol;
    1622
    1723public class StdIO {
     
    600606    /////////////////////// End of generated part ///////////////////
    601607 
    602   static {
     608    static {
    603609        try {
    604610            Result _v_Stream1 = new Result();
  • to-imperative/trunk/java/runtime/refal/plus/String.java

    r3418 r3423  
    77package refal.plus;
    88
    9 import org.refal.plus.*;
    109import java.math.BigInteger;
     10
     11import org.refal.plus.Expr;
     12import org.refal.plus.RefalException;
     13import org.refal.plus.RefalFormat;
     14import org.refal.plus.Reference;
     15import org.refal.plus.Result;
     16import org.refal.plus.Symbol;
     17import org.refal.plus.Util;
    1118
    1219public final class String {
  • to-imperative/trunk/java/runtime/refal/plus/System.java

    r3419 r3423  
    77package refal.plus;
    88
    9 import org.refal.plus.*;
     9import java.io.BufferedReader;
     10import java.io.IOException;
     11import java.io.InputStream;
     12import java.io.InputStreamReader;
     13import java.lang.String;
    1014import java.math.BigInteger;
    11 import java.io.*;
    12 import java.lang.String;
     15
     16import org.refal.plus.Expr;
     17import org.refal.plus.RefalException;
     18import org.refal.plus.RefalFormat;
     19import org.refal.plus.Result;
    1320
    1421public final class System extends Dos {
  • to-imperative/trunk/java/runtime/refal/plus/Table.java

    r3422 r3423  
    115115            Expr.Concatenator concat = Expr.getConcatenator(map.size());
    116116            for (Map.Entry<Expr, Expr> pair : map.entrySet())
    117                 concat.toRight((Comparable<?>) Expr.concat((Comparable<?>) pair.getKey(), (Comparable<?>) pair.getValue()));
     117                concat.toRight((Comparable<?>) Expr.concat((Comparable<?>) pair.getKey(), (Comparable<?>) pair
     118                        .getValue()));
    118119            res.assign(concat.yield());
    119120        } catch (ClassCastException _) {
  • to-imperative/trunk/java/runtime/refal/plus/Vector.java

    r3418 r3423  
    77package refal.plus;
    88
    9 import org.refal.plus.*;
    109import java.math.BigInteger;
    1110import java.util.List;
     11
     12import org.refal.plus.Expr;
     13import org.refal.plus.RefalException;
     14import org.refal.plus.RefalFormat;
     15import org.refal.plus.Reference;
     16import org.refal.plus.Result;
     17import org.refal.plus.Symbol;
     18import org.refal.plus.Util;
    1219
    1320public final class Vector {
Note: See TracChangeset for help on using the changeset viewer.