QSS Solver GUI  4.5.3
MmoHighlighter Class Reference

#include <mmohighlight.hpp>

Inheritance diagram for MmoHighlighter:
Collaboration diagram for MmoHighlighter:

Classes

struct  MmoHighlightingRule
 

Public Types

using h_type = enum { MMO_MODEL, MMO_LOG }
 

Public Member Functions

 MmoHighlighter (QTextDocument *parent=nullptr, h_type file=MMO_MODEL)
 

Protected Member Functions

void initialize (h_type file)
 
void addHighlightingRule (const QString &pattern, const QTextCharFormat &format, bool bold=true)
 
void setupModelHighlighting ()
 
void setupLogHighlighting ()
 
void highlightBlock (const QString &text) override
 
void highlightSyntax (const QString &text)
 
void highlightComments (const QString &text)
 

Private Attributes

QVector< MmoHighlightingRule_highlighting_rules
 
QRegularExpression _comment_start_expression
 
QRegularExpression _comment_end_expression
 
QTextCharFormat _single_line_comment_format
 

Static Private Attributes

static const QStringList _model_keywords
 
static const QStringList _model_functions
 
static const QStringList _model_annotations = {"annotation", "experiment"}
 
static const QStringList _model_qss_tags
 
static const QStringList _log_keywords
 

Detailed Description

Definition at line 27 of file mmohighlight.hpp.

Member Typedef Documentation

◆ h_type

using MmoHighlighter::h_type = enum { MMO_MODEL, MMO_LOG }

Definition at line 47 of file mmohighlight.hpp.

Constructor & Destructor Documentation

◆ MmoHighlighter()

MmoHighlighter::MmoHighlighter ( QTextDocument *  parent = nullptr,
h_type  file = MMO_MODEL 
)

Definition at line 144 of file mmohighlight.cpp.

References initialize().

Here is the call graph for this function:

Member Function Documentation

◆ addHighlightingRule()

void MmoHighlighter::addHighlightingRule ( const QString &  pattern,
const QTextCharFormat &  format,
bool  bold = true 
)
protected

◆ highlightBlock()

void MmoHighlighter::highlightBlock ( const QString &  text)
overrideprotected

Definition at line 221 of file mmohighlight.cpp.

References highlightComments(), and highlightSyntax().

Here is the call graph for this function:

◆ highlightComments()

void MmoHighlighter::highlightComments ( const QString &  text)
protected

Definition at line 242 of file mmohighlight.cpp.

References _comment_end_expression, and _comment_start_expression.

Referenced by highlightBlock().

◆ highlightSyntax()

void MmoHighlighter::highlightSyntax ( const QString &  text)
protected

Definition at line 227 of file mmohighlight.cpp.

References _highlighting_rules.

Referenced by highlightBlock().

◆ initialize()

void MmoHighlighter::initialize ( h_type  file)
protected

Definition at line 146 of file mmohighlight.cpp.

References _comment_end_expression, _comment_start_expression, setupLogHighlighting(), and setupModelHighlighting().

Referenced by MmoHighlighter().

Here is the call graph for this function:

◆ setupLogHighlighting()

void MmoHighlighter::setupLogHighlighting ( )
protected

Definition at line 210 of file mmohighlight.cpp.

References _log_keywords, and addHighlightingRule().

Referenced by initialize().

Here is the call graph for this function:

◆ setupModelHighlighting()

void MmoHighlighter::setupModelHighlighting ( )
protected

Definition at line 169 of file mmohighlight.cpp.

References _model_annotations, _model_functions, _model_keywords, _model_qss_tags, _single_line_comment_format, and addHighlightingRule().

Referenced by initialize().

Here is the call graph for this function:

Member Data Documentation

◆ _comment_end_expression

QRegularExpression MmoHighlighter::_comment_end_expression
private

Definition at line 75 of file mmohighlight.hpp.

Referenced by highlightComments(), and initialize().

◆ _comment_start_expression

QRegularExpression MmoHighlighter::_comment_start_expression
private

Definition at line 74 of file mmohighlight.hpp.

Referenced by highlightComments(), and initialize().

◆ _highlighting_rules

QVector<MmoHighlightingRule> MmoHighlighter::_highlighting_rules
private

Definition at line 73 of file mmohighlight.hpp.

Referenced by addHighlightingRule(), and highlightSyntax().

◆ _log_keywords

const QStringList MmoHighlighter::_log_keywords
staticprivate
Initial value:
= {"-", "Additional", "Allocated", "allocated", "Average",
"Begin", "by", "changes", "cost", "CPU",
"crossing", "Crossings", "DASSL", "data", "dependencies",
"derivative", "derivatives", "detected", "done", "Dt",
"dt", "efficiency", "Estimated", "evaluations", "Event",
"events", "Events", "execution", "external", "External",
"for", "Function", "function", "Handler", "Individual",
"Init", "Initial", "Initialization", "Initialize", "input",
"iterations", "Jacobian", "load", "LP", "LPS",
"max", "memory", "messages", "Messages", "Miliseconds",
"min", "ms", "Newton", "next", "output",
"Output", "Parallel", "Partitioning", "past", "per",
"performed", "Processed", "reinits", "reported", "Results",
"Save", "Scalar", "Seconds", "sent", "sequential",
"Simulation", "simulation", "solver", "speedup", "State",
"state", "Statistics", "step", "steps", "sum",
"time", "Time", "Total", "transition", "transitions",
"value", "values", "Variable", "variable", "variables",
"Variables", "Zero"}

Definition at line 70 of file mmohighlight.hpp.

Referenced by setupLogHighlighting().

◆ _model_annotations

const QStringList MmoHighlighter::_model_annotations = {"annotation", "experiment"}
staticprivate

Definition at line 68 of file mmohighlight.hpp.

Referenced by setupModelHighlighting().

◆ _model_functions

const QStringList MmoHighlighter::_model_functions
staticprivate
Initial value:
= {"abs", "acos", "asin", "atan", "atan2", "ceil", "conh", "cos", "der",
"div", "exp", "floor", "log", "log10", "max", "min", "mod", "pre",
"product", "reinit", "sin", "sinh", "sum", "tan", "tanh", "terminate"}

Definition at line 67 of file mmohighlight.hpp.

Referenced by setupModelHighlighting().

◆ _model_keywords

const QStringList MmoHighlighter::_model_keywords
staticprivate

Definition at line 66 of file mmohighlight.hpp.

Referenced by setupModelHighlighting().

◆ _model_qss_tags

const QStringList MmoHighlighter::_model_qss_tags
staticprivate
Initial value:
= {
"CI_Dense", "CI_Sampled", "CI_Step", "CQSS", "CVODE_AM", "CVODE_BDF", "DASSL", "Dense", "DOPRI", "false",
"HMetis", "IDA", "KaHIP", "LIQSS", "LIQSS2", "LIQSS3", "LIQSS_BDF", "Manual", "Metis", "mLIQSS",
"mLIQSS2", "MTPL", "MTPL_IT", "Patoh", "QSS", "QSS2", "QSS3", "QSS4", "Scotch", "SD_DT_Asynchronous",
"SD_DT_Fixed", "Sparse", "ST_Binary", "ST_Linear", "ST_Random", "true"}

Definition at line 69 of file mmohighlight.hpp.

Referenced by setupModelHighlighting().

◆ _single_line_comment_format

QTextCharFormat MmoHighlighter::_single_line_comment_format
private

Definition at line 76 of file mmohighlight.hpp.

Referenced by setupModelHighlighting().


The documentation for this class was generated from the following files: