コード例 #1
0
 public BoundNode Bind(LanguageSyntaxNode node, BoundTree boundTree)
 {
     if (boundTree == null)
     {
         boundTree = this.Compilation.GetBoundTree(node);
     }
     return(boundTree.GetUpperBoundNode(node));
 }
コード例 #2
0
 protected virtual BoundNode BindCore(LanguageSyntaxNode node, BoundTree boundTree)
 {
     if (boundTree == null)
     {
         boundTree = this.Compilation.GetBoundTree(node);
     }
     return(boundTree.CreateBoundNode(node, this));
 }
コード例 #3
0
        protected BoundNode(BoundKind kind, BoundTree boundTree, ImmutableArray <object> childBoundNodes, LanguageSyntaxNode syntax, bool hasErrors)
        {
            Debug.Assert(syntax != null);

            _kind      = kind;
            _boundTree = boundTree;
            if (childBoundNodes.All(cbn => cbn is BoundNode))
            {
                _childBoundNodes = childBoundNodes.Cast <BoundNode>().ToImmutableArray();
            }
            else
            {
                _childBoundNodes = childBoundNodes;
            }
            _syntax = syntax;

            if (hasErrors)
            {
                _attributes |= BoundNodeAttributes.HasErrors;
            }
        }
コード例 #4
0
 public BoundStatement BindStatement(LanguageSyntaxNode node, BoundTree boundTree)
 {
     Debug.Assert(Language.SyntaxFacts.IsStatement(node));
     return((BoundStatement)this.Bind(node, boundTree));
 }
コード例 #5
0
 public BoundExpression BindExpression(LanguageSyntaxNode node, BoundTree boundTree)
 {
     Debug.Assert(Language.SyntaxFacts.IsExpression(node));
     return((BoundExpression)this.Bind(node, boundTree));
 }
コード例 #6
0
 public IsBindableNodeVisitor(BoundTree boundTree)
 {
     _boundTree = boundTree;
 }
コード例 #7
0
 public MemberBoundTree(LanguageCompilation compilation, LanguageSyntaxNode root, Binder rootBinder, DiagnosticBag diagnostics)
     : base(compilation, (LanguageSyntaxTree)root.SyntaxTree, rootBinder, diagnostics)
 {
     _parent = null;
     _root   = root;
 }
コード例 #8
0
 internal protected virtual BoundNode CreateBoundNodeForBoundTree(LanguageSyntaxNode node, BoundTree boundTree)
 {
     if (Language.SyntaxFacts.IsExpression(node))
     {
         return(this.BindExpressionCore(node, boundTree));
     }
     else if (Language.SyntaxFacts.IsStatement(node))
     {
         return(this.BindStatementCore(node, boundTree));
     }
     else
     {
         return(this.BindCore(node, boundTree));
     }
 }
コード例 #9
0
 protected virtual BoundNode CreateBoundSymbolDefCore(BoundTree boundTree, ImmutableArray <object> childBoundNodes, Type type, LanguageSyntaxNode syntax, bool hasErrors)
 {
     return(new BoundSymbolDef(BoundKind.SymbolDef, boundTree, childBoundNodes, type, syntax, hasErrors));
 }
コード例 #10
0
 protected virtual BoundNode CreateBoundSymbolDef(BoundTree boundTree, ImmutableArray <object> childBoundNodes, Type type, string nestingProperty = null, bool merge = false, LanguageSyntaxNode syntax = null, bool hasErrors = false)
 {
     return(this.CreateBoundSymbolDefCore(boundTree, childBoundNodes, type, syntax, hasErrors));
 }
コード例 #11
0
 protected virtual BoundNode CreateBoundScopeCore(BoundTree boundTree, ImmutableArray <object> childBoundNodes, LanguageSyntaxNode syntax, bool hasErrors)
 {
     return(new BoundScope(BoundKind.Scope, boundTree, childBoundNodes, syntax, hasErrors));
 }
コード例 #12
0
 protected virtual BoundNode CreateBoundRoot(BoundTree boundTree, ImmutableArray <object> childBoundNodes, LanguageSyntaxNode syntax, bool hasErrors)
 {
     return(this.CreateBoundRootCore(boundTree, childBoundNodes, syntax, hasErrors));
 }
コード例 #13
0
 public BoundNodeFactoryVisitor(BoundTree boundTree)
 {
     _boundTree = boundTree;
 }
コード例 #14
0
 protected virtual BoundNode CreateBoundProperty(BoundTree boundTree, ImmutableArray <object> childBoundNodes, string name, LanguageSyntaxNode syntax = null, bool hasErrors = false)
 {
     return(this.CreateBoundPropertyCore(boundTree, childBoundNodes, name, default, SymbolPropertyOwner.CurrentSymbol, null, syntax, hasErrors));
コード例 #15
0
 protected virtual BoundExpression BindExpressionCore(LanguageSyntaxNode node, BoundTree boundTree)
 {
     Debug.Assert(Language.SyntaxFacts.IsExpression(node));
     return((BoundExpression)this.BindCore(node, boundTree));
 }
コード例 #16
0
 protected virtual BoundStatement BindStatementCore(LanguageSyntaxNode node, BoundTree boundTree)
 {
     Debug.Assert(Language.SyntaxFacts.IsStatement(node));
     return((BoundStatement)this.BindCore(node, boundTree));
 }
コード例 #17
0
 protected virtual BoundNode CreateBoundSymbolUseCore(BoundTree boundTree, ImmutableArray <object> childBoundNodes, ImmutableArray <Type> types, ImmutableArray <Type> nestingTypes, LanguageSyntaxNode syntax, bool hasErrors)
 {
     return(new BoundSymbolUse(BoundKind.SymbolUse, boundTree, childBoundNodes, types, nestingTypes, syntax, hasErrors));
 }
コード例 #18
0
 protected virtual BoundNode CreateBoundAttribute(BoundTree boundTree, ImmutableArray <object> childBoundNodes, ImmutableArray <Type> types, LanguageSyntaxNode syntax, bool hasErrors)
 {
     return(this.CreateBoundAttributeCore(boundTree, childBoundNodes, types, ImmutableArray <Type> .Empty, syntax, hasErrors));
 }
コード例 #19
0
 public MemberBoundTree(BoundTree parent, LanguageSyntaxNode root, Binder rootBinder)
     : base(parent.Compilation, parent.SyntaxTree, rootBinder, parent.DiagnosticBag)
 {
     _parent = parent;
     _root   = root;
 }