C# Класс YAMP.ParseEngine

The parse engine of YAMP. This engine has been introduced with YAMP v1.2 and is called YAMP-PE, which stands for YAMP-ParseEngine.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
AddError ParseEngine
AddError ParseEngine
Advance ParseEngine
Advance ParseEngine
AdvanceTo ParseEngine
AdvanceTo ParseEngine
AdvanceToNextLine ParseEngine
HasMarker System.Boolean
InsertMarker ParseEngine
ParseBlock Statement
ParseStatement Statement
ParseStatement Statement
RemoveMarker ParseEngine
Replace ParseEngine
SetOffset ParseEngine
SetPointer ParseEngine
Skip ParseEngine

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

Метод Описание
IsBlockComment ( Char ch1, Char ch2 ) : System.Boolean

Determines if the given content is a block comment.

IsComment ( Char ch1, Char ch2 ) : System.Boolean

Determines if the given content is a (block or line) comment.

IsIdentifierPart ( Char ch ) : System.Boolean

Determines if the given character is the part of an identifier character.

IsIdentifierStart ( Char ch ) : System.Boolean

Determines if the given character is the start of an identifier.

IsLetter ( Char ch ) : System.Boolean

Determines if the given character is a letter character.

IsLineComment ( Char ch1, Char ch2 ) : System.Boolean

Determines if the given content is a line comment.

IsNewLine ( Char ch ) : System.Boolean

Determines if the given character is a new line character.

IsNumber ( Char ch ) : System.Boolean

Determines if the given character is a number character.

IsWhiteSpace ( Char ch ) : System.Boolean

Determines if the given character is a white space character.

Parse ( ) : ParseEngine

Runs the parser over the inserted query.

Parse ( System.Boolean generateExpressionDebug ) : String

Runs the parser over the inserted query.

ParseEngine ( QueryContext query, ParseContext context ) : System

Creates a new instance of the parse engine.

Reset ( ) : ParseEngine

Resets the complete parse tree.

ToString ( ) : String

Transforms the contained expression blocks into one string.

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

Метод Описание
AddError ( YAMPParseError error ) : ParseEngine

Add a parse error to the list of parse errors.

AddError ( YAMPParseError error, Block part ) : ParseEngine

Add a parse error to the list of parse errors with the block causing the error.

Advance ( ) : ParseEngine

Advances by one character.

Advance ( Int32 shift ) : ParseEngine

Advances by the specified amount of characters.

AdvanceTo ( Char target ) : ParseEngine

Advances to a specified character.

AdvanceTo ( String target ) : ParseEngine

Advances to a sequence of characters given by string.

AdvanceToNextLine ( ) : ParseEngine

Advances to the next line, i.e. the next new line character.

HasMarker ( Marker marker ) : System.Boolean
InsertMarker ( Marker marker ) : ParseEngine
ParseBlock ( Statement statement, Operator defaultOperator = null ) : Statement

Parses a block with a default operator if no operator has been found.

ParseStatement ( ) : Statement

Standard parsing of a statement (ends with ; or }).

ParseStatement ( Char termination, YAMPParseError>.Func terminationMissing = null, Func handleCharacter = null ) : Statement

More custom parsing of a statement (ends with a custom termination char).

RemoveMarker ( Marker marker ) : ParseEngine
Replace ( Int32 index, Char replacement ) : ParseEngine

Replaces a character at a specified index by the given one.

SetOffset ( Int32 line, Int32 column ) : ParseEngine

Sets an offset of the parser, i.e. sets line and column to (different) values.

SetPointer ( Int32 newPosition ) : ParseEngine

Sets the character pointer to a new position.

Skip ( ) : ParseEngine

Skips to the next significant character avoiding line comments, block comments, whitespaces or new lines.

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

IsBlockComment() публичный статический Метод

Determines if the given content is a block comment.
public static IsBlockComment ( Char ch1, Char ch2 ) : System.Boolean
ch1 Char The leading character to be examined.
ch2 Char The succeeding character to be investigated.
Результат System.Boolean

IsComment() публичный статический Метод

Determines if the given content is a (block or line) comment.
public static IsComment ( Char ch1, Char ch2 ) : System.Boolean
ch1 Char The leading character to be examined.
ch2 Char The succeeding character to be investigated.
Результат System.Boolean

IsIdentifierPart() публичный статический Метод

Determines if the given character is the part of an identifier character.
public static IsIdentifierPart ( Char ch ) : System.Boolean
ch Char The character to be examined.
Результат System.Boolean

IsIdentifierStart() публичный статический Метод

Determines if the given character is the start of an identifier.
public static IsIdentifierStart ( Char ch ) : System.Boolean
ch Char The character to be examined.
Результат System.Boolean

IsLetter() публичный статический Метод

Determines if the given character is a letter character.
public static IsLetter ( Char ch ) : System.Boolean
ch Char The character to be examined.
Результат System.Boolean

IsLineComment() публичный статический Метод

Determines if the given content is a line comment.
public static IsLineComment ( Char ch1, Char ch2 ) : System.Boolean
ch1 Char The leading character to be examined.
ch2 Char The succeeding character to be investigated.
Результат System.Boolean

IsNewLine() публичный статический Метод

Determines if the given character is a new line character.
public static IsNewLine ( Char ch ) : System.Boolean
ch Char The character to be examined.
Результат System.Boolean

IsNumber() публичный статический Метод

Determines if the given character is a number character.
public static IsNumber ( Char ch ) : System.Boolean
ch Char The character to be examined.
Результат System.Boolean

IsWhiteSpace() публичный статический Метод

Determines if the given character is a white space character.
public static IsWhiteSpace ( Char ch ) : System.Boolean
ch Char The character to be examined.
Результат System.Boolean

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

Runs the parser over the inserted query.
public Parse ( ) : ParseEngine
Результат ParseEngine

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

Runs the parser over the inserted query.
public Parse ( System.Boolean generateExpressionDebug ) : String
generateExpressionDebug System.Boolean /// Generate a string representation of the Expression tree to help debugging. ///
Результат String

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

Creates a new instance of the parse engine.
public ParseEngine ( QueryContext query, ParseContext context ) : System
query QueryContext The query context to consider.
context ParseContext The parser context to use.
Результат System

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

Resets the complete parse tree.
public Reset ( ) : ParseEngine
Результат ParseEngine

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

Transforms the contained expression blocks into one string.
public ToString ( ) : String
Результат String