private void InitializeVariableIfNeeded(FilePosition fp, Variable variable) { IrisType varType = variable.Type; if (varType.IsArray || varType == IrisType.String) { // Variable needs to be initialized. Symbol varSymbol = _symbolTable.Lookup(variable.Name); if (varType.IsArray) { MethodGenerator.InitArray(varSymbol, variable.SubRange); if (varType.GetElementType() == IrisType.String) { // String arary - initialize all elements EmitLoadSymbol(varSymbol, SymbolLoadMode.Raw); Symbol initProc = LookupSymbol(fp, "$.initstrarray"); MethodGenerator.Call(initProc); } } else { // String Symbol emptyStr = LookupSymbol(fp, "$.emptystr"); MethodGenerator.PushGlobal(emptyStr); EmitStoreSymbol(varSymbol); } MethodGenerator.EmitDeferredInstructions(); } }