parse_declaration(i)
parse_endtag(i)
parse_html_declaration(i)
parse_marked_section(i[, report])
parse_pi(i)
parse_starttag(i)
reset()
Reset this instance.
set_cdata_mode(elem)
unknown_decl(data)
updatepos(i, j)
__init__() → None[source]¶
A heavy-handed solution, but it’s fast for prototyping.
Might be re-implemented later to restrict scope to the limited grammar, and
more efficiency.
Uses an HTML parser to parse a limited grammar that allows
for syntax of the form:
INPUT -> JUNK? VALUE*
JUNK -> JUNK_CHARACTER+
JUNK_CHARACTER -> whitespace | ,
VALUE -> <IDENTIFIER>DATA</IDENTIFIER> | OBJECT
OBJECT -> <IDENTIFIER>VALUE+</IDENTIFIER>
IDENTIFIER -> [a-Z][a-Z0-9_]*
DATA -> .*
Interprets the data to allow repetition of tags and recursion
to support representation of complex types.
^ Just another approximately wrong grammar specification.
check_for_whole_start_tag(i)¶
clear_cdata_mode()¶
close()¶
Handle any buffered data.
feed(data)¶
Feed data to the parser.
Call this as often as you want, with as little or as much text
as you want (may include ‘n’).
get_starttag_text()¶
Return full source of start tag: ‘<…>’.
getpos()¶
Return current line number and offset.
goahead(end)¶
handle_charref(name)¶
handle_comment(data)¶
handle_data(data: str) → None[source]¶
Hook when handling data.
handle_decl(decl)¶
handle_endtag(tag: str) → None[source]¶
Hook when a tag is closed.
handle_entityref(name)¶