C# Class NGettext.Plural.Ast.AstTokenParser

Plural rule formula parser. Ported from the I18n component from Zend Framework (https://github.com/zendframework/zf2).
Mostra file Open project: neris/NGettext Class Usage Examples

Protected Properties

Property Type Description
CurrentToken Token
Input string
Position int
TokenDefinitions TokenDefinition>.Dictionary

Public Methods

Method Description
AstTokenParser ( ) : System

Initializes a new instance of the AstTokenParser class with default token definitions.

Parse ( string input ) : Token

Parses the input string that contains a plural rule formula and generates an abstract syntax tree.

Protected Methods

Method Description
AdvancePosition ( ) : void
AdvancePosition ( TokenType expectedTokenType ) : void
GetDefinition ( TokenType tokenType ) : TokenDefinition
GetNextToken ( ) : Token
ParseNextExpression ( int rightBindingPower ) : Token
RegisterLeftInfixTokenDefinition ( TokenType tokenType, int leftBindingPower ) : TokenDefinition
RegisterPrefixTokenDefinition ( TokenType tokenType, int leftBindingPower ) : TokenDefinition
RegisterRightInfixTokenDefinition ( TokenType tokenType, int leftBindingPower ) : TokenDefinition
RegisterTokenDefinition ( TokenType tokenType, int leftBindingPower ) : TokenDefinition

Method Details

AdvancePosition() protected method

protected AdvancePosition ( ) : void
return void

AdvancePosition() protected method

protected AdvancePosition ( TokenType expectedTokenType ) : void
expectedTokenType TokenType
return void

AstTokenParser() public method

Initializes a new instance of the AstTokenParser class with default token definitions.
public AstTokenParser ( ) : System
return System

GetDefinition() protected method

protected GetDefinition ( TokenType tokenType ) : TokenDefinition
tokenType TokenType
return TokenDefinition

GetNextToken() protected method

protected GetNextToken ( ) : Token
return Token

Parse() public method

Parses the input string that contains a plural rule formula and generates an abstract syntax tree.
public Parse ( string input ) : Token
input string Input string.
return Token

ParseNextExpression() protected method

protected ParseNextExpression ( int rightBindingPower ) : Token
rightBindingPower int
return Token

RegisterLeftInfixTokenDefinition() protected method

protected RegisterLeftInfixTokenDefinition ( TokenType tokenType, int leftBindingPower ) : TokenDefinition
tokenType TokenType
leftBindingPower int
return TokenDefinition

RegisterPrefixTokenDefinition() protected method

protected RegisterPrefixTokenDefinition ( TokenType tokenType, int leftBindingPower ) : TokenDefinition
tokenType TokenType
leftBindingPower int
return TokenDefinition

RegisterRightInfixTokenDefinition() protected method

protected RegisterRightInfixTokenDefinition ( TokenType tokenType, int leftBindingPower ) : TokenDefinition
tokenType TokenType
leftBindingPower int
return TokenDefinition

RegisterTokenDefinition() protected method

protected RegisterTokenDefinition ( TokenType tokenType, int leftBindingPower ) : TokenDefinition
tokenType TokenType
leftBindingPower int
return TokenDefinition

Property Details

CurrentToken protected_oe property

protected Token,NGettext.Plural.Ast CurrentToken
return Token

Input protected_oe property

protected string Input
return string

Position protected_oe property

protected int Position
return int

TokenDefinitions protected_oe property

protected Dictionary TokenDefinitions
return TokenDefinition>.Dictionary