Changeset 3423
- Timestamp:
- Feb 22, 2008, 8:28:43 PM (13 years ago)
- 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 7 7 package refal.plus; 8 8 9 import org.refal.plus.*;10 9 import java.math.BigInteger; 10 11 import org.refal.plus.Expr; 12 import org.refal.plus.RefalException; 13 import org.refal.plus.RefalFormat; 14 import org.refal.plus.Result; 15 import org.refal.plus.Util; 11 16 12 17 public final class Access { -
to-imperative/trunk/java/runtime/refal/plus/Apply.java
r3419 r3423 7 7 package refal.plus; 8 8 9 import org.refal.plus.*; 9 import org.refal.plus.Expr; 10 import org.refal.plus.Func; 11 import org.refal.plus.RefalException; 12 import org.refal.plus.RefalFormat; 13 import org.refal.plus.Result; 10 14 11 15 public final class Apply { -
to-imperative/trunk/java/runtime/refal/plus/Arithm.java
r2882 r3423 7 7 package refal.plus; 8 8 9 import org.refal.plus.*;10 9 import java.math.BigInteger; 10 11 import org.refal.plus.Expr; 12 import org.refal.plus.RefalException; 13 import org.refal.plus.RefalFormat; 14 import org.refal.plus.Result; 11 15 12 16 public final class Arithm { … … 101 105 } 102 106 } 103 107 104 108 @RefalFormat("$func Abs s.Int = s.Int;") 105 109 public static void Abs (Expr s, Result res) throws RefalException { … … 111 115 } 112 116 } 113 114 117 115 118 @RefalFormat("$func Max s.Int1 s.Int2 = s.Max;") -
to-imperative/trunk/java/runtime/refal/plus/Bit.java
r2882 r3423 7 7 package refal.plus; 8 8 9 import org.refal.plus.*;9 import java.lang.System; 10 10 import java.math.BigInteger; 11 import java.lang.System; 11 12 import org.refal.plus.Expr; 13 import org.refal.plus.RefalException; 14 import org.refal.plus.RefalFormat; 15 import org.refal.plus.Result; 16 import org.refal.plus.Util; 12 17 13 18 public final class Bit { -
to-imperative/trunk/java/runtime/refal/plus/Box.java
r3419 r3423 7 7 package refal.plus; 8 8 9 import org.refal.plus.*; 9 import org.refal.plus.Expr; 10 import org.refal.plus.RefalException; 11 import org.refal.plus.RefalFormat; 12 import org.refal.plus.Result; 10 13 11 14 public final class Box { -
to-imperative/trunk/java/runtime/refal/plus/Class.java
r3419 r3423 7 7 package refal.plus; 8 8 9 import org.refal.plus.*;9 import java.lang.String; 10 10 import java.util.List; 11 11 import java.util.Map; 12 import java.lang.String; 12 13 import org.refal.plus.Expr; 14 import org.refal.plus.RefalFormat; 15 import org.refal.plus.Reference; 13 16 14 17 public final class Class { -
to-imperative/trunk/java/runtime/refal/plus/Compare.java
r3419 r3423 7 7 package refal.plus; 8 8 9 import org.refal.plus.*; 9 import org.refal.plus.Expr; 10 import org.refal.plus.RefalFormat; 11 import org.refal.plus.Result; 10 12 11 13 public final class Compare { … … 17 19 private static final Expr eq = new Expr(new Character('=')); 18 20 21 /** @return: '<', '>', '=' */ 19 22 @SuppressWarnings("all") 20 @RefalFormat("$func Compare (e.Exp1) (e.Exp2) = s.Res;") // '<', '>', '='23 @RefalFormat("$func Compare (e.Exp1) (e.Exp2) = s.Res;") 21 24 public static void Compare (Expr a, Expr b, Result res) { 22 25 int r = a.compareTo(b); -
to-imperative/trunk/java/runtime/refal/plus/Convert.java
r2888 r3423 7 7 package refal.plus; 8 8 9 import org.refal.plus.*;9 import java.lang.String; 10 10 import java.math.BigInteger; 11 import java.lang.String; 11 12 import org.refal.plus.Expr; 13 import org.refal.plus.RefalException; 14 import org.refal.plus.RefalFormat; 15 import org.refal.plus.Result; 12 16 13 17 public class Convert { … … 101 105 // ///////////////////// Begining of generated part /////////////////// 102 106 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()); 118 128 } 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; 128 130 } 129 return true;130 }131 131 132 // ///////////////////// End of generated part ///////////////////132 // ///////////////////// End of generated part /////////////////// 133 133 134 134 } -
to-imperative/trunk/java/runtime/refal/plus/Dir.java
r2882 r3423 7 7 package refal.plus; 8 8 9 import org.refal.plus.*;10 9 import java.io.File; 11 10 import java.lang.String; 11 12 import org.refal.plus.Expr; 13 import org.refal.plus.RefalException; 14 import org.refal.plus.RefalFormat; 15 import org.refal.plus.RefalRuntime; 16 import org.refal.plus.Result; 12 17 13 18 public final class Dir implements Comparable<Dir> { -
to-imperative/trunk/java/runtime/refal/plus/Dos.java
r3419 r3423 7 7 package refal.plus; 8 8 9 import org.refal.plus.*;10 9 import java.lang.System; 11 10 import java.math.BigInteger; … … 13 12 import java.util.Random; 14 13 14 import org.refal.plus.Expr; 15 import org.refal.plus.RefalException; 16 import org.refal.plus.RefalFormat; 17 import org.refal.plus.RefalRuntime; 18 import org.refal.plus.Result; 19 import org.refal.plus.Util; 20 15 21 public 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" }; 20 24 21 25 private static final Character space = new Character(' '); … … 24 28 25 29 @RefalFormat("$func Time = e.String;") 26 public static void Time (Result e) 27 { 30 public static void Time (Result e) { 28 31 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) }; 44 37 e.assign(Expr.fromArray(time)); 45 38 } … … 96 89 } 97 90 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 99 93 public static void Random (Expr max, Result rand) throws RefalException { 100 94 assert max.length() == 1; -
to-imperative/trunk/java/runtime/refal/plus/File.java
r2882 r3423 7 7 package refal.plus; 8 8 9 import org.refal.plus.*;10 import java.math.BigInteger;11 9 import java.lang.String; 12 10 import java.lang.System; 11 import java.math.BigInteger; 12 13 import org.refal.plus.Expr; 14 import org.refal.plus.RefalException; 15 import org.refal.plus.RefalFormat; 16 import org.refal.plus.Result; 13 17 14 18 public final class File { … … 16 20 private File () {} 17 21 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))); 20 26 21 @RefalFormat("$box DirSeparator;") // Ex: '/' or '\\' 27 /** {@value} Ex: '/' or '\\' */ 28 @RefalFormat("$box DirSeparator;") 22 29 public static final Expr DirSeparator = new Expr(new org.refal.plus.Box(new Character(java.io.File.separatorChar))); 23 30 -
to-imperative/trunk/java/runtime/refal/plus/Java.java
r2882 r3423 7 7 package refal.plus; 8 8 9 import org.refal.plus.*; 9 import org.refal.plus.Expr; 10 import org.refal.plus.RefalFormat; 11 import org.refal.plus.Result; 12 import org.refal.plus.Symbol; 10 13 11 14 public final class Java { -
to-imperative/trunk/java/runtime/refal/plus/StdIO.java
r3075 r3423 7 7 package refal.plus; 8 8 9 import org.refal.plus.*;10 11 import java.io.*;12 9 import java.io.File; 10 import java.io.IOException; 13 11 import java.lang.String; 14 12 import java.lang.System; 15 13 import java.math.BigInteger; 14 15 import org.refal.plus.Channel; 16 import org.refal.plus.Expr; 17 import org.refal.plus.Func; 18 import org.refal.plus.RefalException; 19 import org.refal.plus.RefalFormat; 20 import org.refal.plus.Result; 21 import org.refal.plus.Symbol; 16 22 17 23 public class StdIO { … … 600 606 /////////////////////// End of generated part /////////////////// 601 607 602 static {608 static { 603 609 try { 604 610 Result _v_Stream1 = new Result(); -
to-imperative/trunk/java/runtime/refal/plus/String.java
r3418 r3423 7 7 package refal.plus; 8 8 9 import org.refal.plus.*;10 9 import java.math.BigInteger; 10 11 import org.refal.plus.Expr; 12 import org.refal.plus.RefalException; 13 import org.refal.plus.RefalFormat; 14 import org.refal.plus.Reference; 15 import org.refal.plus.Result; 16 import org.refal.plus.Symbol; 17 import org.refal.plus.Util; 11 18 12 19 public final class String { -
to-imperative/trunk/java/runtime/refal/plus/System.java
r3419 r3423 7 7 package refal.plus; 8 8 9 import org.refal.plus.*; 9 import java.io.BufferedReader; 10 import java.io.IOException; 11 import java.io.InputStream; 12 import java.io.InputStreamReader; 13 import java.lang.String; 10 14 import java.math.BigInteger; 11 import java.io.*; 12 import java.lang.String; 15 16 import org.refal.plus.Expr; 17 import org.refal.plus.RefalException; 18 import org.refal.plus.RefalFormat; 19 import org.refal.plus.Result; 13 20 14 21 public final class System extends Dos { -
to-imperative/trunk/java/runtime/refal/plus/Table.java
r3422 r3423 115 115 Expr.Concatenator concat = Expr.getConcatenator(map.size()); 116 116 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())); 118 119 res.assign(concat.yield()); 119 120 } catch (ClassCastException _) { -
to-imperative/trunk/java/runtime/refal/plus/Vector.java
r3418 r3423 7 7 package refal.plus; 8 8 9 import org.refal.plus.*;10 9 import java.math.BigInteger; 11 10 import java.util.List; 11 12 import org.refal.plus.Expr; 13 import org.refal.plus.RefalException; 14 import org.refal.plus.RefalFormat; 15 import org.refal.plus.Reference; 16 import org.refal.plus.Result; 17 import org.refal.plus.Symbol; 18 import org.refal.plus.Util; 12 19 13 20 public final class Vector {
Note: See TracChangeset
for help on using the changeset viewer.