GetEntryPoint() 공개 정적인 메소드

public static GetEntryPoint ( CompilerContext context ) : Method
context CompilerContext
리턴 Boo.Lang.Compiler.Ast.Method
예제 #1
0
        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);
                }
            }
        }
예제 #2
0
        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));
        }
예제 #3
0
 private bool HasEntryPoint()
 {
     return(ContextAnnotations.GetEntryPoint(Context) != null);
 }