C# Класс Microsoft.R.Core.AST.Expressions.Expression

Implements shunting yard algorithm of expression parsing. https://en.wikipedia.org/wiki/Shunting-yard_algorithm
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Expression ( bool inGroup ) : System.Diagnostics

Constructs an expression that will be parsed as it is inside braces (in a group) so expression parsing will continue even if there is a line break that would normally terminate the expression.

Expression ( string terminatingKeyword ) : System.Diagnostics
Parse ( ParseContext context, IAstNode parent ) : bool
ToString ( ) : string

Приватные методы

Метод Описание
CheckEndOfExpression ( ParseContext context, OperationType currentOperationType ) : bool
CreateConstant ( ParseContext context ) : IRValueNode
GetErrorRange ( ParseContext context ) : ITextRange
GetIndexerOrFunctionErrorRange ( ParseContext context, IOperator operatorNode ) : ITextRange
GetOperandErrorRange ( ParseContext context ) : ITextRange
GetOperatorErrorRange ( ParseContext context ) : ITextRange
HandleConstant ( ParseContext context ) : OperationType
HandleIdentifier ( ParseContext context ) : OperationType
HandleKeyword ( ParseContext context, ParseErrorType &errorType ) : OperationType
HandleKeyword ( ParseContext context, string keyword ) : ParseErrorType
HandleLambda ( ParseContext context, ParseErrorType &errorType ) : OperationType
HandleOpenBrace ( ParseContext context, ParseErrorType &errorType ) : OperationType
HandleOperator ( ParseContext context, ParseErrorType &errorType ) : OperationType
HandleOperator ( ParseContext context, IAstNode parent, bool &isUnary ) : ParseErrorType
HandleOperatorPrecedence ( ParseContext context, IOperator currentOperator ) : ParseErrorType
HandleSquareBrackets ( ParseContext context, ParseErrorType &errorType ) : OperationType
IsConsistentOperationSequence ( ParseContext context, OperationType currentOperationType ) : bool
IsTerminatingKeyword ( string s ) : bool
MakeNode ( ParseContext context ) : ParseErrorType

Constructs AST node from operator (root) and one or two operands. In order for the node to be successfully created stacks must contain an operator and, depending on the operator, one or two operands.

ParseExpression ( ParseContext context ) : bool
ProcessHigherPrecendenceOperators ( ParseContext context, IOperator currentOperator ) : ParseErrorType
SafeGetLeftOperand ( IOperator operatorNode ) : IRValueNode
SafeGetOperand ( IOperator operatorNode ) : IRValueNode
SafeGetRightOperand ( IOperator operatorNode ) : IRValueNode

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

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

Constructs an expression that will be parsed as it is inside braces (in a group) so expression parsing will continue even if there is a line break that would normally terminate the expression.
public Expression ( bool inGroup ) : System.Diagnostics
inGroup bool
Результат System.Diagnostics

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

public Expression ( string terminatingKeyword ) : System.Diagnostics
terminatingKeyword string
Результат System.Diagnostics

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

public Parse ( ParseContext context, IAstNode parent ) : bool
context Microsoft.R.Core.Parser.ParseContext
parent IAstNode
Результат bool

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

public ToString ( ) : string
Результат string