C# Класс ComponentFactory.Quicksilver.Binding.Arithmetic

Accept and evaluate simple arithmetic expressions.
Top down predictive parser using an LL(1) BNF expression ::= term expression2 expression2 ::= '+' term expression2 | '-' term expression2 | {empty} term ::= factor term2 term2 ::= '*' factor term2 | '/' factor term2 | {empty} factor ::= '+' factor | '-' factor | primary primary ::= integer-literal | real-literal '(' expression ')'
Показать файл Открыть проект

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
Arithmetic ( ) : System

Initialize a new instance of the Arithmetic class.

Arithmetic ( System.Language language ) : System

Initialize a new instance of the Arithmetic class.

Arithmetic ( string input ) : System

Initialize a new instance of the Arithmetic class.

Arithmetic ( string input, System.Language language ) : System

Initialize a new instance of the Arithmetic class.

Evaluate ( ) : EvalResult

Evaluate and return result.

Evaluate ( object thisObject ) : EvalResult

Evaluate and return result.

Parse ( string input ) : void

Parse the provided input string.

ToString ( ) : string

Human readable version of the parsed input.

Защищенные методы

Метод Описание
ParseExpression ( ) : EvalNode

Parse the 'expression' rule.

expression ::= term expression2

ParseExpression2 ( ) : EvalNode

Parse the 'expression2' rule.

expression2 ::= '+' term expression2 | '-' term expression2 | {empty}

ParseFactor ( ) : EvalNode

Parse the 'factor' rule.

factor ::= '+' factor | '-' factor | primary

ParsePrimary ( ) : EvalNode

Parse the 'primary' rule.

primary ::= integer-literal | real-literal '(' expression ')'

ParseTerm ( ) : EvalNode

Parse the 'term' rule.

term ::= factor term2

ParseTerm2 ( ) : EvalNode

Process the term2 rule.

term2 ::= '*' factor term2 | '/' factor term2 | {empty}

Описание методов

Arithmetic() публичный Метод

Initialize a new instance of the Arithmetic class.
public Arithmetic ( ) : System
Результат System

Arithmetic() публичный Метод

Initialize a new instance of the Arithmetic class.
public Arithmetic ( System.Language language ) : System
language System.Language Language used for parsing.
Результат System

Arithmetic() публичный Метод

Initialize a new instance of the Arithmetic class.
public Arithmetic ( string input ) : System
input string Input string to parse.
Результат System

Arithmetic() публичный Метод

Initialize a new instance of the Arithmetic class.
public Arithmetic ( string input, System.Language language ) : System
input string Input string to parse.
language System.Language Language used for parsing.
Результат System

Evaluate() публичный Метод

Evaluate and return result.
public Evaluate ( ) : EvalResult
Результат EvalResult

Evaluate() публичный Метод

Evaluate and return result.
public Evaluate ( object thisObject ) : EvalResult
thisObject object Reference to object that is exposed as 'this'.
Результат EvalResult

Parse() публичный Метод

Parse the provided input string.
public Parse ( string input ) : void
input string Input text.
Результат void

ParseExpression() защищенный Метод

Parse the 'expression' rule.
expression ::= term expression2
protected ParseExpression ( ) : EvalNode
Результат EvalNode

ParseExpression2() защищенный Метод

Parse the 'expression2' rule.
expression2 ::= '+' term expression2 | '-' term expression2 | {empty}
protected ParseExpression2 ( ) : EvalNode
Результат EvalNode

ParseFactor() защищенный Метод

Parse the 'factor' rule.
factor ::= '+' factor | '-' factor | primary
protected ParseFactor ( ) : EvalNode
Результат EvalNode

ParsePrimary() защищенный Метод

Parse the 'primary' rule.
primary ::= integer-literal | real-literal '(' expression ')'
protected ParsePrimary ( ) : EvalNode
Результат EvalNode

ParseTerm() защищенный Метод

Parse the 'term' rule.
term ::= factor term2
protected ParseTerm ( ) : EvalNode
Результат EvalNode

ParseTerm2() защищенный Метод

Process the term2 rule.
term2 ::= '*' factor term2 | '/' factor term2 | {empty}
protected ParseTerm2 ( ) : EvalNode
Результат EvalNode

ToString() публичный Метод

Human readable version of the parsed input.
public ToString ( ) : string
Результат string