Class Parser
Default class for parsing a string representing a dice expression into a DiceExpression instance.
Implements
Inherited Members
Namespace: GoRogue.DiceNotation
Assembly: GoRogue.dll
Syntax
public class Parser : IParser
Constructors
View SourceParser()
Declaration
public Parser()
Methods
View SourceParse(string)
Parses the dice expression specified into a DiceExpression instance.
Declaration
public DiceExpression Parse(string expression)
Parameters
Type | Name | Description |
---|---|---|
string | expression | The expression to parse. |
Returns
Type | Description |
---|---|
DiceExpression | An DiceExpression representing the given expression, that can "roll" the expression on command. |
Remarks
Breaks the dice expression into postfix form, and evaluates the postfix expression to the degree necessary to produce the appropriate chain of ITerm instances.