Пример #1
0
 internal GeneratorDriverState(ParseOptions parseOptions,
                               AnalyzerConfigOptionsProvider optionsProvider,
                               ImmutableArray <ISourceGenerator> sourceGenerators,
                               ImmutableArray <IIncrementalGenerator> incrementalGenerators,
                               ImmutableArray <AdditionalText> additionalTexts,
                               ImmutableArray <GeneratorState> generatorStates,
                               DriverStateTable stateTable,
                               SyntaxStore syntaxStore,
                               IncrementalGeneratorOutputKind disabledOutputs,
                               TimeSpan runtime,
                               bool trackIncrementalGeneratorSteps)
 {
     Generators            = sourceGenerators;
     IncrementalGenerators = incrementalGenerators;
     GeneratorStates       = generatorStates;
     AdditionalTexts       = additionalTexts;
     ParseOptions          = parseOptions;
     OptionsProvider       = optionsProvider;
     StateTable            = stateTable;
     SyntaxStore           = syntaxStore;
     DisabledOutputs       = disabledOutputs;
     RunTime = runtime;
     TrackIncrementalSteps = trackIncrementalGeneratorSteps;
     Debug.Assert(Generators.Length == GeneratorStates.Length);
     Debug.Assert(IncrementalGenerators.Length == GeneratorStates.Length);
 }
Пример #2
0
 public Builder(Compilation compilation, GeneratorDriverState driverState, SyntaxStore.Builder syntaxStore, CancellationToken cancellationToken = default)
 {
     Compilation        = compilation;
     DriverState        = driverState;
     _previousTable     = driverState.StateTable;
     _cancellationToken = cancellationToken;
     SyntaxStore        = syntaxStore;
 }
Пример #3
0
 public Builder(Compilation compilation, GeneratorDriverState driverState, ImmutableArray <ISyntaxInputNode> syntaxInputNodes, CancellationToken cancellationToken = default)
 {
     Compilation        = compilation;
     DriverState        = driverState;
     _previousTable     = driverState.StateTable;
     _syntaxInputNodes  = syntaxInputNodes;
     _cancellationToken = cancellationToken;
 }
Пример #4
0
            public Builder(SyntaxReceiverInputNode owner, DriverStateTable driverStateTable, bool trackIncrementalSteps)
            {
                _owner          = owner;
                _nodeStateTable = driverStateTable.GetStateTableOrEmpty <ISyntaxContextReceiver?>(_owner).ToBuilder(stepName: null, trackIncrementalSteps);
                try
                {
                    _receiver = owner._receiverCreator();
                }
                catch (Exception e)
                {
                    throw new UserFunctionException(e);
                }

                if (_receiver is object)
                {
                    _walker = new GeneratorSyntaxWalker(_receiver);
                }
            }
Пример #5
0
 internal GeneratorDriverState(ParseOptions parseOptions,
                               AnalyzerConfigOptionsProvider optionsProvider,
                               ImmutableArray <ISourceGenerator> sourceGenerators,
                               ImmutableArray <IIncrementalGenerator> incrementalGenerators,
                               ImmutableArray <AdditionalText> additionalTexts,
                               ImmutableArray <GeneratorState> generatorStates,
                               DriverStateTable stateTable,
                               bool enableIncremental)
 {
     Generators            = sourceGenerators;
     IncrementalGenerators = incrementalGenerators;
     GeneratorStates       = generatorStates;
     AdditionalTexts       = additionalTexts;
     ParseOptions          = parseOptions;
     OptionsProvider       = optionsProvider;
     StateTable            = stateTable;
     EnableIncremental     = enableIncremental;
     Debug.Assert(Generators.Length == GeneratorStates.Length);
     Debug.Assert(IncrementalGenerators.Length == GeneratorStates.Length);
 }
Пример #6
0
 public Builder(SyntaxInputNode <T> owner, DriverStateTable table)
 {
     _owner          = owner;
     _filterTable    = table.GetStateTableOrEmpty <SyntaxNode>(_owner._filterKey).ToBuilder();
     _transformTable = table.GetStateTableOrEmpty <T>(_owner).ToBuilder();
 }
Пример #7
0
 public ISyntaxInputBuilder GetBuilder(DriverStateTable table) => new Builder(this, table);
Пример #8
0
 public ISyntaxInputBuilder GetBuilder(DriverStateTable table, bool trackIncrementalSteps) => new Builder(this, table, trackIncrementalSteps);
Пример #9
0
 public Builder(SyntaxInputNode <T> owner, DriverStateTable table, bool trackIncrementalSteps)
 {
     _owner          = owner;
     _filterTable    = table.GetStateTableOrEmpty <SyntaxNode>(_owner._filterKey).ToBuilder(stepName: null, trackIncrementalSteps);
     _transformTable = table.GetStateTableOrEmpty <T>(_owner).ToBuilder(_owner.Name, trackIncrementalSteps);
 }