Class PrecompilerInputAttribute
Marks an IGrammarBuilder factory method to be precompiled. Methods with this attribute applied are called precompiler input methods, or just input methods.
[AttributeUsage(AttributeTargets.Method)]
public sealed class PrecompilerInputAttribute : Attribute
- Inheritance
-
PrecompilerInputAttribute
- Inherited Members
Remarks
This attribute must be applied on non-generic, static, parameterless methods that return a type that implements IGrammarBuilder. At build time, the precompiler will run this method, build the returned grammar builder, and embed the grammar to the assembly.
Properties
Key
A string value that disambiguates between multiple uses of PrecompilerInputAttribute on the same type.
public string? Key { get; set; }
Property Value
Remarks
If set, the same key must be set to the corresponding methods with PrecompilerOutputAttribute. Two attributes on the same type must not have the same key.
- See Also
MaxTokenizerStates
The maximum number of states that the grammar's tokenizer can have.
public int MaxTokenizerStates { get; set; }
Property Value
Remarks
This value can be used to prevent exponential blowup of the tokenizer
states for certain regexes like [ab]*[ab]{32}. If it is zero
or negative, the limit is set to an implementation-defined number
that is proportional to the complexity of the input regexes.
- See Also