public static GetEntryPoint ( CompilerContext context ) : |
||
context | CompilerContext | |
return |
private void BindAllParameters() { Method entryPoint = ContextAnnotations.GetEntryPoint(Context); foreach (INodeWithParameters node in _parameters) { var member = (TypeMember)node; if (member.ContainsAnnotation(PrivateMemberNeverUsed)) { continue; } NameResolutionService.EnterNamespace((INamespace)TypeSystemServices.GetEntity(member.DeclaringType)); CodeBuilder.BindParameterDeclarations(member.IsStatic, node); if (!member.IsVisible && !member.IsSynthetic) { IExplicitMember explicitMember = member as IExplicitMember; if (null != explicitMember && null != explicitMember.ExplicitInfo) { continue; } if (member == entryPoint) //private Main is fine { continue; } member.Annotate(PrivateMemberNeverUsed, null); } } }
private void CheckEntryPoint() { Method method = ContextAnnotations.GetEntryPoint(Context); if (null == method) { return; } IMethod entity = (IMethod)TypeSystemServices.GetEntity(method); if (IsValidEntryPointReturnType(entity.ReturnType) && IsValidEntryPointParameterList(entity.GetParameters())) { return; } Errors.Add(CompilerErrorFactory.InvalidEntryPoint(method)); }
private bool HasEntryPoint() { return(ContextAnnotations.GetEntryPoint(Context) != null); }