-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjsimsyntax.h
More file actions
48 lines (38 loc) · 1.24 KB
/
Copy pathjsimsyntax.h
File metadata and controls
48 lines (38 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef JSIMSYNTAX_H
#define JSIMSYNTAX_H
#include <QSyntaxHighlighter>
#include <QRegularExpression>
QT_BEGIN_NAMESPACE
class QTextDocument;
class QTextCharFormat;
QT_END_NAMESPACE
class Jsimsyntax : public QSyntaxHighlighter
{
// Q_OBJECT
public:
Jsimsyntax(QTextDocument *parent = 0);
QStringList convertToJSIM(QStringList netlistCommands);
QStringList annotateParam(QStringList ParamList);
QString changeNodesToNum(QStringList stringNodes, QString commandLine);
double annotateConstants(QString constName);
double CalculateParam(double x, char oper, double y);
protected:
void highlightBlock(const QString &text) Q_DECL_OVERRIDE;
private:
struct HighlightingRule
{
QRegularExpression pattern;
QTextCharFormat format;
};
QVector<HighlightingRule> highlightingRules;
QRegularExpression subcktStartExpression;
QRegularExpression subcktEndExpression;
QTextCharFormat keywordFormat;
QTextCharFormat elementFormat;
QTextCharFormat classFormat;
QTextCharFormat singleLineCommentFormat;
QTextCharFormat multiLinesubFormat;
QTextCharFormat quotationFormat;
QTextCharFormat functionFormat;
};
#endif // JSIMSYNTAX_H