-
Notifications
You must be signed in to change notification settings - Fork 0
/
SvdCExpression.h
61 lines (49 loc) · 1.32 KB
/
SvdCExpression.h
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
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Copyright (c) 2010-2021 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef SvdCExpression_H
#define SvdCExpression_H
#include "SvdItem.h"
#include "SvdField.h"
#include "XMLTree.h"
#include "SvdCExpressionParser.h"
#include <string>
#include <map>
#include <list>
class SvdCExpression : public SvdElement
{
public:
SvdCExpression();
virtual ~SvdCExpression();
virtual bool CheckItem();
class Symbols_t {
public:
SvdCExpressionParser::token_s token;
SvdItem* svdItem;
std::list<std::string> searchname;
Symbols_t() {
clear();
}
void clear() {
svdItem = nullptr;
searchname.clear();
token.text.clear();
token.type = SvdCExpressionParser::xme_what;
}
};
using SymbolsList = std::list<Symbols_t>;
using RegList = std::map<std::string, SvdItem*>;
bool CalcExpression(SvdItem* item);
bool LinkSymbols(SvdItem* item, const SvdCExpressionParser::TokenList& tokens, int32_t lineNo);
std::string GetExpressionString();
std::string CreateObjectExpression(SvdItem* item);
std::string CreateRegisterExpression(SvdItem* item);
std::string CreateFieldExpression(SvdItem* item);
const SymbolsList& GetSymbolsList() { return m_symbolsList; }
protected:
private:
SymbolsList m_symbolsList;
};
#endif // SvdCExpression_H