MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / NodeDef

Method NodeDef

erpcgen/src/cpptemplate/cpptempl.cpp:1799–1823  ·  view source on GitHub ↗

NodeDef

Source from the content-addressed store, hash-verified

1797
1798// NodeDef
1799NodeDef::NodeDef(const token_vector &expr, uint32_t line)
1800: NodeParent(line)
1801{
1802 TokenIterator tok(expr);
1803 tok.match(token_type_t::DEF_TOKEN, "expected 'def'");
1804
1805 m_name = tok.match(token_type_t::KEY_PATH_TOKEN, "expected key path")->get_value();
1806
1807 if (tok->get_type() == token_type_t::OPEN_PAREN_TOKEN)
1808 {
1809 tok.match(token_type_t::OPEN_PAREN_TOKEN);
1810
1811 while (tok->get_type() != token_type_t::CLOSE_PAREN_TOKEN)
1812 {
1813 m_params.push_back(tok.match(token_type_t::KEY_PATH_TOKEN, "expected key path")->get_value());
1814
1815 if (tok->get_type() != token_type_t::CLOSE_PAREN_TOKEN)
1816 {
1817 tok.match(token_type_t::COMMA_TOKEN, "expected comma");
1818 }
1819 }
1820 tok.match(token_type_t::CLOSE_PAREN_TOKEN, "expected close paren");
1821 }
1822 tok.match(token_type_t::END_TOKEN, "expected end of statement");
1823}
1824
1825NodeType NodeDef::gettype()
1826{

Callers

nothing calls this directly

Calls 3

matchMethod · 0.80
get_typeMethod · 0.80
push_backMethod · 0.80

Tested by

no test coverage detected