public DefType ExistsVariable(string name, CodeElement elem) { if (Vars.ExistsVariable(name)) { return(Vars.GetVariable(name).ResultType); } else if (ParentScope != null) { return(ParentScope.ExistsVariable(name, elem)); } else { throw new Exception(string.Format("A variable called '{0}', {1}, does not exists", name, elem.GetLineAndColumn())); } }
public MemberAttr(string type, string member) { { string[] types = type.Split(new char[2] { '[', ']' }); if (types.Length > 1) { m_isArray = true; m_typeName = types[0]; } else { m_isArray = false; m_typeName = type; } } if (m_typeName == "string") { m_isString = true; } else { m_isString = false; } if (Vars.GetStruct(m_typeName) != null) { m_isClass = true; } else { if (Vars.GetVariable(m_typeName) == null) { throw new System.Exception("Idl Incorrect type, type name:" + m_typeName); } m_typeName = Vars.GetVariable(m_typeName); m_isClass = false; } m_varName = member; }