Changeset 3418
- Timestamp:
- Feb 20, 2008, 7:44:03 PM (13 years ago)
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
devel-tools/trunk/eclipse/org.refal.plus.rfpdt/src/org/refal/plus/rfpdt/core/builder/RfpBuilder.java
r3389 r3418 263 263 * org.eclipse.core.runtime.IProgressMonitor) 264 264 */ 265 @SuppressWarnings("unchecked") 265 266 @Override 266 @SuppressWarnings("unchecked")267 267 protected IProject[] build (int kind, Map args, IProgressMonitor monitor) throws CoreException { 268 268 if (kind == FULL_BUILD) -
to-imperative/trunk/java/runtime/org/refal/plus/Symbol.java
r3404 r3418 18 18 19 19 public static final Comparable null_object = new Reference(null); 20 21 public static Comparable valueOf (boolean b) {22 return String.valueOf(b);23 }24 25 public static Comparable valueOf (char c) {26 return Character.valueOf(c);27 }28 29 public static Comparable valueOf (byte b) {30 return BigInteger.valueOf(b);31 }32 33 public static Comparable valueOf (int i) {34 return BigInteger.valueOf(i);35 }36 37 public static Comparable valueOf (long l) {38 return BigInteger.valueOf(l);39 }40 41 public static Comparable valueOf (short s) {42 return BigInteger.valueOf(s);43 }44 45 public static boolean booleanValue (Comparable c) {46 return Boolean.parseBoolean((String) c);47 }48 49 public static char charValue (Comparable c) {50 return ((Character) c).charValue();51 }52 53 public static byte byteValue (Comparable c) {54 return ((BigInteger) c).byteValue();55 }56 57 public static int intValue (Comparable c) {58 return ((BigInteger) c).intValue();59 }60 61 public static long longValue (Comparable c) {62 return ((BigInteger) c).longValue();63 }64 65 public static short shortValue (Comparable c) {66 return ((BigInteger) c).shortValue();67 }68 20 69 21 public static Comparable newInt (String str) { -
to-imperative/trunk/java/runtime/refal/plus/String.java
r2882 r3418 14 14 private String () {} 15 15 16 @SuppressWarnings("unchecked") 16 17 private static void string (StringBuffer strbuf, Expr src) { 17 for (Comparable obj : src) {18 for (Comparable<?> obj : src) { 18 19 if (obj instanceof Character) 19 20 strbuf.append((Character) obj); … … 25 26 } 26 27 28 @SuppressWarnings("all") 27 29 @RefalFormat("$func String e.Source = s.String;") 28 30 public static void String (Expr src, Result res) throws RefalException { … … 36 38 } 37 39 40 @SuppressWarnings("unchecked") 38 41 @RefalFormat("$func StringInit s.String s.Len s.Fill = ;") 39 42 public static void StringInit (Expr str, Expr len, Expr fill) throws RefalException { … … 57 60 } 58 61 62 @SuppressWarnings("unchecked") 59 63 @RefalFormat("$func StringFill s.String s.Fill = ;") 60 64 public static void StringFill (Expr str, Expr fill) throws RefalException { … … 72 76 } 73 77 78 @SuppressWarnings("unchecked") 74 79 @RefalFormat("$func StringLength s.String = s.Len;") 75 80 public static void StringLength (Expr str, Result res) throws RefalException { … … 83 88 } 84 89 90 @SuppressWarnings("unchecked") 85 91 @RefalFormat("$func StringRef s.String s.Index = s.Char;") 86 92 public static void StringRef (Expr str, Expr idx, Result res) throws RefalException { … … 102 108 } 103 109 110 @SuppressWarnings("unchecked") 104 111 @RefalFormat("$func StringSet s.String s.Index s.Char = ;") 105 112 public static void StringSet (Expr str, Expr idx, Expr ch) throws RefalException { … … 122 129 } 123 130 131 @SuppressWarnings("unchecked") 124 132 @RefalFormat("$func StringReplace s.String e.Source = ;") 125 133 public static void StringReplace (Expr str, Expr src) throws RefalException { … … 134 142 } 135 143 144 @SuppressWarnings("unchecked") 136 145 @RefalFormat("$func Substring s.String s.Index s.Len = s.NewString;") 137 146 public static void Substring (Expr str, Expr idx, Expr len, Result res) throws RefalException { … … 157 166 } 158 167 168 @SuppressWarnings("unchecked") 159 169 @RefalFormat("$func SubstringFill s.String s.Index s.Len s.Fill = ;") 160 170 public static void SubstringFill (Expr str, Expr idx, Expr len, Expr fill) throws RefalException { -
to-imperative/trunk/java/runtime/refal/plus/Table.java
r2888 r3418 7 7 package refal.plus; 8 8 9 import org.refal.plus.*;10 11 9 import java.math.BigInteger; 12 10 import java.util.Collection; 13 11 import java.util.Map; 12 import java.util.Set; 13 14 import org.refal.plus.Expr; 15 import org.refal.plus.RefalException; 16 import org.refal.plus.RefalFormat; 17 import org.refal.plus.Reference; 18 import org.refal.plus.Result; 19 import org.refal.plus.Symbol; 14 20 15 21 public final class Table { … … 17 23 private Table () {} 18 24 25 @SuppressWarnings("all") 19 26 @RefalFormat("$func Table = s.Tab;") 20 27 public static void Table (Result res) { … … 22 29 } 23 30 31 @SuppressWarnings("unchecked") 24 32 @RefalFormat("$func Bind s.Tab (e.Key) (e.Val) = ;") 25 33 public static void Bind (Expr tab, Expr key, Expr val) throws RefalException { … … 32 40 } 33 41 42 @SuppressWarnings("unchecked") 34 43 @RefalFormat("$func Unbind s.Tab e.Key = ;") 35 44 public static void Unbind (Expr tab, Expr key) throws RefalException { … … 42 51 } 43 52 53 @SuppressWarnings("unchecked") 44 54 @RefalFormat("$func? Lookup s.Tab e.Key = e.Val;") 45 55 public static boolean Lookup (Expr tab, Expr key, Result val) throws RefalException { … … 56 66 } 57 67 68 @SuppressWarnings("unchecked") 58 69 @RefalFormat("$func? IsInTable s.Tab e.Key = ;") 59 70 public static boolean IsInTable (Expr tab, Expr key) throws RefalException { … … 66 77 } 67 78 79 @SuppressWarnings("unchecked") 68 80 @RefalFormat("$func Domain s.Tab = e.KeyList;") 69 81 public static void Domain (Expr tab, Result res) throws RefalException { 70 82 assert tab.length() == 1; 71 83 try { 72 Collection<Expr> c = ((Reference<Map<Expr, Expr>>) tab.at(0)).object.keySet();84 Set<Expr> c = ((Reference<Map<Expr, Expr>>) tab.at(0)).object.keySet(); 73 85 Expr.Concatenator concat = Expr.getConcatenator(c.size()); 74 86 for (Expr expr : c) 75 concat.toRight((Comparable ) expr);87 concat.toRight((Comparable<Expr>) expr); 76 88 res.assign(concat.yield()); 77 89 } catch (ClassCastException _) { … … 80 92 } 81 93 94 @SuppressWarnings("unchecked") 82 95 @RefalFormat("$func Values s.Tab = e.ValueList;") 83 96 public static void Values (Expr tab, Result res) throws RefalException { … … 87 100 Expr.Concatenator concat = Expr.getConcatenator(c.size()); 88 101 for (Expr expr : c) 89 concat.toRight((Comparable ) expr);102 concat.toRight((Comparable<Expr>) expr); 90 103 res.assign(concat.yield()); 91 104 } catch (ClassCastException _) { … … 94 107 } 95 108 109 @SuppressWarnings("unchecked") 96 110 @RefalFormat("$func Entries s.Tab = e.KeyValuePairs;") 97 111 public static void Entries (Expr tab, Result res) throws RefalException { … … 101 115 Expr.Concatenator concat = Expr.getConcatenator(map.size()); 102 116 for (Map.Entry<Expr, Expr> pair : map.entrySet()) 103 concat.toRight((Comparable ) Expr.concat((Comparable) pair.getKey(), (Comparable) pair.getValue()));117 concat.toRight((Comparable<Expr>) Expr.concat((Comparable<Expr>) pair.getKey(), (Comparable<Expr>) pair.getValue())); 104 118 res.assign(concat.yield()); 105 119 } catch (ClassCastException _) { … … 108 122 } 109 123 124 @SuppressWarnings("unchecked") 110 125 @RefalFormat("$func TableCopy s.Tab = s.TabCopy;") 111 126 public static void TableCopy (Expr tab, Result res) throws RefalException { … … 120 135 } 121 136 137 @SuppressWarnings("unchecked") 122 138 @RefalFormat("$func ReplaceTable s.TargetTab s.SourceTab = ;") 123 139 public static void ReplaceTable (Expr target, Expr source) throws RefalException { … … 133 149 } 134 150 151 @SuppressWarnings("unchecked") 135 152 @RefalFormat("$func ClearTable s.Tab = ;") 136 153 public static void ClearTable (Expr tab) throws RefalException { … … 143 160 } 144 161 162 @SuppressWarnings("unchecked") 145 163 @RefalFormat("$func TableSize s.Tab = s.Size;") 146 164 public static void TableSize (Expr tab, Result res) throws RefalException { -
to-imperative/trunk/java/runtime/refal/plus/Vector.java
r2888 r3418 15 15 private Vector () {} 16 16 17 @SuppressWarnings("unchecked") 17 18 private static void vector (List<Expr> list, Expr src) { 18 for (Comparable obj : src) {19 for (Comparable<?> obj : src) { 19 20 if (obj instanceof Expr) 20 21 list.add((Expr) obj); … … 24 25 } 25 26 27 @SuppressWarnings("all") 26 28 @RefalFormat("$func Vector e.Source = s.Vector;") 27 29 public static void Vector (Expr src, Result res) throws RefalException { … … 35 37 } 36 38 39 @SuppressWarnings("unchecked") 37 40 @RefalFormat("$func VectorToExp s.Vector = e.Exp;") 38 41 public static void VectorToExp (Expr vec, Result res) { … … 45 48 } 46 49 50 @SuppressWarnings("unchecked") 47 51 @RefalFormat("$func VectorInit s.Vector s.Len e.Fill = ;") 48 52 public static void VectorInit (Expr vec, Expr len, Expr fill) throws RefalException { … … 64 68 } 65 69 70 @SuppressWarnings("unchecked") 66 71 @RefalFormat("$func VectorFill s.Vector e.Fill = ;") 67 72 public static void VectorFill (Expr vec, Expr fill) throws RefalException { … … 77 82 } 78 83 84 @SuppressWarnings("unchecked") 79 85 @RefalFormat("$func VectorLength s.Vector = s.Len;") 80 86 public static void VectorLength (Expr vec, Result res) throws RefalException { … … 88 94 } 89 95 96 @SuppressWarnings("unchecked") 90 97 @RefalFormat("$func VectorRef s.Vector s.Index = e.Exp;") 91 98 public static void VectorRef (Expr vec, Expr idx, Result res) throws RefalException { … … 106 113 } 107 114 115 @SuppressWarnings("unchecked") 108 116 @RefalFormat("$func VectorSet s.Vector s.Index e.Exp = ;") 109 117 public static void VectorSet (Expr vec, Expr idx, Expr e) throws RefalException { … … 124 132 } 125 133 134 @SuppressWarnings("unchecked") 126 135 @RefalFormat("$func VectorReplace s.Vector e.Source = ;") 127 136 public static void VectorReplace (Expr vec, Expr src) throws RefalException { … … 136 145 } 137 146 147 @SuppressWarnings("unchecked") 138 148 @RefalFormat("$func Subvector s.Vector s.Index s.Len = s.NewVector;") 139 149 public static void Subvector (Expr vec, Expr idx, Expr len, Result res) throws RefalException { … … 157 167 } 158 168 169 @SuppressWarnings("unchecked") 159 170 @RefalFormat("$func SubvectorFill s.Vector s.Index s.Len e.Fill = ;") 160 171 public static void SubvectorFill (Expr vec, Expr idx, Expr len, Expr fill) throws RefalException {
Note: See TracChangeset
for help on using the changeset viewer.