001 package escjava.vcGeneration;
002
003 // bool * bool -> bool
004 abstract class TBoolOp extends TBoolRes {
005
006 public TBoolOp(){
007 type = _boolean;
008 }
009
010 protected void typeTree(){
011
012 /*
013 * Semantic control : each son should have type 'boolean'
014 */
015
016 for(int i = 0; i <= sons.size() - 1; i++){
017 TNode nodeTemp = getChildAt(i);
018
019 if(nodeTemp.type != null) {
020 if(!nodeTemp.type.equals(_boolean)) {
021 System.err.println("*** Typecheck error in the tree of ifpvc");
022
023 /*
024 * Print all sons
025 */
026 System.err.println("Node : "+this.toString());
027 System.err.println("should have all sons with type boolean");
028 System.err.println("List of sons :");
029
030 for(int j = 0; j <= sons.size() - j; j++)
031 System.err.println("Node : "+getChildAt(j).toString());
032 }
033 }
034 else // type has not been set, setting it
035 nodeTemp.setType(_boolean, true);
036
037 nodeTemp.typeTree();
038 }
039
040 }
041 }