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

Method setParameterDirection

erpcgen/src/SymbolScanner.cpp:1428–1464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1426}
1427
1428void SymbolScanner::setParameterDirection(StructMember *param, AstNode *directionNode)
1429{
1430 /* Extract parameter direction: in/out/inout/out byref. */
1431 param_direction_t param_direction;
1432 if (nullptr != directionNode)
1433 {
1434 switch (directionNode->getToken().getToken())
1435 {
1436 case TOK_IN:
1437 {
1438 param_direction = param_direction_t::kInDirection;
1439 break;
1440 }
1441 case TOK_OUT:
1442 {
1443 param_direction = param_direction_t::kOutDirection;
1444 break;
1445 }
1446 case TOK_INOUT:
1447 {
1448 param_direction = param_direction_t::kInoutDirection;
1449 break;
1450 }
1451 default:
1452 {
1453 delete param;
1454 throw semantic_error(format_string("line %d: expected parameter direction type",
1455 directionNode->getToken().getFirstLine()));
1456 }
1457 }
1458 }
1459 else /* if no direction specified, default case is an 'in' variable */
1460 {
1461 param_direction = param_direction_t::kInDirection;
1462 }
1463 param->setDirection(param_direction);
1464}
1465
1466AstNode *SymbolScanner::handleExpr(AstNode *node, bottom_up)
1467{

Callers

nothing calls this directly

Calls 5

semantic_errorClass · 0.85
format_stringFunction · 0.85
getTokenMethod · 0.80
setDirectionMethod · 0.80
getFirstLineMethod · 0.45

Tested by

no test coverage detected