GCC Middle and Back End API Reference
diagnostic-format-html.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "diagnostic.h"
#include "diagnostic-metadata.h"
#include "diagnostic-format.h"
#include "diagnostic-format-html.h"
#include "diagnostic-format-text.h"
#include "diagnostic-output-file.h"
#include "diagnostic-buffer.h"
#include "diagnostic-path.h"
#include "diagnostic-client-data-hooks.h"
#include "selftest.h"
#include "selftest-diagnostic.h"
#include "pretty-print-format-impl.h"
#include "pretty-print-urlifier.h"
#include "edit-context.h"
#include "intl.h"
#include "xml.h"
#include "xml-printer.h"
#include "json.h"
#include "selftest-xml.h"
Include dependency graph for diagnostic-format-html.cc:

Data Structures

class  diagnostic_html_format_buffer
class  html_builder
struct  html_doctypedecl
class  html_path_label_writer
class  html_token_printer
class  html_output_format
class  html_file_output_format

Macros

#define INCLUDE_MAP
#define INCLUDE_STRING
#define INCLUDE_VECTOR

Functions

static std::unique_ptr< xml::elementmake_div (std::string class_)
static std::unique_ptr< xml::elementmake_span (std::string class_)
static void add_nesting_level_attr (xml::element &element, int nesting_level)
static const char * get_pf_class_for_alert_div (diagnostic_t diag_kind)
static const char * get_pf_class_for_alert_icon (diagnostic_t diag_kind)
static const char * get_label_for_logical_location_kind (enum logical_location_kind kind)
static void add_labelled_value (xml::printer &xp, std::string id, std::string label, std::string value, bool quote_value)
diagnostic_output_file diagnostic_output_format_open_html_file (diagnostic_context &context, line_maps *line_maps, const char *base_file_name)
std::unique_ptr< diagnostic_output_formatmake_html_sink (diagnostic_context &context, const line_maps &line_maps, const html_generation_options &html_gen_opts, diagnostic_output_file output_file)

Variables

static const char *const HTML_STYLE
const char *const HTML_SCRIPT

Macro Definition Documentation

◆ INCLUDE_MAP

#define INCLUDE_MAP
HTML output for diagnostics. Copyright (C) 2024-2025 Free Software Foundation, Inc. Contributed by David Malcolm <dmalcolm@redhat.com>. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.

◆ INCLUDE_STRING

#define INCLUDE_STRING

◆ INCLUDE_VECTOR

#define INCLUDE_VECTOR

Function Documentation

◆ add_labelled_value()

void add_labelled_value ( xml::printer & xp,
std::string id,
std::string label,
std::string value,
bool quote_value )
static

◆ add_nesting_level_attr()

void add_nesting_level_attr ( xml::element & element,
int nesting_level )
static

◆ diagnostic_output_format_open_html_file()

diagnostic_output_file diagnostic_output_format_open_html_file ( diagnostic_context & context,
line_maps * line_maps,
const char * base_file_name )
Attempt to open BASE_FILE_NAME.html for writing. Return a non-null diagnostic_output_file, or return a null diagnostic_output_file and complain to CONTEXT using LINE_MAPS.

References base_file_name(), diagnostic_context::emit_diagnostic_with_group(), fopen, and UNKNOWN_LOCATION.

Referenced by gcc::diagnostics_output_spec::html_scheme_handler::make_sink().

◆ get_label_for_logical_location_kind()

◆ get_pf_class_for_alert_div()

const char * get_pf_class_for_alert_div ( diagnostic_t diag_kind)
static
See https://pf3.patternfly.org/v3/pattern-library/widgets/#alerts

References gcc_unreachable.

Referenced by html_builder::make_element_for_diagnostic().

◆ get_pf_class_for_alert_icon()

const char * get_pf_class_for_alert_icon ( diagnostic_t diag_kind)
static

◆ make_div()

std::unique_ptr< xml::element > make_div ( std::string class_)
static

◆ make_html_sink()

std::unique_ptr< diagnostic_output_format > make_html_sink ( diagnostic_context & context,
const line_maps & line_maps,
const html_generation_options & html_gen_opts,
diagnostic_output_file output_file )

◆ make_span()

Variable Documentation

◆ HTML_SCRIPT

const char* const HTML_SCRIPT
A little JavaScript for ease of navigation. Keys j/k move forward and backward cyclically through a list of focus ids (written out in another <script> tag as the HTML is flushed).

◆ HTML_STYLE

const char* const HTML_STYLE
static
class html_builder.
Style information for writing out HTML paths. Colors taken from https://pf3.patternfly.org/v3/styles/color-palette/