13 using namespace bil::xdlrcparser_detail;
16 void XDLRCParserImp::parse1stTiles()
21 if (!m_tok->uintToken(rows))
throw Exception();
26 if (!m_tok->uintToken(cols))
throw Exception();
29 m_tiles->reserve(rows * cols);
36 if (
')' == m_tok->separatorToken())
return;
37 if (
'(' != m_tok->separatorToken())
throw Exception();
47 void XDLRCParserImp::parse1stTile()
52 if (!m_tok->uintToken(x))
throw Exception();
57 if (!m_tok->uintToken(y))
throw Exception();
61 addTile(m_tok->wordToken());
62 m_tile->row(static_cast<unsigned short>(x));
63 m_tile->column(static_cast<unsigned short>(y));
65 m_tile->siteX(static_cast<unsigned short>(x));
66 m_tile->siteY(static_cast<unsigned short>(y));
70 addTileType(m_tok->wordToken());
72 m_tile->typeIndex(static_cast<unsigned short>(m_tileType->tag()));
77 if (!m_tok->uintToken(count))
throw Exception();
78 m_sites->reserve(count);
85 if (
')' == m_tok->separatorToken())
return;
86 if (
'(' != m_tok->separatorToken())
throw Exception();
91 parse1stPrimitiveSite();
103 if (
')' == m_tok->separatorToken())
return;
104 if (
'(' != m_tok->separatorToken())
throw Exception();
119 if (
')' == m_tok->separatorToken())
return;
120 if (
'(' != m_tok->separatorToken())
throw Exception();
133 if (
')' != m_tok->separatorToken())
throw Exception();
137 void XDLRCParserImp::parse1stPrimitiveSite()
140 size_t count = m_sites->size();
146 (primitiveSite.
name()).assign(m_tok->wordToken());
153 const char* s = m_tok->wordToken();
161 if (!m_tok->uintToken(count))
throw Exception();
168 if (
')' == m_tok->separatorToken())
return;
169 if (
'(' != m_tok->separatorToken())
throw Exception();
180 s = m_tok->wordToken();
190 if (
')' != m_tok->separatorToken())
throw Exception();
195 void XDLRCParserImp::parse1stWire()
199 addWire(m_tok->wordToken());
204 if (!m_tok->uintToken(count))
throw Exception();
211 if (
')' == m_tok->separatorToken())
return;
212 if (
'(' != m_tok->separatorToken())
throw Exception();
226 if (
')' != m_tok->separatorToken())
throw Exception();
231 void XDLRCParserImp::parse1stPIP()
238 size_t startWireIndex = findWire(m_tok->wordToken(), *m_wireMap);
241 m_tok->wordChar(
'=');
242 m_tok->wordChar(
'>');
245 m_tok->separatorChar(
'=');
246 m_tok->separatorChar(
'>');
250 size_t endWireIndex = findWire(m_tok->wordToken(), *m_wireMap);
256 pip.endWireIndex(static_cast<unsigned short>(endWireIndex));
262 if (
')' == m_tok->separatorToken())
return;
263 if (
'(' != m_tok->separatorToken())
throw Exception();
271 if (
')' != m_tok->separatorToken())
throw Exception();
274 if (
')' != m_tok->separatorToken())
throw Exception();