blob: 4f673f185729a0ca7d98c7f0c9bdd44ca945dfee (
plain) (
blame)
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
|
// license:GPL-2.0+
// copyright-holders:Couriersud
/*
* nl_parser.c
*
*/
#ifndef NL_PARSER_H_
#define NL_PARSER_H_
#include "nl_setup.h"
class netlist_parser
{
NETLIST_PREVENT_COPYING(netlist_parser)
public:
netlist_parser(netlist_setup_t &setup)
: m_setup(setup) {}
void parse(const char *buf);
void net_alias();
void netdev_param();
void net_c();
void netdev_const(const pstring &dev_name);
void netdev_device(const pstring &dev_type);
void netdev_device(const pstring &dev_type, const pstring &default_param, bool isString = false);
private:
void skipeol();
void skipws();
pstring getname(char sep);
pstring getname2(char sep1, char sep2);
void check_char(char ctocheck);
double eval_param();
unsigned char getc();
void ungetc();
bool eof() { return *m_px == 0; }
const char * m_px;
netlist_setup_t &m_setup;
};
#endif /* NL_PARSER_H_ */
|