Class LanguageProfileBuilder
Builds a MuLang language profile.
public sealed class LanguageProfileBuilder
- Inheritance
-
LanguageProfileBuilder
- Inherited Members
Constructors
LanguageProfileBuilder()
Initializes a new instance of the LanguageProfileBuilder class.
public LanguageProfileBuilder()
LanguageProfileBuilder(LanguageProfile)
Initializes a new instance of the LanguageProfileBuilder class.
public LanguageProfileBuilder(LanguageProfile profile)
Parameters
profileLanguageProfileThe language profile used for compilation.
Exceptions
- ArgumentNullException
Thrown when
profileisnull.
Methods
Build()
Creates an immutable language profile from the current settings.
public LanguageProfile Build()
Returns
- LanguageProfile
The immutable language profile.
DisableLoops(LoopFeatures)
Disables the specified loops.
public LanguageProfileBuilder DisableLoops(LoopFeatures loops)
Parameters
loopsLoopFeaturesThe loop features.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
loopscontains unsupported flags.
DisableMutations(MutationFeatures)
Disables the specified mutations.
public LanguageProfileBuilder DisableMutations(MutationFeatures mutations)
Parameters
mutationsMutationFeaturesThe mutation features.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
mutationscontains unsupported flags.
DisableShadowing(ShadowingPolicy)
Disables the specified shadowing.
public LanguageProfileBuilder DisableShadowing(ShadowingPolicy shadowing)
Parameters
shadowingShadowingPolicyThe shadowing policy.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
shadowingcontains unsupported flags.
EnableLoops(LoopFeatures)
Enables the specified loops.
public LanguageProfileBuilder EnableLoops(LoopFeatures loops)
Parameters
loopsLoopFeaturesThe loop features.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
loopscontains unsupported flags.
EnableMutations(MutationFeatures)
Enables the specified mutations.
public LanguageProfileBuilder EnableMutations(MutationFeatures mutations)
Parameters
mutationsMutationFeaturesThe mutation features.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
mutationscontains unsupported flags.
EnableShadowing(ShadowingPolicy)
Enables the specified shadowing.
public LanguageProfileBuilder EnableShadowing(ShadowingPolicy shadowing)
Parameters
shadowingShadowingPolicyThe shadowing policy.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
shadowingcontains unsupported flags.
WithConditionSemantics(ConditionSemantics)
Sets the condition semantics setting.
public LanguageProfileBuilder WithConditionSemantics(ConditionSemantics conditionSemantics)
Parameters
conditionSemanticsConditionSemanticsThe condition semantics.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
conditionSemanticsis not defined.
WithConstantFolding(ConstantFoldingFeature)
Sets the compile-time constant folding feature setting.
public LanguageProfileBuilder WithConstantFolding(ConstantFoldingFeature constantFolding)
Parameters
constantFoldingConstantFoldingFeatureThe compile-time constant folding feature setting.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
constantFoldingis not defined.
WithExceptionHandling(ExceptionHandlingFeature)
Sets the source-level exception-handling feature setting.
public LanguageProfileBuilder WithExceptionHandling(ExceptionHandlingFeature exceptionHandling)
Parameters
exceptionHandlingExceptionHandlingFeatureThe source-level exception-handling feature setting.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
exceptionHandlingis not defined.
WithLanguageVersion(LanguageVersion)
Sets the language version setting.
public LanguageProfileBuilder WithLanguageVersion(LanguageVersion languageVersion)
Parameters
languageVersionLanguageVersionThe language version.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
languageVersionis not defined.- ArgumentException
Thrown when
languageVersionis not supported.
WithLoops(LoopFeatures)
Sets the loops setting.
public LanguageProfileBuilder WithLoops(LoopFeatures loops)
Parameters
loopsLoopFeaturesThe loop features.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
loopscontains unsupported flags.
WithMultiLevelLoopControl(MultiLevelLoopControlFeature)
Sets the multi-level loop control feature setting.
public LanguageProfileBuilder WithMultiLevelLoopControl(MultiLevelLoopControlFeature multiLevelLoopControl)
Parameters
multiLevelLoopControlMultiLevelLoopControlFeatureThe multi-level loop control feature setting.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
multiLevelLoopControlis not defined.
WithMutations(MutationFeatures)
Sets the mutations setting.
public LanguageProfileBuilder WithMutations(MutationFeatures mutations)
Parameters
mutationsMutationFeaturesThe mutation features.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
mutationscontains unsupported flags.
WithObjectLiteralSyntax(ObjectLiteralSyntax)
Sets the object-literal property grammar.
public LanguageProfileBuilder WithObjectLiteralSyntax(ObjectLiteralSyntax objectLiteralSyntax)
Parameters
objectLiteralSyntaxObjectLiteralSyntaxThe object-literal property grammar.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
objectLiteralSyntaxis not defined.
WithOpenObjects(OpenObjectsFeature)
Sets the open objects setting.
public LanguageProfileBuilder WithOpenObjects(OpenObjectsFeature openObjects)
Parameters
openObjectsOpenObjectsFeatureThe open objects feature setting.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
openObjectsis not defined.
WithProviderFunctionCalls(ProviderFunctionCallsFeature)
Sets the provider function calls setting.
public LanguageProfileBuilder WithProviderFunctionCalls(ProviderFunctionCallsFeature providerFunctionCalls)
Parameters
providerFunctionCallsProviderFunctionCallsFeatureThe provider function calls feature setting.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
providerFunctionCallsis not defined.
WithRecursion(RecursionFeature)
Sets the recursion setting.
public LanguageProfileBuilder WithRecursion(RecursionFeature recursion)
Parameters
recursionRecursionFeatureThe recursion feature setting.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
recursionis not defined.
WithShadowing(ShadowingPolicy)
Sets the shadowing setting.
public LanguageProfileBuilder WithShadowing(ShadowingPolicy shadowing)
Parameters
shadowingShadowingPolicyThe shadowing policy.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
shadowingcontains unsupported flags.
WithTrailingCommas(TrailingCommasFeature)
Sets the trailing commas setting.
public LanguageProfileBuilder WithTrailingCommas(TrailingCommasFeature trailingCommas)
Parameters
trailingCommasTrailingCommasFeatureThe trailing commas feature setting.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
trailingCommasis not defined.
WithUserDefinedFunctions(UserDefinedFunctionsFeature)
Sets the user-defined functions feature setting.
public LanguageProfileBuilder WithUserDefinedFunctions(UserDefinedFunctionsFeature userDefinedFunctions)
Parameters
userDefinedFunctionsUserDefinedFunctionsFeatureThe user-defined functions feature setting.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
userDefinedFunctionsis not defined.
WithUserDefinedTypes(UserDefinedTypesFeature)
Sets the user-defined types feature setting.
public LanguageProfileBuilder WithUserDefinedTypes(UserDefinedTypesFeature userDefinedTypes)
Parameters
userDefinedTypesUserDefinedTypesFeatureThe user-defined types feature setting.
Returns
- LanguageProfileBuilder
The same LanguageProfileBuilder instance, for chaining.
Exceptions
- ArgumentOutOfRangeException
Thrown when
userDefinedTypesis not defined.