public void Visit(TableVariableRowReference variable) { IScopeData codeType; Scope scope = Scope.Current; if (!Scope.Current.IsRegistered(variable.Id)) //If variable doesn't exist we need to register Sematic error { Errors.Add(new UnknownVariableReferenceException(new Semantic.LineInfo(variable.Line.Line, variable.Line.CharacterPosition), variable.Id)); codeType = new ScopeData<TableDescriptor> { Type = new TableDescriptor(null), CodeDomReference = new CodeTypeReference("Table", new CodeTypeReference("3ab508bc-31b8-486f-a10a-4f5714f80a3b")) }; } else if (!Scope.Current.IsTableRowRegistered(variable.Id)) //has to be a row { Errors.Add(new NotTableRowVariableException(new Semantic.LineInfo(variable.Line.Line, variable.Line.CharacterPosition), variable.Id)); codeType = new ScopeData<TableDescriptor> { Type = new TableDescriptor(null), CodeDomReference = new CodeTypeReference("Table", new CodeTypeReference("3ab508bc-31b8-486f-a10a-4f5714f80a3b")) }; } else { scope = Scope.FindScope(variable.Id); codeType = scope.GetScope(variable.Id); } _codeStack.Peek().Scope = codeType; _codeStack.Peek().CodeExpression = scope.CreateExpression(variable.Id); }