Browse code

Add source code of the assembler compiler

Pawel Jablonski authored on 14/12/2022 19:04:16
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,49 @@
1
+/*
2
+ * Author: Pawel Jablonski
3
+ * E-mail: pj@xirx.net
4
+ * WWW: xirx.net
5
+ * GIT: git.xirx.net
6
+ *
7
+ * License: You can use this code however you like
8
+ * but leave information about the original author.
9
+ * Code is free for non-commercial and commercial use.
10
+ */
11
+
12
+#ifndef DATA_H
13
+#define DATA_H
14
+
15
+#include <QString>
16
+#include <QList>
17
+#include <QSharedPointer>
18
+
19
+#include "codesection.h"
20
+#include "ramitem.h"
21
+#include "flashitem.h"
22
+
23
+//! This class contains all parsed sections of code, RAM and Flash for one source file
24
+class Data
25
+{
26
+	public:
27
+		static const int MEMORY_SIZE = 65536; //!< Maximum size of memory
28
+
29
+		Data(const QString &fileName);
30
+
31
+		const QString &getFileName() const;
32
+
33
+		bool addCodeSection(const QSharedPointer<CodeSection> &codeSection);
34
+		bool addRamItem(const QSharedPointer<RamItem> &ramItem);
35
+		bool addFlashItem(const QSharedPointer<FlashItem> &flashItem);
36
+
37
+		QList<QSharedPointer<CodeSection>> &getCodeSectionList();
38
+		QList<QSharedPointer<RamItem>> &getRamItemList();
39
+		QList<QSharedPointer<FlashItem>> &getFlashItemList();
40
+
41
+	private:
42
+		QString fileName; //!< Name of the source file
43
+
44
+		QList<QSharedPointer<CodeSection>> codeSectionList; //!< List of code sections
45
+		QList<QSharedPointer<RamItem>> ramItemList; //!< List of RAM items
46
+		QList<QSharedPointer<FlashItem>> flashItemList; //!< List of Flash items
47
+};
48
+
49
+#endif