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

Method parse_afactor

erpcgen/src/cpptemplate/cpptempl.cpp:1390–1417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1388}
1389
1390data_ptr ExprParser::parse_afactor()
1391{
1392 data_ptr ldata = parse_mfactor();
1393
1394 token_type_t tokType = m_tok->get_type();
1395 if (tokType == token_type_t::PLUS_TOKEN || tokType == token_type_t::MINUS_TOKEN || tokType == token_type_t::CONCAT_TOKEN)
1396 {
1397 m_tok.next();
1398
1399 data_ptr rdata = parse_afactor();
1400
1401 switch (tokType)
1402 {
1403 case token_type_t::CONCAT_TOKEN:
1404 ldata = ldata->getvalue() + rdata->getvalue();
1405 break;
1406 case token_type_t::PLUS_TOKEN:
1407 ldata = ldata->getint() + rdata->getint();
1408 break;
1409 case token_type_t::MINUS_TOKEN:
1410 ldata = ldata->getint() - rdata->getint();
1411 break;
1412 default:
1413 break;
1414 }
1415 }
1416 return ldata;
1417}
1418
1419data_ptr ExprParser::parse_mfactor()
1420{

Callers

nothing calls this directly

Calls 4

get_typeMethod · 0.80
getvalueMethod · 0.80
getintMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected