C# 클래스 Parser.ParserBase

An abstract class which is used as the base class for parsers. It contains basic methods which allow you to create a logical tree from a document.
파일 보기 프로젝트 열기: totpero/SqlParser 1 사용 예제들

공개 메소드들

메소드 설명
CheckTextAndPositionArguments ( string text, int position ) : void

Checks the text and position parameters.

CountStringsBefore ( string text, int position, string @string ) : int

Returns how many continuous specified strings are before of the specified position in the specified text

Parse ( string text ) : void

Parses the specified text.

ReadWordOrSeparator ( string text, int &position, bool treatWhiteSpaceAsSeparator ) : string

Reads a single word or separator at the specified position.

SkipWhiteSpace ( string text, int &position ) : void

Skips the white space symbols located at the specified position.

ToText ( ) : string

Returns the text string processed by the parser.

보호된 메소드들

메소드 설명
CheckXmlDocInitialized ( ) : void

Checks whether the m_ParsedDocument is initialized.

ClearXmlNode ( XmlNode node ) : void

Removes all the sub nodes from the specified node.

CreateTagXmlNode ( TagBase tag ) : XmlNode

Creates an xml node for the specified tag.

CreateTextXmlNode ( string text ) : XmlNode

Creates an xml node for the specified text.

GetTagFromType ( string type, string value, bool hasContents ) : TagBase

Retrurns the tag instance from its type and value.

GetTextNodeText ( XmlNode node ) : string

Returns the text stored in the text node.

GetXmlNodeValue ( XmlNode node ) : string

Retrieves the value of the specified tag xml node.

IsTag ( string text, int position ) : Type

Checks whether there is a tag in the text at the specified position, and returns its type.

IsTagXmlNode ( XmlNode node ) : bool

Determines whether the specified node is a tag node.

IsTextXmlNode ( XmlNode node ) : bool

Determines whether the specified node is a text node.

ParseBlock ( XmlNode parentNode, TagBase parentTag, string text, int position ) : int

Parses the specified block of a text.

TagXmlNodeToTag ( XmlNode node ) : TagBase

Converts the specified tag xml node into a tag.

XmlNodeToText ( StringBuilder output, XmlNode node ) : void

Converts the specified xml node to text.

XmlNodesToText ( StringBuilder output, XmlNodeList nodes ) : void

Converts the specified xml node collection to the text.

비공개 메소드들

메소드 설명
TagXmlNodeToText ( StringBuilder output, XmlNode node ) : void

Converts the specified tag xml node to text.

메소드 상세

CheckTextAndPositionArguments() 공개 정적인 메소드

Checks the text and position parameters.
public static CheckTextAndPositionArguments ( string text, int position ) : void
text string
position int
리턴 void

CheckXmlDocInitialized() 보호된 메소드

Checks whether the m_ParsedDocument is initialized.
protected CheckXmlDocInitialized ( ) : void
리턴 void

ClearXmlNode() 보호된 정적인 메소드

Removes all the sub nodes from the specified node.
protected static ClearXmlNode ( XmlNode node ) : void
node System.Xml.XmlNode
리턴 void

CountStringsBefore() 공개 정적인 메소드

Returns how many continuous specified strings are before of the specified position in the specified text
public static CountStringsBefore ( string text, int position, string @string ) : int
text string
position int
@string string
리턴 int

CreateTagXmlNode() 보호된 메소드

Creates an xml node for the specified tag.
protected CreateTagXmlNode ( TagBase tag ) : XmlNode
tag TagBase
리턴 System.Xml.XmlNode

CreateTextXmlNode() 보호된 메소드

Creates an xml node for the specified text.
protected CreateTextXmlNode ( string text ) : XmlNode
text string
리턴 System.Xml.XmlNode

GetTagFromType() 보호된 메소드

Retrurns the tag instance from its type and value.
protected GetTagFromType ( string type, string value, bool hasContents ) : TagBase
type string
value string
hasContents bool
리턴 TagBase

GetTextNodeText() 보호된 메소드

Returns the text stored in the text node.
protected GetTextNodeText ( XmlNode node ) : string
node System.Xml.XmlNode
리턴 string

GetXmlNodeValue() 보호된 메소드

Retrieves the value of the specified tag xml node.
protected GetXmlNodeValue ( XmlNode node ) : string
node System.Xml.XmlNode
리턴 string

IsTag() 보호된 메소드

Checks whether there is a tag in the text at the specified position, and returns its type.
protected IsTag ( string text, int position ) : Type
text string
position int
리턴 System.Type

IsTagXmlNode() 보호된 메소드

Determines whether the specified node is a tag node.
protected IsTagXmlNode ( XmlNode node ) : bool
node System.Xml.XmlNode
리턴 bool

IsTextXmlNode() 보호된 메소드

Determines whether the specified node is a text node.
protected IsTextXmlNode ( XmlNode node ) : bool
node System.Xml.XmlNode
리턴 bool

Parse() 공개 메소드

Parses the specified text.
public Parse ( string text ) : void
text string
리턴 void

ParseBlock() 보호된 메소드

Parses the specified block of a text.
protected ParseBlock ( XmlNode parentNode, TagBase parentTag, string text, int position ) : int
parentNode System.Xml.XmlNode
parentTag TagBase
text string
position int
리턴 int

ReadWordOrSeparator() 공개 정적인 메소드

Reads a single word or separator at the specified position.
public static ReadWordOrSeparator ( string text, int &position, bool treatWhiteSpaceAsSeparator ) : string
text string
position int
treatWhiteSpaceAsSeparator bool
리턴 string

SkipWhiteSpace() 공개 정적인 메소드

Skips the white space symbols located at the specified position.
public static SkipWhiteSpace ( string text, int &position ) : void
text string
position int
리턴 void

TagXmlNodeToTag() 보호된 메소드

Converts the specified tag xml node into a tag.
protected TagXmlNodeToTag ( XmlNode node ) : TagBase
node System.Xml.XmlNode
리턴 TagBase

ToText() 공개 메소드

Returns the text string processed by the parser.
public ToText ( ) : string
리턴 string

XmlNodeToText() 보호된 메소드

Converts the specified xml node to text.
protected XmlNodeToText ( StringBuilder output, XmlNode node ) : void
output StringBuilder
node System.Xml.XmlNode
리턴 void

XmlNodesToText() 보호된 메소드

Converts the specified xml node collection to the text.
protected XmlNodesToText ( StringBuilder output, XmlNodeList nodes ) : void
output StringBuilder
nodes System.Xml.XmlNodeList
리턴 void