예제 #1
0
 protected DeclarationTreeBuilderVisitor(LanguageSyntaxTree syntaxTree, string scriptClassName, bool isSubmission)
 {
     _syntaxTree        = syntaxTree;
     _scriptClassName   = scriptClassName;
     _isSubmission      = isSubmission;
     this.PropertyStack = new Stack <Property>();
 }
예제 #2
0
        public BoundTree(LanguageCompilation compilation, LanguageSyntaxTree syntaxTree, Binder rootBinder, DiagnosticBag diagnostics)
        {
            _compilation = compilation;
            _syntaxTree  = syntaxTree;
            _rootBinder  = rootBinder;
            _diagnostics = diagnostics;

            _boundNodeFactoryVisitorPool = new ObjectPool <BoundNodeFactoryVisitor>(() => Language.CompilationFactory.CreateBoundNodeFactoryVisitor(this), 64);
            _isBindableNodeVisitorPool   = new ObjectPool <IsBindableNodeVisitor>(() => Language.CompilationFactory.CreateIsBindableNodeVisitor(this), 64);
        }
        // Add all active #pragma warn and #nullable directives under trivia into the list, in source code order.
        private static void GetAllPragmaWarningDirectives(LanguageSyntaxTree syntaxTree, ArrayBuilder <IDirectiveTriviaSyntax> directiveList)
        {
            foreach (var directive in syntaxTree.GetRootNode().GetDirectives())
            {
                var d = ((IDirectiveTriviaSyntax)directive).Directive;
                if (d == null)
                {
                    continue;
                }
                // Ignore directives inside disabled code (by #if and #endif)
                if (!d.IsActive)
                {
                    continue;
                }

                switch (d.Kind)
                {
                case DirectiveKind.PragmaWarning:
                case DirectiveKind.Nullable:
                    directiveList.Add((IDirectiveTriviaSyntax)directive);
                    break;
                }
            }
        }
예제 #4
0
 public LineDirectiveMap(LanguageSyntaxTree syntaxTree)
     : base(syntaxTree)
 {
 }
 public PragmaWarningStateMap(LanguageSyntaxTree syntaxTree, bool isGeneratedCode) :
     base(syntaxTree, isGeneratedCode)
 {
 }
예제 #6
0
 public override RootSingleDeclaration CreateDeclarationTree(LanguageSyntaxTree syntaxTree, string scriptClassName, bool isSubmission)
 {
     return(MetaDeclarationTreeBuilderVisitor.ForTree((MetaSyntaxTree)syntaxTree, scriptClassName, isSubmission));
 }
예제 #7
0
 internal MappingBinderFactory(LanguageCompilation compilation, LanguageSyntaxTree syntaxTree)
     : base(compilation, syntaxTree)
 {
     _map = new ConcurrentDictionary <BinderCacheKey, Binder>();
 }
예제 #8
0
 private LexicalSortKey(LanguageSyntaxTree tree, int position, LanguageCompilation compilation)
     : this(tree == null ? -1 : compilation.GetSyntaxTreeOrdinal(tree), position)
 {
 }