C# Класс TextParser.Parser

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
AddFieldsFromAssembly ( string name ) : bool

Add the field from the given assembly as field filters.

AddFieldsFromAssembly ( string name, bool addReferences ) : bool

Add the field from the given assembly as field filters.

AddFieldsFromAssembly ( string name, bool addReferences, string fromNamespace ) : bool

Add the field from the given assembly as field filters.

GetLineNumber ( ) : int

Gets the number of lines the text has.

GetNextBlock ( ) : TextBlock?

Get the next block of text.

InitParsing ( ) : bool

Initialize the parsing engine.

InitParsing ( int startIndex ) : bool

Initialize the parsing engine.

LoadFilters ( IParserFilters filters ) : void

Load the filters from the given IParserFilters object.

LoadText ( StreamReader stream ) : bool

Loads the text from the given stream.

Parser ( ) : System

Default constructor.

Parser ( IParserFilters filters ) : System

Constructor with the possibility to load the word filters.

RemoveAllFilters ( ) : void

Removes all loaded filters.

ResetParser ( ) : void

Resets the parser.

ResetParser ( int startIndex ) : void

Resets the parser.

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

Метод Описание
InitParser ( ) : void

Initializes the structures used by the parser.

Called by the constructor.

IsCommentSeparator ( string s ) : TextSeparator?

Checks if the given string is a comment separator.

IsField ( string s ) : bool

Checks if the given string is a field.

Optimized

IsKeyword ( string s ) : bool

Checks if the given string is a keyword.

Optimized

IsNumber ( string s ) : bool

Checks if a string represents a number;

IsOperator ( string s ) : bool

Checks if the given string is an operator.

Optimized

IsPartOfKeywordInvalid ( char c ) : bool

Checks if the given character is part of a string or comment separator.

IsSeparator ( char c ) : bool

Checks if the given string is a separator.

IsStringSeparator ( string s ) : TextSeparator?

Checks if the given string is a string separator.

StringContainsChar ( string s, char c ) : bool

Checks if a string contains a specific character.

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

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

Add the field from the given assembly as field filters.
public AddFieldsFromAssembly ( string name ) : bool
name string The name of the assembly or the exact path to it.
Результат bool

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

Add the field from the given assembly as field filters.
public AddFieldsFromAssembly ( string name, bool addReferences ) : bool
name string The name of the assembly or the exact path to it.
addReferences bool Add the fields from the assemblies referenced by the given one.
Результат bool

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

Add the field from the given assembly as field filters.
public AddFieldsFromAssembly ( string name, bool addReferences, string fromNamespace ) : bool
name string The name of the assembly or the exact path to it.
addReferences bool Add the fields from the assemblies referenced by the given one.
fromNamespace string Add fields only from the given namespaces.
Результат bool

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

Gets the number of lines the text has.
public GetLineNumber ( ) : int
Результат int

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

Get the next block of text.
public GetNextBlock ( ) : TextBlock?
Результат TextBlock?

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

Initialize the parsing engine.
public InitParsing ( ) : bool
Результат bool

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

Initialize the parsing engine.
public InitParsing ( int startIndex ) : bool
startIndex int The index in the text from where to start parsing.
Результат bool

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

Load the filters from the given IParserFilters object.
public LoadFilters ( IParserFilters filters ) : void
filters IParserFilters The IParserFilters derived class from where to load the filters.
Результат void

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

Loads the text from the given stream.
public LoadText ( StreamReader stream ) : bool
stream System.IO.StreamReader The stream from where to load the filters.
Результат bool

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

Default constructor.
public Parser ( ) : System
Результат System

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

Constructor with the possibility to load the word filters.
public Parser ( IParserFilters filters ) : System
filters IParserFilters
Результат System

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

Removes all loaded filters.
public RemoveAllFilters ( ) : void
Результат void

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

Resets the parser.
public ResetParser ( ) : void
Результат void

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

Resets the parser.
public ResetParser ( int startIndex ) : void
startIndex int The index in the text from where to start parsing.
Результат void