C# Класс Tidy.Core.Lexer

Lexer for html parser (c) 1998-2000 (W3C) MIT, INRIA, Keio University See Tidy.cs for the copyright notice. Derived from HTML Tidy Release 4 Aug 2000
Given a file stream fp it returns a sequence of tokens. GetToken(fp) gets the next token UngetToken(fp) provides one level undo The tags include an attribute list: - linked list of attribute/value nodes - each node has 2 null-terminated strings. - entities are replaced in attribute values white space is compacted if not in preformatted mode If not in preformatted mode then leading white space is discarded and subsequent white space sequences compacted to single space chars. If XmlTags is no then Tag names are folded to upper case and attribute names to lower case. Not yet done: - Doctype subset and marked sections
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
BadAccess int
BadChars int
BadDoctype bool
BadForm int
BadLayout int
Columns int
Doctype HtmlVersion
ExcludeBlocks bool
Exiled bool
Inode Node
Input StreamIn
Insert int
Insertspace bool
Istack Stack
Istackbase int
Isvoyager bool
Lexbuf byte[]
Lexlength int
Lexsize int
Lines int
Messages TidyMessageCollection
Options TidyOptions
Pushed bool
State short
Styles Style
Token Node
Txtend int
Txtstart int
Versions HtmlVersion
Waswhite bool

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

Свойство Тип Описание
SeenBodyEndTag int

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

Метод Описание
AddByte ( int c ) : void
AddCharToLexer ( int c ) : void
AddGenerator ( Node root ) : bool
AddStringLiteral ( string str ) : void
AddStringToLexer ( string str ) : void
ApparentVersion ( ) : HtmlVersion
CanPrune ( Node element ) : bool
ChangeChar ( byte c ) : void
CheckDocTypeKeyWords ( Node doctype ) : bool
CloneAttributes ( AttVal attrs ) : AttVal
CloneNode ( Node node ) : Node
DeferDup ( ) : void
EndOfInput ( ) : bool
ExpectsContent ( Node node ) : bool
FindGivenVersion ( Node doctype ) : HtmlVersion
FixDocType ( Node root ) : bool
FixHtmlNameSpace ( Node root, string profile ) : void
FixId ( Node node ) : void
FixXmlPi ( Node root ) : bool
FoldCase ( char c, bool tocaps, bool xmlTags ) : char
GetBytes ( string str ) : byte[]
GetCdata ( Node container ) : Node
GetHtmlVersion ( ) : HtmlVersion
GetString ( byte bytes, int offset, int length ) : string
GetToken ( short mode ) : Node
HtmlVersionName ( ) : string
InferredTag ( string name ) : Node
InlineDup ( Node node ) : int
InsertedToken ( ) : Node
IsPushed ( Node node ) : bool
IsValidAttrName ( string attr ) : bool
Lexer ( StreamIn input, TidyOptions options ) : System
NewLineNode ( ) : Node
NewNode ( ) : Node
NewNode ( short type, byte textarray, int start, int end ) : Node
NewNode ( short type, byte textarray, int start, int end, string element ) : Node
ParseAsp ( ) : Node
ParseAttribute ( MutableBoolean isempty, MutableObject asp, MutableObject php ) : string
ParseAttrs ( MutableBoolean isempty ) : AttVal
ParseEntity ( short mode ) : void
ParsePhp ( ) : Node
ParseServerInstruction ( ) : int
ParseTagName ( ) : char
ParseValue ( string name, bool foldCase, MutableBoolean isempty, MutableInteger pdelim ) : string
PopInline ( Node node ) : void
PushInline ( Node node ) : void
SetXhtmlDocType ( Node root ) : bool
UngetToken ( ) : void

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

Метод Описание
UpdateNodeTextArrays ( byte oldtextarray, byte newtextarray ) : void

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

Метод Описание
FindBadSubString ( string s, string p, int len ) : bool
Lexer ( ) : System
Map ( char c ) : short
MapStr ( string str, int code ) : void

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

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

public AddByte ( int c ) : void
c int
Результат void

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

public AddCharToLexer ( int c ) : void
c int
Результат void

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

public AddGenerator ( Node root ) : bool
root Node
Результат bool

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

public AddStringLiteral ( string str ) : void
str string
Результат void

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

public AddStringToLexer ( string str ) : void
str string
Результат void

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

public ApparentVersion ( ) : HtmlVersion
Результат HtmlVersion

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

public CanPrune ( Node element ) : bool
element Node
Результат bool

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

public ChangeChar ( byte c ) : void
c byte
Результат void

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

public CheckDocTypeKeyWords ( Node doctype ) : bool
doctype Node
Результат bool

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

public CloneAttributes ( AttVal attrs ) : AttVal
attrs AttVal
Результат AttVal

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

public CloneNode ( Node node ) : Node
node Node
Результат Node

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

public DeferDup ( ) : void
Результат void

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

public EndOfInput ( ) : bool
Результат bool

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

public static ExpectsContent ( Node node ) : bool
node Node
Результат bool

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

public FindGivenVersion ( Node doctype ) : HtmlVersion
doctype Node
Результат HtmlVersion

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

public FixDocType ( Node root ) : bool
root Node
Результат bool

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

public FixHtmlNameSpace ( Node root, string profile ) : void
root Node
profile string
Результат void

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

public FixId ( Node node ) : void
node Node
Результат void

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

public FixXmlPi ( Node root ) : bool
root Node
Результат bool

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

public static FoldCase ( char c, bool tocaps, bool xmlTags ) : char
c char
tocaps bool
xmlTags bool
Результат char

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

public static GetBytes ( string str ) : byte[]
str string
Результат byte[]

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

public GetCdata ( Node container ) : Node
container Node
Результат Node

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

public GetHtmlVersion ( ) : HtmlVersion
Результат HtmlVersion

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

public static GetString ( byte bytes, int offset, int length ) : string
bytes byte
offset int
length int
Результат string

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

public GetToken ( short mode ) : Node
mode short
Результат Node

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

public HtmlVersionName ( ) : string
Результат string

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

public InferredTag ( string name ) : Node
name string
Результат Node

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

public InlineDup ( Node node ) : int
node Node
Результат int

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

public InsertedToken ( ) : Node
Результат Node

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

public IsPushed ( Node node ) : bool
node Node
Результат bool

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

public static IsValidAttrName ( string attr ) : bool
attr string
Результат bool

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

public Lexer ( StreamIn input, TidyOptions options ) : System
input StreamIn
options TidyOptions
Результат System

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

public NewLineNode ( ) : Node
Результат Node

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

public NewNode ( ) : Node
Результат Node

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

public NewNode ( short type, byte textarray, int start, int end ) : Node
type short
textarray byte
start int
end int
Результат Node

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

public NewNode ( short type, byte textarray, int start, int end, string element ) : Node
type short
textarray byte
start int
end int
element string
Результат Node

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

public ParseAsp ( ) : Node
Результат Node

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

public ParseAttribute ( MutableBoolean isempty, MutableObject asp, MutableObject php ) : string
isempty MutableBoolean
asp MutableObject
php MutableObject
Результат string

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

public ParseAttrs ( MutableBoolean isempty ) : AttVal
isempty MutableBoolean
Результат AttVal

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

public ParseEntity ( short mode ) : void
mode short
Результат void

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

public ParsePhp ( ) : Node
Результат Node

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

public ParseServerInstruction ( ) : int
Результат int

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

public ParseTagName ( ) : char
Результат char

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

public ParseValue ( string name, bool foldCase, MutableBoolean isempty, MutableInteger pdelim ) : string
name string
foldCase bool
isempty MutableBoolean
pdelim MutableInteger
Результат string

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

public PopInline ( Node node ) : void
node Node
Результат void

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

public PushInline ( Node node ) : void
node Node
Результат void

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

public SetXhtmlDocType ( Node root ) : bool
root Node
Результат bool

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

public UngetToken ( ) : void
Результат void

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

protected UpdateNodeTextArrays ( byte oldtextarray, byte newtextarray ) : void
oldtextarray byte
newtextarray byte
Результат void

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

BadAccess публичное свойство

public int BadAccess
Результат int

BadChars публичное свойство

public int BadChars
Результат int

BadDoctype публичное свойство

public bool BadDoctype
Результат bool

BadForm публичное свойство

public int BadForm
Результат int

BadLayout публичное свойство

public int BadLayout
Результат int

Columns публичное свойство

public int Columns
Результат int

Doctype публичное свойство

public HtmlVersion Doctype
Результат HtmlVersion

ExcludeBlocks публичное свойство

public bool ExcludeBlocks
Результат bool

Exiled публичное свойство

public bool Exiled
Результат bool

Inode публичное свойство

public Node,Tidy.Core Inode
Результат Node

Input публичное свойство

public StreamIn,Tidy.Core Input
Результат StreamIn

Insert публичное свойство

public int Insert
Результат int

Insertspace публичное свойство

public bool Insertspace
Результат bool

Istack публичное свойство

public Stack Istack
Результат Stack

Istackbase публичное свойство

public int Istackbase
Результат int

Isvoyager публичное свойство

public bool Isvoyager
Результат bool

Lexbuf публичное свойство

public byte[] Lexbuf
Результат byte[]

Lexlength публичное свойство

public int Lexlength
Результат int

Lexsize публичное свойство

public int Lexsize
Результат int

Lines публичное свойство

public int Lines
Результат int

Messages публичное свойство

public TidyMessageCollection Messages
Результат TidyMessageCollection

Options публичное свойство

public TidyOptions,Tidy.Core Options
Результат TidyOptions

Pushed публичное свойство

public bool Pushed
Результат bool

SeenBodyEndTag защищенное свойство

protected int SeenBodyEndTag
Результат int

State публичное свойство

public short State
Результат short

Styles публичное свойство

public Style,Tidy.Core Styles
Результат Style

Token публичное свойство

public Node,Tidy.Core Token
Результат Node

Txtend публичное свойство

public int Txtend
Результат int

Txtstart публичное свойство

public int Txtstart
Результат int

Versions публичное свойство

public HtmlVersion Versions
Результат HtmlVersion

Waswhite публичное свойство

public bool Waswhite
Результат bool