private IBoundExpression ResolveMemberInModule(IBoundExpression lExpression, string name, Declaration module, DeclarationType memberType) { /* * <l-expression> is classified as a procedural module or a type referencing a class defined in a * class module, and one of the following is true: * * This module has an accessible UDT or Enum definition named <unrestricted-name>. In this * case, the member access expression is classified as a type and refers to the specified UDT or * Enum type. */ var enclosingProjectType = _declarationFinder.FindMemberEnclosedProjectInModule(_project, _module, _parent, module, name, memberType); if (enclosingProjectType != null) { return(new MemberAccessExpression(enclosingProjectType, ExpressionClassification.Type, _expression, _unrestrictedNameContext, lExpression)); } var referencedProjectType = _declarationFinder.FindMemberReferencedProjectInModule(_project, _module, _parent, module, name, memberType); if (referencedProjectType != null) { return(new MemberAccessExpression(referencedProjectType, ExpressionClassification.Type, _expression, _unrestrictedNameContext, lExpression)); } return(null); }
private IBoundExpression ResolveMemberInModule(Declaration module, DeclarationType memberType, ExpressionClassification classification) { var enclosingProjectType = _declarationFinder.FindMemberEnclosedProjectInModule(_project, _module, _parent, module, _name, memberType); if (enclosingProjectType != null) { return(new MemberAccessExpression(enclosingProjectType, classification, _context, _unrestrictedNameContext, _lExpression)); } var referencedProjectType = _declarationFinder.FindMemberReferencedProjectInModule(_project, _module, _parent, module, _name, memberType); if (referencedProjectType != null) { return(new MemberAccessExpression(referencedProjectType, classification, _context, _unrestrictedNameContext, _lExpression)); } return(null); }
private IBoundExpression ResolveMemberInModule(IBoundExpression lExpression, string name, Declaration module, DeclarationType memberType, ExpressionClassification classification) { /* * A member access expression under the procedure pointer binding context is valid only if <l- * expression> is classified as a procedural module, this procedural module has an accessible function * or subroutine with the same name value as <unrestricted-name>, and <unrestricted-name> either * does not specify a type character or specifies a type character whose associated type matches the * declared type of the function or subroutine. In this case, the member access expression is classified * as a function or subroutine, respectively. */ // AddressOf is only allowed in the same project. See The "procedure pointer binding context" for "simple name expressions" section in the MS-VBAL document. var enclosingProjectType = _declarationFinder.FindMemberEnclosedProjectInModule(_project, _module, _parent, module, name, memberType); if (enclosingProjectType != null) { return(new MemberAccessExpression(enclosingProjectType, classification, _expression, _unrestrictedNameContext, lExpression)); } return(null); }