12 using namespace bil::xdlrcparser_detail;
15 void XDLRCParserImp::parse1stPrimitiveDefs()
20 if (!m_tok->uintToken(count))
throw Exception();
22 m_primitiveTypes->reserve(count);
23 m_pinMaps.reserve(count);
30 if (
')' == m_tok->separatorToken())
return;
31 if (
'(' != m_tok->separatorToken())
throw Exception();
36 parse1stPrimitiveDef();
41 void XDLRCParserImp::parse1stPrimitiveDef()
45 addPrimitiveType(m_tok->wordToken());
50 if (!m_tok->uintToken(count))
throw Exception();
51 m_pins->reserve(count);
55 if (!m_tok->uintToken(count))
throw Exception();
56 m_elements->reserve(count);
63 if (
')' == m_tok->separatorToken())
return;
64 if (
'(' != m_tok->separatorToken())
throw Exception();
81 if (
')' == m_tok->separatorToken())
return;
82 if (
'(' != m_tok->separatorToken())
throw Exception();
90 void XDLRCParserImp::parse1stPin()
94 addPin(m_tok->wordToken());
101 const char* s = m_tok->wordToken();
108 if (
')' != m_tok->separatorToken())
throw Exception();
112 void XDLRCParserImp::parse1stElement()
115 size_t count = m_elements->size();
116 m_elements->push_back(
Element());
117 Element& element = (*m_elements)[count];
122 (element.
name()).assign(m_tok->wordToken());
126 if (!m_tok->uintToken(count))
throw Exception();
133 if (
')' == m_tok->separatorToken())
return;
134 if (
'(' != m_tok->separatorToken())
throw Exception();
145 const char* s = m_tok->wordToken();
152 if (
')' != m_tok->separatorToken())
throw Exception();
162 m_tok->wordChar(
'#');
163 m_tok->wordChar(
'<');
164 m_tok->wordChar(
'>');
165 m_tok->wordChar(
':');
170 options.push_back(m_tok->wordToken());
172 m_tok->commentChar(
'#');
173 m_tok->separatorChar(
'<');
174 m_tok->separatorChar(
'>');
175 m_tok->separatorChar(
':');
176 if (
')' != m_tok->separatorToken())
throw Exception();
180 if (
')' == m_tok->separatorToken())
return;
181 if (
'(' != m_tok->separatorToken())
throw Exception();
200 m_tok->wordChar(
'=');
201 m_tok->wordChar(
'<');
202 m_tok->wordChar(
'>');
204 const char* s = m_tok->wordToken();
208 m_tok->separatorChar(
'=');
209 m_tok->separatorChar(
'<');
210 m_tok->separatorChar(
'>');
220 if (
')' != m_tok->separatorToken())
throw Exception();
224 if (
')' == m_tok->separatorToken())
return;
225 if (
'(' != m_tok->separatorToken())
throw Exception();