C# Класс NArrange.Core.CodeParser

Base code parser implementation.
Наследование: ICodeElementParser
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
WhiteSpaceCharacters char[]

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

Метод Описание
IsWhiteSpace ( char character ) : bool

Determines whether or not the specified character is whitespace.

Parse ( TextReader reader ) : ReadOnlyCollection

Parses a collection of code elements from a stream reader.

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

Метод Описание
ApplyCommentsAndAttributes ( CodeElement codeElement, ReadOnlyCollection comments, ReadOnlyCollection attributes ) : void

Applies attributes and comments to a code element.

DoParseElements ( ) : List

Parses elements from the current point in the stream.

EatChar ( char character ) : void

Eats the specified character.

EatWhiteSpace ( ) : void

Reads until the next non-whitespace character is reached.

EatWhiteSpace ( WhiteSpaceTypes whiteSpaceType ) : void

Reads until the next non-whitespace character is reached.

GetCommentDirectiveText ( CommentElement comment, string pattern, string group ) : string

Gets text from a comment directive, if present.

OnParseError ( string message ) : void

Throws a parse error

PeekNextCharExcept ( char ignores ) : char

Peeks ahead in the reader until the first character not in the ignore list is found and returns it. If already at eof or only characters to be ignored are found until end then '\0' is returned.

ReadLine ( ) : string

Reads the current line. Does not update PreviousChar.

TryReadChar ( ) : bool

Tries to read any character from the stream and places it in the CurrentChar property.

TryReadChar ( char character ) : bool

Tries to read the specified character from the stream and update the CurrentChar property.

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

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

Reset the parser to a state to handle parsing another input.

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

ApplyCommentsAndAttributes() защищенный статический Метод

Applies attributes and comments to a code element.
protected static ApplyCommentsAndAttributes ( CodeElement codeElement, ReadOnlyCollection comments, ReadOnlyCollection attributes ) : void
codeElement NArrange.Core.CodeElements.CodeElement Code element to apply to.
comments ReadOnlyCollection Comments to apply.
attributes ReadOnlyCollection Attributes to apply.
Результат void

DoParseElements() защищенный абстрактный Метод

Parses elements from the current point in the stream.
protected abstract DoParseElements ( ) : List
Результат List

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

Eats the specified character.
protected EatChar ( char character ) : void
character char Character to eat.
Результат void

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

Reads until the next non-whitespace character is reached.
protected EatWhiteSpace ( ) : void
Результат void

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

Reads until the next non-whitespace character is reached.
protected EatWhiteSpace ( WhiteSpaceTypes whiteSpaceType ) : void
whiteSpaceType WhiteSpaceTypes Whitespace type flags.
Результат void

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

Gets text from a comment directive, if present.
protected GetCommentDirectiveText ( CommentElement comment, string pattern, string group ) : string
comment NArrange.Core.CodeElements.CommentElement Comment element containing the directive.
pattern string Regular expression pattern.
group string Group key for the text to retrieve.
Результат string

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

Determines whether or not the specified character is whitespace.
public static IsWhiteSpace ( char character ) : bool
character char Character to test.
Результат bool

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

Throws a parse error
protected OnParseError ( string message ) : void
message string Parse error message.
Результат void

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

Parses a collection of code elements from a stream reader.
public Parse ( TextReader reader ) : ReadOnlyCollection
reader System.IO.TextReader Code stream reader
Результат ReadOnlyCollection

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

Peeks ahead in the reader until the first character not in the ignore list is found and returns it. If already at eof or only characters to be ignored are found until end then '\0' is returned.
protected PeekNextCharExcept ( char ignores ) : char
ignores char
Результат char

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

Reads the current line. Does not update PreviousChar.
protected ReadLine ( ) : string
Результат string

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

Tries to read any character from the stream and places it in the CurrentChar property.
protected TryReadChar ( ) : bool
Результат bool

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

Tries to read the specified character from the stream and update the CurrentChar property.
protected TryReadChar ( char character ) : bool
character char Character to read.
Результат bool

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

WhiteSpaceCharacters защищенное статическое свойство

Whitepace characters.
protected static char[] WhiteSpaceCharacters
Результат char[]