public override SyntaxNode Visit(WorkspaceSyntax pNode) { _consts = new Dictionary <string, IdentifierSyntax>(StringComparer.OrdinalIgnoreCase); foreach (var c in pNode.Consts) { _consts.Add(c.Identifier.Value, c.Value); } return(base.Visit(pNode)); }
public override void Visit(WorkspaceSyntax pNode) { foreach (var i in pNode.Imports) { i.Accept(this); } //We need to register all types since structs could have fields of other types foreach (var s in pNode.Structs) { var st = SmallType.RegisterType("", s.Prefix, true, s.TypeArgs); if (s.Initializer != null) { st.SetInitializer(new InitializerInfo(s.Initializer)); } } foreach (var s in pNode.Structs) { s.Accept(this); } foreach (var m in pNode.Methods) { m.Accept(this); } foreach (var c in pNode.Casts) { c.Accept(this); } if (!_mainFound && _mainRequired) { Compiler.ReportError(CompilerErrorType.NoRun, new TextSpan()); } MetadataCache.AddImplicitCasts(); }
protected override void VisitWorkspaceSyntax(WorkspaceSyntax pNode) { _mainModule = pNode.Module; base.VisitWorkspaceSyntax(pNode); }
protected virtual void VisitWorkspaceSyntax(WorkspaceSyntax pNode) { Visit(pNode.Module); }
public static CompilationModule Build(WorkspaceSyntax pWorkspace) { var module = BuildInternal(pWorkspace.Module, null); return(module); }
protected virtual SyntaxNode VisitWorkspaceSyntax(WorkspaceSyntax pNode) { return(SyntaxFactory.Workspace(pNode.Name, (ModuleSyntax)Visit(pNode.Module))); }