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

Method NodeFor

erpcgen/src/cpptemplate/cpptempl.cpp:1623–1644  ·  view source on GitHub ↗

NodeFor

Source from the content-addressed store, hash-verified

1621
1622// NodeFor
1623NodeFor::NodeFor(const token_vector &tokens, bool is_top, uint32_t line)
1624: NodeParent(line)
1625, m_is_top(is_top)
1626, m_has_predicate(false)
1627{
1628 TokenIterator tok(tokens);
1629 tok.match(token_type_t::FOR_TOKEN, "expected 'for'");
1630 m_val = tok.match(token_type_t::KEY_PATH_TOKEN, "expected key path")->get_value();
1631 tok.match(token_type_t::IN_TOKEN, "expected 'in'");
1632 m_key = tok.match(token_type_t::KEY_PATH_TOKEN, "expected key path")->get_value();
1633 if (tok->get_type() != token_type_t::END_TOKEN)
1634 {
1635 tok.match(token_type_t::IF_TOKEN, "expected 'if'");
1636 while (tok->get_type() != token_type_t::END_TOKEN)
1637 {
1638 m_predicate_tokens.push_back(*tok.get());
1639 ++tok;
1640 }
1641 m_has_predicate = true;
1642 }
1643 tok.match(token_type_t::END_TOKEN, "expected end of statement");
1644}
1645
1646NodeType NodeFor::gettype()
1647{

Callers

nothing calls this directly

Calls 4

matchMethod · 0.80
get_typeMethod · 0.80
push_backMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected