private IBoundExpression ResolveProceduralModule(bool lExpressionIsEnclosingProject, IBoundExpression lExpression, string name, Declaration referencedProject) { /* * The project has an accessible procedural module named <unrestricted-name>. In this case, the * member access expression is classified as a procedural module and refers to the specified * procedural module. */ if (lExpressionIsEnclosingProject) { if (_module.DeclarationType == DeclarationType.ProceduralModule && _declarationFinder.IsMatch(_module.IdentifierName, name)) { return(new MemberAccessExpression(_module, ExpressionClassification.ProceduralModule, _expression, _unrestrictedNameContext, lExpression)); } var proceduralModuleEnclosingProject = _declarationFinder.FindModuleEnclosingProjectWithoutEnclosingModule(_project, _module, name, DeclarationType.ProceduralModule); if (proceduralModuleEnclosingProject != null) { return(new MemberAccessExpression(proceduralModuleEnclosingProject, ExpressionClassification.ProceduralModule, _expression, _unrestrictedNameContext, lExpression)); } } else { var proceduralModuleInReferencedProject = _declarationFinder.FindModuleReferencedProject(_project, _module, referencedProject, name, DeclarationType.ProceduralModule); if (proceduralModuleInReferencedProject != null) { return(new MemberAccessExpression(proceduralModuleInReferencedProject, ExpressionClassification.ProceduralModule, _expression, _unrestrictedNameContext, lExpression)); } } return(null); }
private IBoundExpression ResolveReferencedProject(string name) { /* Namespace tier 4: * Referenced Project namespace: An accessible procedural module or class module contained in * a referenced project. */ var accessibleModule = _declarationFinder.FindModuleReferencedProject(_project, _module, name, DeclarationType.ProceduralModule); if (accessibleModule != null) { return(new SimpleNameExpression(accessibleModule, ExpressionClassification.ProceduralModule, _expression)); } var accessibleClass = _declarationFinder.FindModuleReferencedProject(_project, _module, name, DeclarationType.ClassModule); if (accessibleClass != null) { return(new SimpleNameExpression(accessibleClass, ExpressionClassification.Type, _expression)); } return(null); }
private IBoundExpression ResolveReferencedProjectNamespace() { /* Namespace tier 5: * Referenced Project namespace: An accessible procedural module contained in a referenced * project. */ var accessibleModule = _declarationFinder.FindModuleReferencedProject(_project, _module, _name, DeclarationType.ProceduralModule); if (accessibleModule != null) { return(new SimpleNameExpression(accessibleModule, ExpressionClassification.ProceduralModule, _context)); } var defaultInstanceVariableClass = _declarationFinder.FindDefaultInstanceVariableClassReferencedProject(_project, _module, _name); if (defaultInstanceVariableClass != null) { return(new SimpleNameExpression(defaultInstanceVariableClass, ExpressionClassification.Type, _context)); } return(null); }
private IBoundExpression ResolveProceduralModule(bool lExpressionIsEnclosingProject, Declaration referencedProject) { if (lExpressionIsEnclosingProject) { if (_module.DeclarationType == DeclarationType.ProceduralModule && _declarationFinder.IsMatch(_module.IdentifierName, _name)) { return(new MemberAccessExpression(_module, ExpressionClassification.ProceduralModule, _context, _unrestrictedNameContext, _lExpression)); } var proceduralModuleEnclosingProject = _declarationFinder.FindModuleEnclosingProjectWithoutEnclosingModule(_project, _module, _name, DeclarationType.ProceduralModule); if (proceduralModuleEnclosingProject != null) { return(new MemberAccessExpression(proceduralModuleEnclosingProject, ExpressionClassification.ProceduralModule, _context, _unrestrictedNameContext, _lExpression)); } } else { var proceduralModuleInReferencedProject = _declarationFinder.FindModuleReferencedProject(_project, _module, referencedProject, _name, DeclarationType.ProceduralModule); if (proceduralModuleInReferencedProject != null) { return(new MemberAccessExpression(proceduralModuleInReferencedProject, ExpressionClassification.ProceduralModule, _context, _unrestrictedNameContext, _lExpression)); } } return(null); }