Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
htmlparse.y File Reference
#include <cgraph/list.h>
#include <common/htmllex.h>
#include <common/htmltable.h>
#include <common/textspan.h>
#include <gvc/gvcext.h>
#include <util/agxbuf.h>
#include <util/strview.h>
#include <common/render.h>
#include <stdbool.h>
#include <util/alloc.h>
Include dependency graph for htmlparse.y:

Go to the source code of this file.

Functions

static void appendFItemList (htmlparserstate_t *html_state, agxbuf *ag)
 
static void appendFLineList (htmlparserstate_t *html_state, int v)
 
static htmltxt_tmkText (htmlparserstate_t *html_state)
 
static row_tlastRow (htmlparserstate_t *html_state)
 
static void addRow (htmlparserstate_t *html_state)
 
static void setCell (htmlparserstate_t *html_state, htmlcell_t *cp, void *obj, label_type_t kind)
 
static void cleanup (htmlparserstate_t *html_state)
 
static void pushFont (htmlparserstate_t *html_state, textfont_t *fp)
 
static void popFont (htmlparserstate_t *html_state)
 
htmllabel_tparseHTML (char *txt, int *warn, htmlenv_t *env)
 

Variables

require define api prefix
 
fonttext __pad0__
 
text __pad1__
 
textitem __pad2__
 
textitem scanner parser str
 
 br {appendFLineList(&scanner->parser,$1)
 
font text n_font italic text n_italic underline text n_underline overline text n_overline bold text n_bold sup text n_sup sub text n_sub strike text n_strike
 
font __pad3__
 
font $1
 
n_font __pad4__
 
italic __pad5__
 
n_italic __pad6__
 
bold __pad7__
 
n_bold __pad8__
 
strike __pad9__
 
n_strike __pad10__
 
underline __pad11__
 
n_underline __pad12__
 
overline __pad13__
 
n_overline __pad14__
 
sup __pad15__
 
n_sup __pad16__
 
sub __pad17__
 
n_sub __pad18__
 
br __pad19__
 
 T_BR { $$ = $1
 
string __pad20__
 
table __pad21__
 
table Syntax error
 
cleanupscanner
 
 YYABORT
 
$2 u p prev = scanner->parser.tblstack
 
$2 u p rows = (rows_t){0}
 
scanner parser tblstack = $2
 
$2 font = *sfont_back(&scanner->parser.fontstack)
 
$< tbl > $ = $2
 
rows T_end_table opt_space
 
fonttable __pad22__
 
font table n_font { $$=$2
 
italic table n_italic { $$=$2
 
underline table n_underline { $$=$2
 
overline table n_overline { $$=$2
 
bold table n_bold { $$=$2
 
opt_space __pad23__
 
rows __pad24__
 
rows row { $$ = $2
 
 $$ = $3
 
row __pad25__
 
cells T_end_row { $$ = lastRow(&scanner->parser)
 
cells __pad26__
 
cells cell { $$ = $2
 
cell __pad27__
 
cell $2
 
cell HTML_TBL
 
 T_end_cell { $$ = $1
 
T_cell fonttext { setCell(&scanner->parser,$1,$2,HTML_TEXT)
 
T_cell image { setCell(&scanner->parser,$1,$2,HTML_IMAGE)
 
 T_cell { setCell(&scanner->parser,$1,mkText(&scanner->parser),HTML_TEXT)
 
image __pad28__
 
 T_IMG { $$ = $1
 
HR __pad29__
 
VR __pad30__
 

Function Documentation

◆ addRow()

static void addRow ( htmlparserstate_t html_state)
static

Definition at line 429 of file htmlparse.y.

References gv_alloc(), htmltbl_t::hrule, htmltbl_t::p, htmltbl_t::rows, row_t::ruled, htmlparserstate_s::tblstack, and htmltbl_t::u.

Here is the call graph for this function:

◆ appendFItemList()

static void appendFItemList ( htmlparserstate_t html_state,
agxbuf ag 
)
static

Definition at line 360 of file htmlparse.y.

References agxbdisown(), htmlparserstate_s::fitemList, htmlparserstate_s::fontstack, and textspan_t::str.

Here is the call graph for this function:

◆ appendFLineList()

static void appendFLineList ( htmlparserstate_t html_state,
int  v 
)
static

Definition at line 368 of file htmlparse.y.

References cnt(), htmlparserstate_s::fitemList, textspan_t::font, htmlparserstate_s::fontstack, htmlparserstate_s::fspanList, gv_alloc(), gv_calloc(), gv_strdup(), htextspan_t::items, htextspan_t::just, htextspan_t::nitems, and textspan_t::str.

Referenced by mkText().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cleanup()

static void cleanup ( htmlparserstate_t html_state)
static

Definition at line 456 of file htmlparse.y.

References cleanTbl(), htmlparserstate_s::fitemList, htmlparserstate_s::fontstack, free_html_label(), htmlparserstate_s::fspanList, htmlparserstate_s::lbl, NULL, htmltbl_t::p, htmltbl_t::prev, htmlparserstate_s::tblstack, and htmltbl_t::u.

Here is the call graph for this function:

◆ lastRow()

static row_t * lastRow ( htmlparserstate_t html_state)
static

Definition at line 423 of file htmlparse.y.

References htmltbl_t::p, htmltbl_t::rows, htmlparserstate_s::tblstack, and htmltbl_t::u.

◆ mkText()

static htmltxt_t * mkText ( htmlparserstate_t html_state)
static

Definition at line 399 of file htmlparse.y.

References appendFLineList(), cnt(), htmlparserstate_s::fitemList, htmlparserstate_s::fspanList, gv_alloc(), gv_calloc(), htmltxt_t::nspans, htmltxt_t::spans, and UNSET_ALIGN.

Here is the call graph for this function:

◆ parseHTML()

htmllabel_t * parseHTML ( char *  txt,
int *  warn,
htmlenv_t env 
)

Definition at line 509 of file htmlparse.y.

References agxbfree(), clearHTMLlexer(), htmlenv_t::g, GD_gvc, htmlparse(), initHTMLlexer(), NULL, scanner, and str.

Here is the call graph for this function:

◆ popFont()

static void popFont ( htmlparserstate_t html_state)
static

Definition at line 499 of file htmlparse.y.

References htmlparserstate_s::fontstack.

◆ pushFont()

◆ setCell()

Variable Documentation

◆ $

$<tbl> $ = $2

Definition at line 301 of file htmlparse.y.

◆ $$

$$ = $3

Definition at line 327 of file htmlparse.y.

◆ $1

cell $1

Definition at line 236 of file htmlparse.y.

◆ $2

cell $2

Definition at line 338 of file htmlparse.y.

◆ __pad0__

fonttext __pad0__

Definition at line 217 of file htmlparse.y.

◆ __pad10__

n_strike __pad10__

Definition at line 257 of file htmlparse.y.

◆ __pad11__

underline __pad11__

Definition at line 260 of file htmlparse.y.

◆ __pad12__

n_underline __pad12__

Definition at line 263 of file htmlparse.y.

◆ __pad13__

overline __pad13__

Definition at line 266 of file htmlparse.y.

◆ __pad14__

n_overline __pad14__

Definition at line 269 of file htmlparse.y.

◆ __pad15__

sup __pad15__

Definition at line 272 of file htmlparse.y.

◆ __pad16__

n_sup __pad16__

Definition at line 275 of file htmlparse.y.

◆ __pad17__

sub __pad17__

Definition at line 278 of file htmlparse.y.

◆ __pad18__

n_sub __pad18__

Definition at line 281 of file htmlparse.y.

◆ __pad19__

br __pad19__

Definition at line 284 of file htmlparse.y.

◆ __pad1__

text __pad1__

Definition at line 220 of file htmlparse.y.

◆ __pad20__

string __pad20__

Definition at line 288 of file htmlparse.y.

◆ __pad21__

table __pad21__

Definition at line 292 of file htmlparse.y.

◆ __pad22__

fonttable __pad22__

Definition at line 313 of file htmlparse.y.

◆ __pad23__

opt_space __pad23__

Definition at line 321 of file htmlparse.y.

◆ __pad24__

rows __pad24__

Definition at line 325 of file htmlparse.y.

◆ __pad25__

row __pad25__

Definition at line 330 of file htmlparse.y.

◆ __pad26__

cells __pad26__

Definition at line 333 of file htmlparse.y.

◆ __pad27__

cell __pad27__

Definition at line 338 of file htmlparse.y.

◆ __pad28__

image __pad28__

Definition at line 344 of file htmlparse.y.

◆ __pad29__

HR __pad29__

Definition at line 348 of file htmlparse.y.

◆ __pad2__

textitem __pad2__

Definition at line 224 of file htmlparse.y.

◆ __pad30__

VR __pad30__

Definition at line 352 of file htmlparse.y.

◆ __pad3__

font __pad3__

Definition at line 236 of file htmlparse.y.

◆ __pad4__

n_font __pad4__

Definition at line 239 of file htmlparse.y.

◆ __pad5__

italic __pad5__

Definition at line 242 of file htmlparse.y.

◆ __pad6__

n_italic __pad6__

Definition at line 245 of file htmlparse.y.

◆ __pad7__

bold __pad7__

Definition at line 248 of file htmlparse.y.

◆ __pad8__

n_bold __pad8__

Definition at line 251 of file htmlparse.y.

◆ __pad9__

strike __pad9__

Definition at line 254 of file htmlparse.y.

◆ br

br {appendFLineList(&scanner->parser,$1)

Definition at line 225 of file htmlparse.y.

◆ cell

cells VR cell { $$ = $2

Definition at line 334 of file htmlparse.y.

◆ error

◆ font

◆ fonttext

T_cell fonttext { setCell(&scanner->parser,$1,$2,HTML_TEXT)

Definition at line 339 of file htmlparse.y.

◆ HTML_TBL

◆ image

◆ n_bold

bold table n_bold { $$=$2

Definition at line 318 of file htmlparse.y.

◆ n_font

font table n_font { $$=$2

Definition at line 314 of file htmlparse.y.

◆ n_italic

italic table n_italic { $$=$2

Definition at line 315 of file htmlparse.y.

◆ n_overline

overline table n_overline { $$=$2

Definition at line 317 of file htmlparse.y.

◆ n_strike

font text n_font italic text n_italic underline text n_underline overline text n_overline bold text n_bold sup text n_sup sub text n_sub strike text n_strike

Definition at line 233 of file htmlparse.y.

◆ n_underline

underline table n_underline { $$=$2

Definition at line 316 of file htmlparse.y.

◆ opt_space

rows T_end_table opt_space
Initial value:
{
if (nonSpace(agxbuse(scanner->parser.str))) {
htmlerror (scanner,"Syntax error: non-space string used after </TABLE>");
cleanup(&scanner->parser); YYABORT;
}
$$ = scanner->parser.tblstack
static WUR char * agxbuse(agxbuf *xb)
Definition agxbuf.h:307
static void cleanup(void)
Definition gmlparse.c:128
void htmlerror(htmlscan_t *scanner, const char *msg)
Definition htmllex.c:58
static bool nonSpace(const char *s)
Return 1 if s contains a non-space character.
Definition htmlparse.c:148
YYABORT
Definition htmlparse.y:295
cleanup & scanner
Definition htmlparse.y:295
$$
Definition htmlparse.y:327

Definition at line 303 of file htmlparse.y.

◆ prefix

require define api prefix

Definition at line 19 of file htmlparse.y.

◆ prev

◆ row

◆ rows

$2 u p rows = (rows_t){0}

Definition at line 298 of file htmlparse.y.

Referenced by cleanTbl(), and processTbl().

◆ scanner

◆ str

textitem scanner parser str

Definition at line 224 of file htmlparse.y.

Referenced by _write_canonstr(), aagerror(), aagerror(), agcanon(), agcanonStr(), aginternalmapinsert(), aginternalmaplookup(), agmapnametoid(), bboxPDF(), bind_shape(), bindedgeattr(), boxof(), colorxlate(), colorxlate(), common_init_edge(), common_init_node(), do_graph_label(), emit_background(), emit_cluster_colors(), emit_colors(), emit_once(), eol(), epsf_init(), eval(), exsplit(), exsub(), extokens(), fig_comment(), findPath(), finishNode(), fullColor(), gdgen_text(), getNum(), getoutputbuffer(), getPenColor(), getPointFromStr(), glCompColorxlate(), gmlerror(), graphviz_unflatten(), gvloadimage_select(), gvplugin_api(), gvplugin_list(), gvplugin_load(), gvrender_comment(), gvrender_select(), htmlEntity(), idmap(), init_job_viewport(), init_layering(), ioput(), ioputstr(), ioputstr(), ioputstr(), is_a_strong_cluster(), is_escape(), is_natural_number(), lasi_comment(), layer_index(), majorization(), make_label(), map_rec_port(), match(), memrchr(), mkAttr(), myiddisc_map(), neatoLayout(), neatoMode(), noClip(), nxtc(), on_gvprbuttonload_clicked(), parseAction(), parseBracket(), parseCase(), parseGuard(), parseHTML(), parseID(), parseKind(), parseProg(), pic_comment(), pov_comment(), psgen_comment(), psgen_textspan(), rankset_kind(), readc(), resolveColor(), Ruby_Format_TypeError(), safefile(), scan_graph_mode(), set_attr_object_type(), sffmtint(), show_gui_warning(), skipWS(), skipWS(), strcasestr(), strdup_and_subst_obj(), strdup_and_subst_obj0(), svg_comment(), svg_print_id_class(), SWIG_Guile_scm2newstr(), SWIG_Lua_dostring(), SWIG_Lua_pusherrstring(), SWIG_Python_TypeError(), SWIG_PyUnicode_AsUTF8AndSize(), swig_varlink_str(), tclGdTextCmd(), tkgen_comment(), unknown(), unknown(), unreadc(), update_columns(), user_init(), versionStr2Version(), write_canonstr(), and write_plain().

◆ T_BR

T_BR { $$ = $1

Definition at line 285 of file htmlparse.y.

◆ T_cell

T_cell { setCell(&scanner->parser,$1,mkText(&scanner->parser),HTML_TEXT)

Definition at line 341 of file htmlparse.y.

◆ T_end_cell

T_end_cell { $$ = $1

Definition at line 338 of file htmlparse.y.

◆ T_end_row

cells T_end_row { $$ = lastRow(&scanner->parser)

Definition at line 330 of file htmlparse.y.

◆ T_IMG

T_IMG { $$ = $1

Definition at line 345 of file htmlparse.y.

◆ tblstack

scanner parser tblstack = $2

Definition at line 299 of file htmlparse.y.

◆ YYABORT

YYABORT

Definition at line 295 of file htmlparse.y.