Class ExpressionParser
Represents a generic expression parser.
Inherited Members
Namespace: Swan.Parsers
Syntax
public abstract class ExpressionParser
Methods
Parse(IEnumerable<Token>)
Parses the specified tokens.
Declaration
public virtual Expression Parse(IEnumerable<Token> tokens)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Token> | tokens | The tokens. |
Returns
Type | Description |
---|---|
Expression | The final expression. |
Parse(IEnumerable<Token>, IFormatProvider)
Parses the specified tokens.
Declaration
public virtual Expression Parse(IEnumerable<Token> tokens, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Token> | tokens | The tokens. |
IFormatProvider | formatProvider | The format provider. |
Returns
Type | Description |
---|---|
Expression | The final expression. |
ResolveExpression<T>(IEnumerable<Token>)
Resolves the expression.
Declaration
public virtual T ResolveExpression<T>(IEnumerable<Token> tokens)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Token> | tokens | The tokens. |
Returns
Type | Description |
---|---|
T | The representation of the expression parsed. |
Type Parameters
Name | Description |
---|---|
T | The type of expression result. |
ResolveExpression<T>(IEnumerable<Token>, IFormatProvider)
Resolves the expression.
Declaration
public virtual T ResolveExpression<T>(IEnumerable<Token> tokens, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Token> | tokens | The tokens. |
IFormatProvider | formatProvider | The format provider. |
Returns
Type | Description |
---|---|
T | The representation of the expression parsed. |
Type Parameters
Name | Description |
---|---|
T | The type of expression result. |
ResolveFunction(String, Stack<Expression>)
Resolves the function.
Declaration
public abstract void ResolveFunction(string value, Stack<Expression> expressionStack)
Parameters
Type | Name | Description |
---|---|---|
String | value | The value. |
Stack<Expression> | expressionStack | The expression stack. |
ResolveOperator(String, Stack<Expression>)
Resolves the operator.
Declaration
public abstract void ResolveOperator(string value, Stack<Expression> expressionStack)
Parameters
Type | Name | Description |
---|---|---|
String | value | The value. |
Stack<Expression> | expressionStack | The expression stack. |
ResolveVariable(String, Stack<Expression>)
Resolves the variable.
Declaration
public abstract void ResolveVariable(string value, Stack<Expression> expressionStack)
Parameters
Type | Name | Description |
---|---|---|
String | value | The value. |
Stack<Expression> | expressionStack | The expression stack. |