'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 9 March 2010 at 8:52:23 am'! HtmlToken subclass: #HtmlTag instanceVariableNames: 'isNegated name attribs' classVariableNames: 'EntityClasses' poolDictionaries: '' category: 'Network-HTML-Tokenizer'! !HtmlTag commentStamp: '' prior: 0! An HTML tag, eg ! !HtmlTag methodsFor: 'access' stamp: 'ls 1/25/98 04:50'! attribs "return a dictionary mapping attribute names (in lowercase) to their values" ^attribs ! ! !HtmlTag methodsFor: 'access' stamp: 'ls 6/24/1998 18:53'! isNegated ^isNegated! ! !HtmlTag methodsFor: 'access' stamp: 'ls 1/25/98 04:49'! name "return the basic kind of tag, in lowercase" ^name ! ! !HtmlTag methodsFor: 'parser support' stamp: 'ls 6/27/1998 13:18'! entityFor "return an empty entity corresponding to this tag" | eClass | eClass _ self class entityClasses at: name ifAbsent: [ ^nil ]. ^eClass forTag: self ! ! !HtmlTag methodsFor: 'properties' stamp: 'ls 1/25/98 04:57'! isTag ^true! ! !HtmlTag methodsFor: 'private-initialization' stamp: 'sma 2/5/2000 18:08'! name: name0 negated: isNegated0 attribs: attribs0 "initialize from the given attributes" name _ name0. isNegated _ isNegated0. attribs _ attribs0 ifNil: [Dictionary new]! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! HtmlTag class instanceVariableNames: ''! !HtmlTag class methodsFor: 'parser support' stamp: 'bolot 11/3/1999 17:52'! entityClasses "a Dictionary mapping tag names into the correct entity class" "EntityClasses _ nil" EntityClasses isNil ifFalse: [ ^EntityClasses ]. EntityClasses _ Dictionary new. #( frameset HtmlFrame frame HtmlFrame title HtmlTitle style HtmlStyle meta HtmlMeta p HtmlParagraph form HtmlForm blockquote HtmlBlockQuote input HtmlInput textarea HtmlTextArea select HtmlSelect optgroup HtmlOptionGroup option HtmlOption img HtmlImage embed HtmlEmbedded noembed HtmlNoEmbed a HtmlAnchor br HtmlBreak map HtmlMap area HtmlArea li HtmlListItem dd HtmlDefinitionDefinition dt HtmlDefinitionTerm ol HtmlOrderedList ul HtmlUnorderedList dl HtmlDefinitionList h1 HtmlHeader h2 HtmlHeader h3 HtmlHeader h4 HtmlHeader h5 HtmlHeader h6 HtmlHeader hr HtmlHorizontalRule strong HtmlBoldEntity b HtmlBoldEntity em HtmlItalicsEntity i HtmlItalicsEntity dfn HtmlItalicsEntity u HtmlUnderlineEntity tt HtmlFixedWidthEntity kbd HtmlFixedWidthEntity strike HtmlStrikeEntity big HtmlBiggerFontEntity small HtmlSmallerFontEntity sub HtmlSubscript sup HtmlSuperscript font HtmlFontEntity pre HtmlPreformattedRegion table HtmlTable tr HtmlTableRow td HtmlTableDataItem th HtmlTableHeader ) pairsDo: [ :tagName :className | EntityClasses at: tagName asString put: (Smalltalk at: className) ]. ^EntityClasses ! ! !HtmlTag class methodsFor: 'parser support' stamp: 'ar 11/18/1998 19:27'! initialize "HtmlTag initialize" EntityClasses _ nil.! ! !HtmlTag class methodsFor: 'instance creation' stamp: 'ls 6/24/1998 18:54'! source: source0 name: name0 negated: negated0 attribs: attribs0 ^(super forSource: source0) name: name0 negated: negated0 attribs: attribs0! ! HtmlTag initialize!