Class Factory
The default parser factory class. This class can be accessed using its lazy static instance Instance or by creating a new instance.
The factory class by default will register any class with the ParserOperationAttribute attribute within this assembly. Additional assemblies
can be registered using the Register(Assembly) function.
By default, the factory will use SingleDoubleQuoteStringLiteralToken for string literal token and
VariableToken for variable token. These defaults can be changed for the factory instance object.
Inheritance
System.Object
Factory
Implements
System.Collections.Generic.IEnumerable<
IToken>
System.Collections.IEnumerable
Assembly: Albatross.Expression.dll
Syntax
public class Factory : IEnumerable<IToken>, IEnumerable
Constructors
Factory()
Declaration
Properties
Instance
Declaration
public static Factory Instance { get; }
Property Value
Methods
Create(IStringLiteralToken, IVariableToken)
Declaration
public IParser Create(IStringLiteralToken stringLiteralToken = null, IVariableToken variableToken = null)
Parameters
Returns
DefaultStringLiteralToken(IStringLiteralToken)
Declaration
public Factory DefaultStringLiteralToken(IStringLiteralToken token)
Parameters
Returns
DefaultVariableToken(IVariableToken)
Declaration
public Factory DefaultVariableToken(IVariableToken variableToken)
Parameters
Returns
GetEnumerator()
Declaration
public IEnumerator<IToken> GetEnumerator()
Returns
Type |
Description |
System.Collections.Generic.IEnumerator<IToken> |
|
Register(IEnumerable<IToken>)
Register instances of tokens/operations
Declaration
public Factory Register(IEnumerable<IToken> tokens)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<IToken> |
tokens |
Token/operations instances to register
|
Returns
Register(Assembly)
Declaration
public Factory Register(Assembly asm)
Parameters
Type |
Name |
Description |
System.Reflection.Assembly |
asm |
|
Returns
Replace<T, K>()
Declaration
public Factory Replace<T, K>()
where T : IToken where K : IToken, new()
Returns
Type Parameters
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type |
Description |
System.Collections.IEnumerator |
|
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
Extension Methods