@@ -4475,7 +4475,8 @@ else if (operator.equals("->restrict"))
44754475 else if (operator.equals("->including") ||
44764476 operator.equals("->prepend") ||
44774477 operator.equals("->append"))
4478- { Type newleftET = Type.refineType(etleft,right.getType());
4478+ { Type newleftET =
4479+ Type.refineType(etleft,right.getType());
44794480 System.out.println(">> Deduced element type of " + this + " = " + newleftET);
44804481 elementType = newleftET;
44814482 if (type == null)
@@ -4651,7 +4652,7 @@ private void tcMathOps(Type tleft, Type tright,
46514652 else
46524653 { type = Expression.deduceType(operator,left,right);
46534654
4654- System.err.println("Warning!: arguments must be numeric in: " + this + ". Deduced type: " + type);
4655+ System.err.println("! Warning!: arguments must be numeric in: " + this + " Deduced type: " + type);
46554656 if (type == null)
46564657 { JOptionPane.showMessageDialog(null, "Arguments not numeric in: " + this,
46574658 "Type error", JOptionPane.ERROR_MESSAGE);
@@ -4665,14 +4666,14 @@ else if (tlname.equals("long") || trname.equals("long"))
46654666 else if (trname.equals("int") && trname.equals("int"))
46664667 { type = new Type("int",null); }
46674668 else
4668- { System.err.println("TYPE ERROR: invalid types " + tlname + " " + trname + " in: " + this);
4669+ { System.err.println("!! TYPE ERROR: invalid types " + tlname + " " + trname + " in: " + this);
46694670 type = new Type("int", null);
46704671 }
46714672 }
46724673 else
46734674 { type = Expression.deduceType(operator,left,right);
46744675
4675- System.err.println("TYPE ERROR: invalid types " + tleft + " " + tright + " in: " + this + ". Deduced type " + type);
4676+ System.err.println("!! TYPE ERROR: invalid types " + tleft + " " + tright + " in: " + this + ". Deduced type " + type);
46764677 JOptionPane.showMessageDialog(null, "Missing types in: " + this,
46774678 "Type error", JOptionPane.ERROR_MESSAGE);
46784679 if (tleft != null)
@@ -4699,14 +4700,19 @@ private void tcLogical(Type tleft, Type tright,
46994700 if (tlname.equals("boolean") && trname.equals("boolean"))
47004701 { }
47014702 else
4702- { System.err.println("Warning: invalid types in: " + this);
4703+ { System.err.println("! Warning: invalid types " + tlname + " " + trname + " in: " + this);
47034704 JOptionPane.showMessageDialog(null, "Arguments must be booleans: " + this,
47044705 "Type error", JOptionPane.ERROR_MESSAGE);
4706+ if ("int".equals(tlname) && "int".equals(trname))
4707+ { // bitwise operator
4708+ System.err.println("!! Bitwise operator expected here !!");
4709+ type = new Type("int", null);
4710+ }
47054711 }
47064712 type = new Type("boolean",null);
47074713 }
47084714 else
4709- { System.err.println("TYPE ERROR: invalid types in: " + this);
4715+ { System.err.println("!! TYPE ERROR: invalid types in: " + this);
47104716 JOptionPane.showMessageDialog(null, "Missing types in: " + this,
47114717 "Type error", JOptionPane.ERROR_MESSAGE);
47124718 }
@@ -18172,8 +18178,16 @@ public Expression featureAdding2(String var, Vector remainder)
1817218178 public int syntacticComplexity()
1817318179 { int res = left.syntacticComplexity();
1817418180 res = res + right.syntacticComplexity();
18175- if (operator.equals("#") || operator.equals("#1") || operator.equals("#LC") || operator.equals("!") ||
18176- operator.equals("|") || operator.equals("|R") || operator.equals("|C"))
18181+ if (operator.equals("#") || operator.equals("#1") ||
18182+ operator.equals("#LC") || operator.equals("!") ||
18183+ operator.equals("|") || operator.equals("|R") ||
18184+ operator.equals("|C") ||
18185+ operator.equals("|A") ||
18186+ operator.equals("|intersectAll") ||
18187+ operator.equals("|unionAll") ||
18188+ operator.equals("|selectMinimals") ||
18189+ operator.equals("|selectMaximals")
18190+ )
1817718191 { return res; }
1817818192
1817918193 if (operator.equals("->iterate"))
@@ -18189,9 +18203,11 @@ public int syntacticComplexity()
1818918203 }
1819018204
1819118205 public int cyclomaticComplexity()
18192- { if (operator.equals("#") || operator.equals("#1") || operator.equals("#LC") || operator.equals("!"))
18206+ { if (operator.equals("#") || operator.equals("#1") ||
18207+ operator.equals("#LC") || operator.equals("!"))
1819318208 { return right.cyclomaticComplexity(); }
18194- else if (operator.equals("&") || operator.equals("or") || operator.equals("=>"))
18209+ else if (operator.equals("&") ||
18210+ operator.equals("or") || operator.equals("=>"))
1819518211 { return left.cyclomaticComplexity() + right.cyclomaticComplexity(); }
1819618212
1819718213 if (operator.equals("->iterate"))
0 commit comments