summaryrefslogtreecommitdiffstats
path: root/src/lib/netlist/nl_parser.cpp
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2017-01-17 23:29:19 +0100
committer couriersud <couriersud@gmx.org>2017-01-20 22:20:35 +0100
commit167d8405ec0bec4937ab84c44b63f7102eea56c7 (patch)
treea802c4a59040b089fc30dbbb2dbfd91402cecdb4 /src/lib/netlist/nl_parser.cpp
parentda169d7fe01c123ddc232415d19faff08196f2fc (diff)
Converted warnings and fatal log messages to constants.
Also refactored some code to ease the exercise. (nw)
Diffstat (limited to 'src/lib/netlist/nl_parser.cpp')
-rw-r--r--src/lib/netlist/nl_parser.cpp25
1 files changed, 4 insertions, 21 deletions
diff --git a/src/lib/netlist/nl_parser.cpp b/src/lib/netlist/nl_parser.cpp
index 365054fc7d0..15f185ea712 100644
--- a/src/lib/netlist/nl_parser.cpp
+++ b/src/lib/netlist/nl_parser.cpp
@@ -7,6 +7,7 @@
#include "nl_parser.h"
#include "nl_factory.h"
+#include "nl_errstr.h"
#include "devices/nld_truthtable.h"
namespace netlist
@@ -68,14 +69,13 @@ bool parser_t::parse(const pstring nlname)
if (token.is_type(ENDOFFILE))
{
return false;
- //error("EOF while searching for <{1}>", nlname);
}
if (token.is(m_tok_NETLIST_END))
{
require_token(m_tok_param_left);
if (!in_nl)
- error("Unexpected NETLIST_END");
+ error (MF_0_UNEXPECTED_NETLIST_END);
else
{
in_nl = false;
@@ -85,7 +85,7 @@ bool parser_t::parse(const pstring nlname)
else if (token.is(m_tok_NETLIST_START))
{
if (in_nl)
- error("Unexpected NETLIST_START");
+ error (MF_0_UNEXPECTED_NETLIST_START);
require_token(m_tok_param_left);
token_t name = get_token();
require_token(m_tok_param_right);
@@ -415,7 +415,6 @@ nl_double parser_t::eval_param(const token_t tok)
for (i=1; i<6;i++)
if (tok.str().equals(macs[i]))
f = i;
-#if 1
if (f>0)
{
require_token(m_tok_param_left);
@@ -431,22 +430,6 @@ nl_double parser_t::eval_param(const token_t tok)
}
return ret * facs[f];
-#else
- if (f>0)
- {
- require_token(m_tok_param_left);
- val = get_identifier();
- }
- else
- val = tok.str();
-
- ret = val.as_double(&e);
-
- if (e)
- fatal("Error with parameter ...\n");
- if (f>0)
- require_token(m_tok_param_right);
- return ret * facs[f];
-#endif
}
+
}