protected MemberSemanticModel( LanguageSyntaxNode root, Symbol memberSymbol, Binder rootBinder, SyntaxTreeSemanticModel containingSemanticModelOpt, SyntaxTreeSemanticModel parentSemanticModelOpt, int speculatedPosition) { Debug.Assert(root != null); Debug.Assert((object)memberSymbol != null); Debug.Assert(parentSemanticModelOpt == null ^ containingSemanticModelOpt == null); Debug.Assert(containingSemanticModelOpt == null || !containingSemanticModelOpt.IsSpeculativeSemanticModel); Debug.Assert(parentSemanticModelOpt == null || !parentSemanticModelOpt.IsSpeculativeSemanticModel, CSharpResources.ChainingSpeculativeModelIsNotSupported); _memberSymbol = memberSymbol; this.RootBinder = rootBinder.WithAdditionalFlags(GetSemanticModelBinderFlags()); _containingSemanticModelOpt = containingSemanticModelOpt; _parentSemanticModelOpt = parentSemanticModelOpt; _speculatedPosition = speculatedPosition; _boundTree = new BoundTree(this.Compilation, (LanguageSyntaxTree)root.SyntaxTree, rootBinder, _ignoredDiagnostics); _operationFactory = new Lazy <LanguageOperationFactory>(() => new LanguageOperationFactory(this)); }
public BoundProperty(BoundKind kind, BoundTree boundTree, ImmutableArray <object> childBoundNodes, string name, Optional <object> valueOpt, SymbolPropertyOwner owner, Type ownerType, LanguageSyntaxNode syntax, bool hasErrors = false) : base(kind, boundTree, childBoundNodes, syntax, hasErrors) { _name = name; _hasFixedValue = valueOpt.HasValue; _value = valueOpt.HasValue ? valueOpt.Value : default; _owner = owner; _ownerType = ownerType; }
public BoundTree Bind(CodeBlockNode node) { BoundTree tree = new BoundTree(); foreach (Statement statement in node.Children) { tree.Statements.Add(BindStatement(statement)); } return(tree); }
internal SyntaxTreeSemanticModel(LanguageCompilation compilation, LanguageSyntaxTree syntaxTree, bool ignoreAccessibility = false) { _compilation = compilation; _ignoresAccessibility = ignoreAccessibility; if (!this.Compilation.SyntaxTrees.Contains(syntaxTree)) { throw new ArgumentOutOfRangeException(nameof(syntaxTree), CSharpResources.TreeNotPartOfCompilation); } _boundTree = new BoundTree(compilation, syntaxTree, compilation.GetBinder(syntaxTree.GetRootNode()), _ignoredDiagnostics); _binderFactory = compilation.GetBinderFactory(SyntaxTree); }
public CustomBoundNode(BoundKind kind, BoundTree boundTree, ImmutableArray <object> childBoundNodes, LanguageSyntaxNode syntax, bool hasErrors) : base(kind, boundTree, childBoundNodes, syntax, hasErrors) { }
public BoundIdentifier(BoundKind kind, BoundTree boundTree, ImmutableArray <object> childBoundNodes, LanguageSyntaxNode syntax, bool hasErrors = false) : base(kind, boundTree, childBoundNodes, syntax, hasErrors) { }
public BoundValue(BoundKind kind, BoundTree boundTree, ImmutableArray <object> childBoundNodes, object value, LanguageSyntaxNode syntax, bool hasErrors = false) : base(kind, boundTree, childBoundNodes, syntax, hasErrors) { _values = ImmutableArray.Create(value); }
public BoundSymbolDef(BoundKind kind, BoundTree boundTree, ImmutableArray <object> childBoundNodes, Type type, LanguageSyntaxNode syntax, bool hasErrors = false) : base(kind, boundTree, childBoundNodes, syntax, hasErrors) { _type = type; }
public BoundAttribute(BoundKind kind, BoundTree boundTree, ImmutableArray <object> childBoundNodes, ImmutableArray <Type> types, ImmutableArray <Type> nestingTypes, LanguageSyntaxNode syntax, bool hasErrors = false) : base(kind, boundTree, childBoundNodes, types, nestingTypes, syntax, hasErrors) { }
public abstract IsBindableNodeVisitor CreateIsBindableNodeVisitor(BoundTree boundTree);
private Binder GetEnclosingBinderInternalWithinRoot(SyntaxNode node, int position) { AssertPositionAdjusted(position); return(BoundTree.GetEnclosingBinderInternalWithinRoot(node, position, RootBinder, _boundTree.Root).WithAdditionalFlags(GetSemanticModelBinderFlags())); }
internal SyntaxTreeSemanticModel(LanguageCompilation parentCompilation, LanguageSyntaxTree parentSyntaxTree, LanguageSyntaxTree speculatedSyntaxTree) { _compilation = parentCompilation; _boundTree = new BoundTree(parentCompilation, speculatedSyntaxTree, parentCompilation.GetBinder(speculatedSyntaxTree.GetRootNode()), _ignoredDiagnostics); _binderFactory = _compilation.GetBinderFactory(parentSyntaxTree); }
protected BoundExpression(BoundKind kind, BoundTree boundTree, ImmutableArray <object> childBoundNodes, IOperation expression, LanguageSyntaxNode syntax, bool hasErrors = false) : base(kind, boundTree, childBoundNodes, syntax, hasErrors) { _expression = expression; }
public BoundSelectedEndPoint(BoundKind kind, BoundTree boundTree, ImmutableArray <object> childBoundNodes, LanguageSyntaxNode syntax, bool hasErrors) : base(kind, boundTree, childBoundNodes, syntax, hasErrors) { }
protected BoundStatement(BoundKind kind, BoundTree boundTree, ImmutableArray <object> childBoundNodes, IOperation statement, LanguageSyntaxNode syntax, bool hasErrors = false) : base(kind, boundTree, childBoundNodes, syntax, hasErrors) { _statement = statement; }
public BoundSymbolUse(BoundKind kind, BoundTree boundTree, ImmutableArray <object> childBoundNodes, ImmutableArray <Type> types, ImmutableArray <Type> nestingTypes, LanguageSyntaxNode syntax, bool hasErrors = false) : base(kind, boundTree, childBoundNodes, syntax, hasErrors) { _types = types; _nestingTypes = nestingTypes; }
public BoundEnumValue(BoundKind kind, BoundTree boundTree, ImmutableArray <object> childBoundNodes, string name, Type enumType, LanguageSyntaxNode syntax, bool hasErrors = false) : base(kind, boundTree, childBoundNodes, syntax, hasErrors) { _name = name; _enumType = enumType; }
public override BoundNodeFactoryVisitor CreateBoundNodeFactoryVisitor(BoundTree boundTree) { return(new MetaBoundNodeFactoryVisitor(boundTree)); }
public abstract BoundNodeFactoryVisitor CreateBoundNodeFactoryVisitor(BoundTree boundTree);
public override IsBindableNodeVisitor CreateIsBindableNodeVisitor(BoundTree boundTree) { return(new MetaIsBindableNodeVisitor(boundTree)); }
public BoundBadStatement(BoundTree boundTree, ImmutableArray <object> childBoundNodes, LanguageSyntaxNode syntax, bool hasErrors) : base(BoundKind.BadStatement, boundTree, childBoundNodes, syntax, hasErrors) { }
public BoundOpposite(MetaBoundKind kind, BoundTree boundTree, ImmutableArray <object> childBoundNodes, LanguageSyntaxNode syntax, bool hasErrors) : base(kind, boundTree, childBoundNodes, syntax, hasErrors) { }