public void EmitMain() { var typeId = new TypeIdentifier(Assembly.EntryPoint.DeclaringType); var memberId = new MemberIdentifier(Translator.TypeInfoProvider, Assembly.EntryPoint); var entryPointIdentifier = new QualifiedMemberIdentifier(typeId, memberId); var mainExpression = Translator.FunctionCache.GetExpression(entryPointIdentifier); var astEmitter = (AstEmitter)EntryPointAstEmitter; var mainEmitter = new AstEmitter(this, Formatter, astEmitter.JSIL, astEmitter.TypeSystem, astEmitter.TypeInfo, astEmitter.Configuration, isTopLevel: true); Switch(PrecedingType.TopLevel); if (NeedStaticInit) { Formatter.ConditionalNewLine(); Formatter.WriteRaw("(invoke \"__static_init\")"); Formatter.NewLine(); Formatter.NewLine(); } var body = mainExpression.Body; foreach (var stmt in body.Statements) { mainEmitter.Visit(stmt); Formatter.ConditionalNewLine(); } }
internal virtual void AfterWriteValues(AstEmitter astEmitter) { }
internal virtual void BeforeWriteValues(AstEmitter astEmitter) { }
internal override void BeforeWriteValues(AstEmitter astEmitter) { astEmitter.Formatter.Value(ExportedFunctionName); astEmitter.Formatter.Space(); }