예제 #1
0
        public BindingResult(SyntaxNode root, BoundNode boundRoot, IDictionary<SyntaxNode, BoundNode> boundNodeFromSyntaxNode, IDictionary<BoundNode, Binder> binderFromBoundNode, IList<Diagnostic> diagnostics)
        {
            Root = root;
            BoundRoot = boundRoot;

            _boundNodeFromSyntaxNode = boundNodeFromSyntaxNode;
            _binderFromBoundNode = binderFromBoundNode;

            Diagnostics = diagnostics.ToImmutableArray();
        }
 protected virtual void VisitTopLevelDeclaration(BoundNode node)
 {
     switch (node.Kind)
     {
         case BoundNodeKind.VariableDeclaration:
             VisitVariableDeclaration((BoundVariableDeclaration) node);
             break;
         case BoundNodeKind.MultipleVariableDeclarations:
             VisitMultipleVariableDeclarations((BoundMultipleVariableDeclarations) node);
             break;
         case BoundNodeKind.FunctionDeclaration:
             VisitFunctionDeclaration((BoundFunctionDeclaration) node);
             break;
         case BoundNodeKind.FunctionDefinition:
             VisitFunctionDefinition((BoundFunctionDefinition) node);
             break;
         case BoundNodeKind.ConstantBuffer:
             VisitConstantBuffer((BoundConstantBuffer) node);
             break;
         case BoundNodeKind.TypeDeclaration:
             VisitTypeDeclaration((BoundTypeDeclaration) node);
             break;
         case BoundNodeKind.Namespace:
             VisitNamespace((BoundNamespace) node);
             break;
         case BoundNodeKind.Technique:
             VisitTechnique((BoundTechnique) node);
             break;
         case BoundNodeKind.NoOpStatement:
             VisitNoOpStatement((BoundNoOpStatement) node);
             break;
         case BoundNodeKind.Error:
             VisitError((BoundErrorNode) node);
             break;
         default:
             throw new InvalidOperationException(node.Kind.ToString());
     }
 }
예제 #3
0
 public void AddBoundNode(SyntaxNode syntaxNode, BoundNode boundNode)
 {
     _boundNodeFromSyntaxNode.Add(syntaxNode, boundNode);
 }
예제 #4
0
 public Binder GetBinder(BoundNode boundNode)
 {
     Binder result;
     _binderFromBoundNode.TryGetValue(boundNode, out result);
     return result;
 }