001 package escjava.vcGeneration;
002
003 // float * float -> float
004 abstract class TFloatFun extends TFunction {
005
006 public TFloatFun(){
007 type = _float;
008 }
009
010 protected void typeTree(){
011
012 /*
013 * Semantic control : each son should have type 'float'
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(_float)) {
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 float");
028 System.err.println("List of sons :");
029
030 for(int j = 0; j <= sons.size() - j; i++)
031 System.err.println("Node : "+getChildAt(j).toString());
032 }
033 }
034 else // type has not been set, setting it
035 nodeTemp.setType(_float, true);
036
037 nodeTemp.typeTree();
038 }
039
040 }
041 }
042