-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser.h
52 lines (42 loc) · 1.74 KB
/
parser.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
#ifndef PARSER_H
#define PARSER_H
#include <QXmlStreamReader>
#include "modelobjects.h"
#include "infoparser.h"
class Parser
{
public:
Parser(QXmlStreamReader *xml_src, InfoParser *info_parser);
Population* parsePopulation();
Neuron* parseNeuron();
Property* parseProperty(uint comp_size);
Input* parseInput(Component* component, uint component_size);
AbstractionConnection* parseConnectivity(uint max_src_index, uint max_dst_index, bool hash_instances_by_src);
Projection* parseProjection(Neuron* neuron);
Synapse* parseTarget(Neuron* neuron, uint dst_pop_size);
WeightUpdate* parseSynapse(uint synapse_size);
Postsynapse* parsePostsynapse(uint postsynapse_size);
PropertyValue* parseDelayPropertyValue();
Experiment* parseExperiment(QString input_path);
LogOutput* parseLogOutput();
//static functions (used by info parser and parser)
static QString readStringElement(QXmlStreamReader *xml);
static int readIntElement(QXmlStreamReader *xml);
static double readDoubleElement(QXmlStreamReader *xml);
static QString getStringAttribute(QXmlStreamReader *xml, QString attribute_name, bool optional=false);
static int getIntAttribute(QXmlStreamReader *xml, QString attribute_name, bool optional=false);
static double getDoubleAttribute(QXmlStreamReader *xml, QString attribute_name, bool optional=false);
static QString getSubName(QXmlStreamReader *xml, QString name, uint sub_index);
//stats
uint getParsedPopulationCount();
uint getParsedProjectionCount();
uint getParsedInputCount();
private:
QXmlStreamReader *xml;
InfoParser *info;
uint parsed_populations;
uint parsed_projections;
uint parsed_inputs;
uint parsed_instances;
};
#endif // PARSER_H