public void IdentifierExpression(CParser.IdentifierExpression IdentifierExpression)
{
var Variable = VariableScope.Find(IdentifierExpression.Identifier);
var Function = FunctionScope.Find(IdentifierExpression.Identifier);
if (Variable != null)
{
// For fixed array types, get always the address?
if (Variable.CType is CArrayType && (Variable.CType as CArrayType).Size != 0)
{
Variable.LoadAddress(SafeILGenerator);
}
else if (GenerateAddress)
{
//Console.WriteLine(" Left");
Variable.LoadAddress(SafeILGenerator);
}
else
{
//Console.WriteLine(" No Left");
Variable.Load(SafeILGenerator);
}
}
else if (Function != null)
{
//SafeILGenerator.Push(Function.MethodInfo);
SafeILGenerator.LoadFunctionPointer(Function.MethodInfo, false);
SafeILGenerator.ConvertTo(typeof(void*));
}
else
{
throw (new Exception(string.Format("Not variable or function for identifier {0}", IdentifierExpression)));
}
}