@@ -325,50 +325,50 @@ public static IGrammarBuilder<T> MarkForPrecompile<T>(this IGrammarBuilder<T> bu
325325 /// </summary>
326326 /// <typeparam name="T">The type of objects the parser will produce in case of success.</typeparam>
327327 /// <param name="builder">The grammar to build.</param>
328- /// <param name="artifacts ">The set of artifacts to build.</param>
328+ /// <param name="outputs ">The set of outputs to build.</param>
329329 /// <param name="options">Used to customize the building process. Optional.</param>
330330 /// <param name="isSyntaxCheck">Whether to use a dummy semantic provider instead of building one.</param>
331- private static BuilderResult < T > BuildImpl < T > ( this IGrammarBuilder builder , BuilderArtifacts artifacts ,
331+ private static BuilderResult < T > BuildImpl < T > ( this IGrammarBuilder builder , BuilderOutputs outputs ,
332332 BuilderOptions ? options = null , bool isSyntaxCheck = false )
333333 {
334334 ArgumentNullException . ThrowIfNull ( builder ) ;
335335
336336 options ??= BuilderOptions . Default ;
337337
338- // Add dependencies between artifacts .
339- // The order is important; if an artifact appears in the first parameter,
338+ // Add dependencies between outputs .
339+ // The order is important; if an output appears in the first parameter,
340340 // it cannot appear in the second parameter of a subsequent call.
341- AddArtifactDependencies ( BuilderArtifacts . CharParser ,
342- BuilderArtifacts . SemanticProviderOnChar | BuilderArtifacts . TokenizerOnChar | BuilderArtifacts . GrammarLrStateMachine ) ;
343- AddArtifactDependencies ( BuilderArtifacts . TokenizerOnChar ,
344- BuilderArtifacts . GrammarDfaOnChar ) ;
345- AddArtifactDependencies ( BuilderArtifacts . GrammarLrStateMachine | BuilderArtifacts . GrammarDfaOnChar ,
346- BuilderArtifacts . GrammarSummary ) ;
341+ AddOutputDependencies ( BuilderOutputs . CharParser ,
342+ BuilderOutputs . SemanticProviderOnChar | BuilderOutputs . TokenizerOnChar | BuilderOutputs . GrammarLrStateMachine ) ;
343+ AddOutputDependencies ( BuilderOutputs . TokenizerOnChar ,
344+ BuilderOutputs . GrammarDfaOnChar ) ;
345+ AddOutputDependencies ( BuilderOutputs . GrammarLrStateMachine | BuilderOutputs . GrammarDfaOnChar ,
346+ BuilderOutputs . GrammarSummary ) ;
347347
348348 Grammar ? grammar = null ;
349349 ISemanticProvider < char , T > ? semanticProvider = null ;
350350 Tokenizer < char > ? tokenizer = null ;
351351 CharParser < T > ? parser = null ;
352352
353- if ( artifacts != BuilderArtifacts . None )
353+ if ( outputs != BuilderOutputs . None )
354354 {
355355 GrammarDefinition grammarDefinition = GrammarDefinition . Create ( builder , options . Log , options . CancellationToken ) ;
356356
357357 List < BuilderDiagnostic > ? errors = null ;
358358 // We will collect errors only if we need to report them from a failing parser or tokenizer.
359- if ( ( artifacts & ( BuilderArtifacts . TokenizerOnChar | BuilderArtifacts . CharParser ) ) != 0 )
359+ if ( ( outputs & ( BuilderOutputs . TokenizerOnChar | BuilderOutputs . CharParser ) ) != 0 )
360360 {
361361 errors = [ ] ;
362362 }
363363
364- if ( ( artifacts & BuilderArtifacts . GrammarSummary ) != 0 )
364+ if ( ( outputs & BuilderOutputs . GrammarSummary ) != 0 )
365365 {
366- grammar = GrammarBuild . Build ( grammarDefinition , artifacts , options , errors ) ;
366+ grammar = GrammarBuild . Build ( grammarDefinition , outputs , options , errors ) ;
367367 }
368368
369369 object ? customError = errors is null or [ ] ? null : new CompositeDiagnostic < BuilderDiagnostic > ( errors ) ;
370370
371- if ( ( artifacts & BuilderArtifacts . TokenizerOnChar ) != 0 )
371+ if ( ( outputs & BuilderOutputs . TokenizerOnChar ) != 0 )
372372 {
373373 // Custom error is the same for both the parser and the tokenizer, which can
374374 // give confusing messages when a failing tokenizer gets swapped with a
@@ -377,14 +377,14 @@ private static BuilderResult<T> BuildImpl<T>(this IGrammarBuilder builder, Build
377377 tokenizer = Tokenizer . Create < char > ( grammar ! , false , customError ) ;
378378 }
379379
380- if ( ( artifacts & BuilderArtifacts . SemanticProviderOnChar ) != 0 )
380+ if ( ( outputs & BuilderOutputs . SemanticProviderOnChar ) != 0 )
381381 {
382382 semanticProvider = isSyntaxCheck
383383 ? SyntaxChecker < char , T > . Instance !
384384 : SemanticProviderBuild . Build < T > ( grammarDefinition ) ;
385385 }
386386
387- if ( ( artifacts & BuilderArtifacts . CharParser ) != 0 )
387+ if ( ( outputs & BuilderOutputs . CharParser ) != 0 )
388388 {
389389 parser = CharParser . Create ( grammar ! , tokenizer ! , semanticProvider ! , customError ) ;
390390 }
@@ -398,38 +398,38 @@ private static BuilderResult<T> BuildImpl<T>(this IGrammarBuilder builder, Build
398398 TokenizerOnChar = tokenizer
399399 } ;
400400
401- // Adds dependencies between artifacts . If one of dependents is specified, dependencies will be built as well.
402- void AddArtifactDependencies ( BuilderArtifacts dependents , BuilderArtifacts dependencies )
401+ // Adds dependencies between outputs . If one of dependents is specified, dependencies will be built as well.
402+ void AddOutputDependencies ( BuilderOutputs dependents , BuilderOutputs dependencies )
403403 {
404- if ( ( artifacts & dependents ) != 0 )
404+ if ( ( outputs & dependents ) != 0 )
405405 {
406- artifacts |= dependencies ;
406+ outputs |= dependencies ;
407407 }
408408 }
409409 }
410410
411411 /// <summary>
412- /// Builds multiple artifacts from the given <see cref="IGrammarBuilder{T}"/>.
412+ /// Builds multiple outputs from the given <see cref="IGrammarBuilder{T}"/>.
413413 /// </summary>
414414 /// <typeparam name="T">The type of objects the parser will produce in case of success.</typeparam>
415415 /// <param name="builder">The grammar to build.</param>
416- /// <param name="artifacts ">The set of artifacts to build.</param>
416+ /// <param name="outputs ">The set of outputs to build.</param>
417417 /// <param name="options">Used to customize the building process. Optional.</param>
418418 /// <returns>
419- /// A <see cref="BuilderResult{T}"/> object with the properties of the requested artifacts populated.
419+ /// A <see cref="BuilderResult{T}"/> object with the properties of the requested outputs populated.
420420 /// </returns>
421421 /// <remarks>
422422 /// <para>
423- /// The builder will reuse resources to build the requested artifacts where applicable.
423+ /// The builder will reuse resources to build the requested outputs where applicable.
424424 /// </para>
425425 /// <para>
426- /// Additional artifacts may be built beyond the ones requested, if they are dependencies of the requested
427- /// artifacts . For example, if <see cref="BuilderArtifacts .CharParser"/> is requested, the builder will also
428- /// build <see cref="BuilderArtifacts .TokenizerOnChar"/>, <see cref="BuilderArtifacts .SemanticProviderOnChar"/>.
426+ /// Additional outputs may be built beyond the ones requested, if they are dependencies of the requested
427+ /// outputs . For example, if <see cref="BuilderOutputs .CharParser"/> is requested, the builder will also
428+ /// build <see cref="BuilderOutputs .TokenizerOnChar"/>, <see cref="BuilderOutputs .SemanticProviderOnChar"/>.
429429 /// </para>
430430 /// </remarks>
431- public static BuilderResult < T > Build < T > ( this IGrammarBuilder < T > builder , BuilderArtifacts artifacts , BuilderOptions ? options = null ) =>
432- builder . BuildImpl < T > ( artifacts , options ) ;
431+ public static BuilderResult < T > Build < T > ( this IGrammarBuilder < T > builder , BuilderOutputs outputs , BuilderOptions ? options = null ) =>
432+ builder . BuildImpl < T > ( outputs , options ) ;
433433
434434 /// <summary>
435435 /// Creates a <see cref="CharParser{T}"/> from the given <see cref="IGrammarBuilder{T}"/>.
@@ -445,34 +445,34 @@ public static BuilderResult<T> Build<T>(this IGrammarBuilder<T> builder, Builder
445445 /// property to <see cref="IReadOnlyList{BuilderDiagnostic}"/> of type <see cref="BuilderDiagnostic"/>.
446446 /// </returns>
447447 public static CharParser < T > Build < T > ( this IGrammarBuilder < T > builder , BuilderOptions ? options = null ) =>
448- builder . Build ( BuilderArtifacts . CharParser , options ) . GetCharParserOrThrow ( ) ;
448+ builder . Build ( BuilderOutputs . CharParser , options ) . GetCharParserOrThrow ( ) ;
449449
450450 /// <summary>
451- /// Builds multiple artifacts from the given untyped <see cref="IGrammarBuilder"/>.
451+ /// Builds multiple outputs from the given untyped <see cref="IGrammarBuilder"/>.
452452 /// </summary>
453453 /// <typeparam name="T">The supposed return type of the parser and the semantic provider. Must be a reference type.</typeparam>
454454 /// <param name="builder">The grammar to build.</param>
455- /// <param name="artifacts ">The set of artifacts to build.</param>
455+ /// <param name="outputs ">The set of outputs to build.</param>
456456 /// <param name="options">Used to customize the building process. Optional.</param>
457457 /// <returns>
458- /// A <see cref="BuilderResult{T}"/> object with the properties of the requested artifacts populated.
458+ /// A <see cref="BuilderResult{T}"/> object with the properties of the requested outputs populated.
459459 /// </returns>
460460 /// <remarks>
461461 /// <para>
462- /// The builder will reuse resources to build the requested artifacts where applicable.
462+ /// The builder will reuse resources to build the requested outputs where applicable.
463463 /// </para>
464464 /// <para>
465- /// Additional artifacts may be built beyond the ones requested, if they are dependencies of the requested
466- /// artifacts . For example, if <see cref="BuilderArtifacts .CharParser"/> is requested, the builder will also
467- /// build <see cref="BuilderArtifacts .TokenizerOnChar"/>, <see cref="BuilderArtifacts .SemanticProviderOnChar"/>.
465+ /// Additional outputs may be built beyond the ones requested, if they are dependencies of the requested
466+ /// outputs . For example, if <see cref="BuilderOutputs .CharParser"/> is requested, the builder will also
467+ /// build <see cref="BuilderOutputs .TokenizerOnChar"/>, <see cref="BuilderOutputs .SemanticProviderOnChar"/>.
468468 /// </para>
469469 /// <para>
470470 /// If requested, the builder will create a syntax-checking parser and semantic provider that will not execute
471471 /// any semantic actions and produce <see langword="null"/> semantic values on success.
472472 /// </para>
473473 /// </remarks>
474- public static BuilderResult < T ? > BuildSyntaxCheck < T > ( this IGrammarBuilder builder , BuilderArtifacts artifacts , BuilderOptions ? options = null ) where T : class ? =>
475- builder . BuildImpl < T ? > ( artifacts , options , isSyntaxCheck : true ) ;
474+ public static BuilderResult < T ? > BuildSyntaxCheck < T > ( this IGrammarBuilder builder , BuilderOutputs outputs , BuilderOptions ? options = null ) where T : class ? =>
475+ builder . BuildImpl < T ? > ( outputs , options , isSyntaxCheck : true ) ;
476476
477477 /// <summary>
478478 /// Creates a syntax-checking <see cref="CharParser{T}"/> from the given <see cref="IGrammarBuilder{T}"/>.
@@ -491,15 +491,15 @@ public static CharParser<T> Build<T>(this IGrammarBuilder<T> builder, BuilderOpt
491491 /// property to <see cref="IReadOnlyList{BuilderDiagnostic}"/> of type <see cref="BuilderDiagnostic"/>.
492492 /// </remarks>
493493 public static CharParser < T ? > BuildSyntaxCheck < T > ( this IGrammarBuilder builder , BuilderOptions ? options = null ) where T : class ? =>
494- builder . BuildSyntaxCheck < T > ( BuilderArtifacts . CharParser , options ) . GetCharParserOrThrow ( ) ;
494+ builder . BuildSyntaxCheck < T > ( BuilderOutputs . CharParser , options ) . GetCharParserOrThrow ( ) ;
495495
496496 /// <inheritdoc cref="BuildSyntaxCheck{T}(IGrammarBuilder, BuilderOptions?)"/>
497497 public static CharParser < object ? > BuildSyntaxCheck ( this IGrammarBuilder builder , BuilderOptions ? options = null ) =>
498498 builder . BuildSyntaxCheck < object > ( options ) ;
499499
500- /// <inheritdoc cref="BuildSyntaxCheck{T}(IGrammarBuilder, BuilderArtifacts , BuilderOptions?)"/>
501- public static BuilderResult < object ? > BuildSyntaxCheck ( this IGrammarBuilder builder , BuilderArtifacts artifacts , BuilderOptions ? options = null ) =>
502- builder . BuildSyntaxCheck < object > ( artifacts , options ) ;
500+ /// <inheritdoc cref="BuildSyntaxCheck{T}(IGrammarBuilder, BuilderOutputs , BuilderOptions?)"/>
501+ public static BuilderResult < object ? > BuildSyntaxCheck ( this IGrammarBuilder builder , BuilderOutputs outputs , BuilderOptions ? options = null ) =>
502+ builder . BuildSyntaxCheck < object > ( outputs , options ) ;
503503
504504 /// <summary>
505505 /// Obsolete. Use <see cref="BuildSyntaxCheck(IGrammarBuilder, BuilderOptions?)"/> instead.
@@ -519,7 +519,7 @@ public static CharParser<T> Build<T>(this IGrammarBuilder<T> builder, BuilderOpt
519519 /// <param name="builder">The grammar to build.</param>
520520 /// <remarks>
521521 /// By not building a whole grammar, some expensive steps are skipped, and
522- /// by using this function instead of <see cref="Build{T}(IGrammarBuilder{T}, BuilderArtifacts , BuilderOptions?)"/>,
522+ /// by using this function instead of <see cref="Build{T}(IGrammarBuilder{T}, BuilderOutputs , BuilderOptions?)"/>,
523523 /// most of the grammar building code can be trimmed away. This function is
524524 /// useful only in some very limited scenarios, such as having many grammar
525525 /// builders with an identical grammar but different semantic providers.
0 commit comments