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

Méthodes publiques

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

Свойство Type Description
SeenBodyEndTag int

Méthodes publiques

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

Méthodes protégées

Méthode Description
UpdateNodeTextArrays ( byte oldtextarray, byte newtextarray ) : void

Private Methods

Méthode Description
FindBadSubString ( string s, string p, int len ) : bool
Lexer ( ) : System
Map ( char c ) : short
MapStr ( string str, int code ) : void

Method Details

AddByte() public méthode

public AddByte ( int c ) : void
c int
Résultat void

AddCharToLexer() public méthode

public AddCharToLexer ( int c ) : void
c int
Résultat void

AddGenerator() public méthode

public AddGenerator ( Node root ) : bool
root Node
Résultat bool

AddStringLiteral() public méthode

public AddStringLiteral ( string str ) : void
str string
Résultat void

AddStringToLexer() public méthode

public AddStringToLexer ( string str ) : void
str string
Résultat void

ApparentVersion() public méthode

public ApparentVersion ( ) : HtmlVersion
Résultat HtmlVersion

CanPrune() public méthode

public CanPrune ( Node element ) : bool
element Node
Résultat bool

ChangeChar() public méthode

public ChangeChar ( byte c ) : void
c byte
Résultat void

CheckDocTypeKeyWords() public méthode

public CheckDocTypeKeyWords ( Node doctype ) : bool
doctype Node
Résultat bool

CloneAttributes() public méthode

public CloneAttributes ( AttVal attrs ) : AttVal
attrs AttVal
Résultat AttVal

CloneNode() public méthode

public CloneNode ( Node node ) : Node
node Node
Résultat Node

DeferDup() public méthode

public DeferDup ( ) : void
Résultat void

EndOfInput() public méthode

public EndOfInput ( ) : bool
Résultat bool

ExpectsContent() public static méthode

public static ExpectsContent ( Node node ) : bool
node Node
Résultat bool

FindGivenVersion() public méthode

public FindGivenVersion ( Node doctype ) : HtmlVersion
doctype Node
Résultat HtmlVersion

FixDocType() public méthode

public FixDocType ( Node root ) : bool
root Node
Résultat bool

FixHtmlNameSpace() public méthode

public FixHtmlNameSpace ( Node root, string profile ) : void
root Node
profile string
Résultat void

FixId() public méthode

public FixId ( Node node ) : void
node Node
Résultat void

FixXmlPi() public méthode

public FixXmlPi ( Node root ) : bool
root Node
Résultat bool

FoldCase() public static méthode

public static FoldCase ( char c, bool tocaps, bool xmlTags ) : char
c char
tocaps bool
xmlTags bool
Résultat char

GetBytes() public static méthode

public static GetBytes ( string str ) : byte[]
str string
Résultat byte[]

GetCdata() public méthode

public GetCdata ( Node container ) : Node
container Node
Résultat Node

GetHtmlVersion() public méthode

public GetHtmlVersion ( ) : HtmlVersion
Résultat HtmlVersion

GetString() public static méthode

public static GetString ( byte bytes, int offset, int length ) : string
bytes byte
offset int
length int
Résultat string

GetToken() public méthode

public GetToken ( short mode ) : Node
mode short
Résultat Node

HtmlVersionName() public méthode

public HtmlVersionName ( ) : string
Résultat string

InferredTag() public méthode

public InferredTag ( string name ) : Node
name string
Résultat Node

InlineDup() public méthode

public InlineDup ( Node node ) : int
node Node
Résultat int

InsertedToken() public méthode

public InsertedToken ( ) : Node
Résultat Node

IsPushed() public méthode

public IsPushed ( Node node ) : bool
node Node
Résultat bool

IsValidAttrName() public static méthode

public static IsValidAttrName ( string attr ) : bool
attr string
Résultat bool

Lexer() public méthode

public Lexer ( StreamIn input, TidyOptions options ) : System
input StreamIn
options TidyOptions
Résultat System

NewLineNode() public méthode

public NewLineNode ( ) : Node
Résultat Node

NewNode() public méthode

public NewNode ( ) : Node
Résultat Node

NewNode() public méthode

public NewNode ( short type, byte textarray, int start, int end ) : Node
type short
textarray byte
start int
end int
Résultat Node

NewNode() public méthode

public NewNode ( short type, byte textarray, int start, int end, string element ) : Node
type short
textarray byte
start int
end int
element string
Résultat Node

ParseAsp() public méthode

public ParseAsp ( ) : Node
Résultat Node

ParseAttribute() public méthode

public ParseAttribute ( MutableBoolean isempty, MutableObject asp, MutableObject php ) : string
isempty MutableBoolean
asp MutableObject
php MutableObject
Résultat string

ParseAttrs() public méthode

public ParseAttrs ( MutableBoolean isempty ) : AttVal
isempty MutableBoolean
Résultat AttVal

ParseEntity() public méthode

public ParseEntity ( short mode ) : void
mode short
Résultat void

ParsePhp() public méthode

public ParsePhp ( ) : Node
Résultat Node

ParseServerInstruction() public méthode

public ParseServerInstruction ( ) : int
Résultat int

ParseTagName() public méthode

public ParseTagName ( ) : char
Résultat char

ParseValue() public méthode

public ParseValue ( string name, bool foldCase, MutableBoolean isempty, MutableInteger pdelim ) : string
name string
foldCase bool
isempty MutableBoolean
pdelim MutableInteger
Résultat string

PopInline() public méthode

public PopInline ( Node node ) : void
node Node
Résultat void

PushInline() public méthode

public PushInline ( Node node ) : void
node Node
Résultat void

SetXhtmlDocType() public méthode

public SetXhtmlDocType ( Node root ) : bool
root Node
Résultat bool

UngetToken() public méthode

public UngetToken ( ) : void
Résultat void

UpdateNodeTextArrays() protected méthode

protected UpdateNodeTextArrays ( byte oldtextarray, byte newtextarray ) : void
oldtextarray byte
newtextarray byte
Résultat void

Property Details

BadAccess public_oe property

public int BadAccess
Résultat int

BadChars public_oe property

public int BadChars
Résultat int

BadDoctype public_oe property

public bool BadDoctype
Résultat bool

BadForm public_oe property

public int BadForm
Résultat int

BadLayout public_oe property

public int BadLayout
Résultat int

Columns public_oe property

public int Columns
Résultat int

Doctype public_oe property

public HtmlVersion Doctype
Résultat HtmlVersion

ExcludeBlocks public_oe property

public bool ExcludeBlocks
Résultat bool

Exiled public_oe property

public bool Exiled
Résultat bool

Inode public_oe property

public Node,Tidy.Core Inode
Résultat Node

Input public_oe property

public StreamIn,Tidy.Core Input
Résultat StreamIn

Insert public_oe property

public int Insert
Résultat int

Insertspace public_oe property

public bool Insertspace
Résultat bool

Istack public_oe property

public Stack Istack
Résultat Stack

Istackbase public_oe property

public int Istackbase
Résultat int

Isvoyager public_oe property

public bool Isvoyager
Résultat bool

Lexbuf public_oe property

public byte[] Lexbuf
Résultat byte[]

Lexlength public_oe property

public int Lexlength
Résultat int

Lexsize public_oe property

public int Lexsize
Résultat int

Lines public_oe property

public int Lines
Résultat int

Messages public_oe property

public TidyMessageCollection Messages
Résultat TidyMessageCollection

Options public_oe property

public TidyOptions,Tidy.Core Options
Résultat TidyOptions

Pushed public_oe property

public bool Pushed
Résultat bool

SeenBodyEndTag protected_oe property

protected int SeenBodyEndTag
Résultat int

State public_oe property

public short State
Résultat short

Styles public_oe property

public Style,Tidy.Core Styles
Résultat Style

Token public_oe property

public Node,Tidy.Core Token
Résultat Node

Txtend public_oe property

public int Txtend
Résultat int

Txtstart public_oe property

public int Txtstart
Résultat int

Versions public_oe property

public HtmlVersion Versions
Résultat HtmlVersion

Waswhite public_oe property

public bool Waswhite
Résultat bool