Table of Contents

Class LanguageProfileBuilder

Namespace
MuLang.Core
Assembly
MuLang.Core.dll

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

profile LanguageProfile

The language profile used for compilation.

Exceptions

ArgumentNullException

Thrown when profile is null.

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

loops LoopFeatures

The loop features.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when loops contains unsupported flags.

DisableMutations(MutationFeatures)

Disables the specified mutations.

public LanguageProfileBuilder DisableMutations(MutationFeatures mutations)

Parameters

mutations MutationFeatures

The mutation features.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when mutations contains unsupported flags.

DisableShadowing(ShadowingPolicy)

Disables the specified shadowing.

public LanguageProfileBuilder DisableShadowing(ShadowingPolicy shadowing)

Parameters

shadowing ShadowingPolicy

The shadowing policy.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when shadowing contains unsupported flags.

EnableLoops(LoopFeatures)

Enables the specified loops.

public LanguageProfileBuilder EnableLoops(LoopFeatures loops)

Parameters

loops LoopFeatures

The loop features.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when loops contains unsupported flags.

EnableMutations(MutationFeatures)

Enables the specified mutations.

public LanguageProfileBuilder EnableMutations(MutationFeatures mutations)

Parameters

mutations MutationFeatures

The mutation features.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when mutations contains unsupported flags.

EnableShadowing(ShadowingPolicy)

Enables the specified shadowing.

public LanguageProfileBuilder EnableShadowing(ShadowingPolicy shadowing)

Parameters

shadowing ShadowingPolicy

The shadowing policy.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when shadowing contains unsupported flags.

WithConditionSemantics(ConditionSemantics)

Sets the condition semantics setting.

public LanguageProfileBuilder WithConditionSemantics(ConditionSemantics conditionSemantics)

Parameters

conditionSemantics ConditionSemantics

The condition semantics.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when conditionSemantics is not defined.

WithConstantFolding(ConstantFoldingFeature)

Sets the compile-time constant folding feature setting.

public LanguageProfileBuilder WithConstantFolding(ConstantFoldingFeature constantFolding)

Parameters

constantFolding ConstantFoldingFeature

The compile-time constant folding feature setting.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when constantFolding is not defined.

WithExceptionHandling(ExceptionHandlingFeature)

Sets the source-level exception-handling feature setting.

public LanguageProfileBuilder WithExceptionHandling(ExceptionHandlingFeature exceptionHandling)

Parameters

exceptionHandling ExceptionHandlingFeature

The source-level exception-handling feature setting.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when exceptionHandling is not defined.

WithLanguageVersion(LanguageVersion)

Sets the language version setting.

public LanguageProfileBuilder WithLanguageVersion(LanguageVersion languageVersion)

Parameters

languageVersion LanguageVersion

The language version.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when languageVersion is not defined.

ArgumentException

Thrown when languageVersion is not supported.

WithLoops(LoopFeatures)

Sets the loops setting.

public LanguageProfileBuilder WithLoops(LoopFeatures loops)

Parameters

loops LoopFeatures

The loop features.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when loops contains unsupported flags.

WithMultiLevelLoopControl(MultiLevelLoopControlFeature)

Sets the multi-level loop control feature setting.

public LanguageProfileBuilder WithMultiLevelLoopControl(MultiLevelLoopControlFeature multiLevelLoopControl)

Parameters

multiLevelLoopControl MultiLevelLoopControlFeature

The multi-level loop control feature setting.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when multiLevelLoopControl is not defined.

WithMutations(MutationFeatures)

Sets the mutations setting.

public LanguageProfileBuilder WithMutations(MutationFeatures mutations)

Parameters

mutations MutationFeatures

The mutation features.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when mutations contains unsupported flags.

WithObjectLiteralSyntax(ObjectLiteralSyntax)

Sets the object-literal property grammar.

public LanguageProfileBuilder WithObjectLiteralSyntax(ObjectLiteralSyntax objectLiteralSyntax)

Parameters

objectLiteralSyntax ObjectLiteralSyntax

The object-literal property grammar.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when objectLiteralSyntax is not defined.

WithOpenObjects(OpenObjectsFeature)

Sets the open objects setting.

public LanguageProfileBuilder WithOpenObjects(OpenObjectsFeature openObjects)

Parameters

openObjects OpenObjectsFeature

The open objects feature setting.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when openObjects is not defined.

WithProviderFunctionCalls(ProviderFunctionCallsFeature)

Sets the provider function calls setting.

public LanguageProfileBuilder WithProviderFunctionCalls(ProviderFunctionCallsFeature providerFunctionCalls)

Parameters

providerFunctionCalls ProviderFunctionCallsFeature

The provider function calls feature setting.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when providerFunctionCalls is not defined.

WithRecursion(RecursionFeature)

Sets the recursion setting.

public LanguageProfileBuilder WithRecursion(RecursionFeature recursion)

Parameters

recursion RecursionFeature

The recursion feature setting.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when recursion is not defined.

WithShadowing(ShadowingPolicy)

Sets the shadowing setting.

public LanguageProfileBuilder WithShadowing(ShadowingPolicy shadowing)

Parameters

shadowing ShadowingPolicy

The shadowing policy.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when shadowing contains unsupported flags.

WithTrailingCommas(TrailingCommasFeature)

Sets the trailing commas setting.

public LanguageProfileBuilder WithTrailingCommas(TrailingCommasFeature trailingCommas)

Parameters

trailingCommas TrailingCommasFeature

The trailing commas feature setting.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when trailingCommas is not defined.

WithUserDefinedFunctions(UserDefinedFunctionsFeature)

Sets the user-defined functions feature setting.

public LanguageProfileBuilder WithUserDefinedFunctions(UserDefinedFunctionsFeature userDefinedFunctions)

Parameters

userDefinedFunctions UserDefinedFunctionsFeature

The user-defined functions feature setting.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when userDefinedFunctions is not defined.

WithUserDefinedTypes(UserDefinedTypesFeature)

Sets the user-defined types feature setting.

public LanguageProfileBuilder WithUserDefinedTypes(UserDefinedTypesFeature userDefinedTypes)

Parameters

userDefinedTypes UserDefinedTypesFeature

The user-defined types feature setting.

Returns

LanguageProfileBuilder

The same LanguageProfileBuilder instance, for chaining.

Exceptions

ArgumentOutOfRangeException

Thrown when userDefinedTypes is not defined.