Beispiel #1
0
 public BoundNode Bind(LanguageSyntaxNode node, BoundTree boundTree)
 {
     if (boundTree == null)
     {
         boundTree = this.Compilation.GetBoundTree(node);
     }
     return(boundTree.GetUpperBoundNode(node));
 }
Beispiel #2
0
 protected virtual BoundNode BindCore(LanguageSyntaxNode node, BoundTree boundTree)
 {
     if (boundTree == null)
     {
         boundTree = this.Compilation.GetBoundTree(node);
     }
     return(boundTree.CreateBoundNode(node, this));
 }
Beispiel #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;
            }
        }
Beispiel #4
0
 public BoundStatement BindStatement(LanguageSyntaxNode node, BoundTree boundTree)
 {
     Debug.Assert(Language.SyntaxFacts.IsStatement(node));
     return((BoundStatement)this.Bind(node, boundTree));
 }
Beispiel #5
0
 public BoundExpression BindExpression(LanguageSyntaxNode node, BoundTree boundTree)
 {
     Debug.Assert(Language.SyntaxFacts.IsExpression(node));
     return((BoundExpression)this.Bind(node, boundTree));
 }
 public IsBindableNodeVisitor(BoundTree boundTree)
 {
     _boundTree = boundTree;
 }
Beispiel #7
0
 public MemberBoundTree(LanguageCompilation compilation, LanguageSyntaxNode root, Binder rootBinder, DiagnosticBag diagnostics)
     : base(compilation, (LanguageSyntaxTree)root.SyntaxTree, rootBinder, diagnostics)
 {
     _parent = null;
     _root   = root;
 }
Beispiel #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));
     }
 }
 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));
 }
 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));
 }
 protected virtual BoundNode CreateBoundScopeCore(BoundTree boundTree, ImmutableArray <object> childBoundNodes, LanguageSyntaxNode syntax, bool hasErrors)
 {
     return(new BoundScope(BoundKind.Scope, boundTree, childBoundNodes, syntax, hasErrors));
 }
 protected virtual BoundNode CreateBoundRoot(BoundTree boundTree, ImmutableArray <object> childBoundNodes, LanguageSyntaxNode syntax, bool hasErrors)
 {
     return(this.CreateBoundRootCore(boundTree, childBoundNodes, syntax, hasErrors));
 }
 public BoundNodeFactoryVisitor(BoundTree boundTree)
 {
     _boundTree = boundTree;
 }
 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));
Beispiel #15
0
 protected virtual BoundExpression BindExpressionCore(LanguageSyntaxNode node, BoundTree boundTree)
 {
     Debug.Assert(Language.SyntaxFacts.IsExpression(node));
     return((BoundExpression)this.BindCore(node, boundTree));
 }
Beispiel #16
0
 protected virtual BoundStatement BindStatementCore(LanguageSyntaxNode node, BoundTree boundTree)
 {
     Debug.Assert(Language.SyntaxFacts.IsStatement(node));
     return((BoundStatement)this.BindCore(node, boundTree));
 }
 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));
 }
 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));
 }
Beispiel #19
0
 public MemberBoundTree(BoundTree parent, LanguageSyntaxNode root, Binder rootBinder)
     : base(parent.Compilation, parent.SyntaxTree, rootBinder, parent.DiagnosticBag)
 {
     _parent = parent;
     _root   = root;
 }