C# Class 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.
Afficher le fichier Open project: FlorianRappl/YAMP Class Usage Examples

Private Properties

Свойство Type Description
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

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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.

Method Details

IsBlockComment() public static méthode

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.
Résultat System.Boolean

IsComment() public static méthode

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.
Résultat System.Boolean

IsIdentifierPart() public static méthode

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.
Résultat System.Boolean

IsIdentifierStart() public static méthode

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.
Résultat System.Boolean

IsLetter() public static méthode

Determines if the given character is a letter character.
public static IsLetter ( Char ch ) : System.Boolean
ch Char The character to be examined.
Résultat System.Boolean

IsLineComment() public static méthode

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.
Résultat System.Boolean

IsNewLine() public static méthode

Determines if the given character is a new line character.
public static IsNewLine ( Char ch ) : System.Boolean
ch Char The character to be examined.
Résultat System.Boolean

IsNumber() public static méthode

Determines if the given character is a number character.
public static IsNumber ( Char ch ) : System.Boolean
ch Char The character to be examined.
Résultat System.Boolean

IsWhiteSpace() public static méthode

Determines if the given character is a white space character.
public static IsWhiteSpace ( Char ch ) : System.Boolean
ch Char The character to be examined.
Résultat System.Boolean

Parse() public méthode

Runs the parser over the inserted query.
public Parse ( ) : ParseEngine
Résultat ParseEngine

Parse() public méthode

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. ///
Résultat String

ParseEngine() public méthode

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.
Résultat System

Reset() public méthode

Resets the complete parse tree.
public Reset ( ) : ParseEngine
Résultat ParseEngine

ToString() public méthode

Transforms the contained expression blocks into one string.
public ToString ( ) : String
Résultat String