public void CallExp(CallExp e)
    {
	for(int i = 0; i < e.Params.Length; i++){
	    e.Params[i].Visit(this);
	}
	if(e.System){
	    il.Emit(OpCodes.Call, ((typeof(LispRuntime)).GetMethod(e.FunctionName)));
	}
	else{
	    il.Emit(OpCodes.Call, (MethodInfo)Functions[e.FunctionName]);
	}
	
    }
Exemple #2
0
    public void CallExp(CallExp e)
    {
	if (!e.System){
	    if(e.FunctionName == CurrentFuncName){
		for(int i = 0; i < e.Params.Length; i++){
		    e.Params[i].Visit(this);
		}
		
		e.ExpType = typeof(void);            //Recursive Function. Return type unknown.
	    }
	    else{
		FunctionDef f = (FunctionDef)Functions[e.FunctionName];
		for(int i = 0; i < e.Params.Length; i++){
		    e.Params[i].Visit(this);
		    CheckAny(ref e.Params[i], (Type)f.Params[i]);
		}
		e.ExpType = f.ExpType;
	    }
	}
	else{
	    FunctionDef f = (FunctionDef)Functions[e.FunctionName];
	    for (int i = 0; i < e.Params.Length; i++){
		e.Params[i].Visit(this);
		CheckAny(ref e.Params[i], (Type)f.Params[i]);
	    }
	    //ExpType of System functions is set while parsing itself.
	    //e.ExpType = (Type)Functions[e.FunctionName];
	}
	
    }