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

Method parse

erpcgen/src/InterfaceDefinition.cpp:42–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42void InterfaceDefinition::parse(const char *inputFile)
43{
44 // create lexer instance
45 ErpcLexer lexer(inputFile);
46 int result = yyparse(&lexer, &m_ast);
47 m_idlCrc16 = lexer.getIdlCrc16();
48
49 // check results
50 if (result || !m_ast)
51 {
52 throw runtime_error("failed to parse command file");
53 }
54
55 // Log::info("Parsing was successful!\n");
56
57 // dump AST
58 AstPrinter printer(m_ast);
59 printer.dispatch();
60
61 // Build table of symbols.
62 SymbolScanner scanner(&m_globals, string(inputFile));
63 scanner.startWalk(m_ast);
64 m_program = scanner.getProgram();
65
66 m_globals.dump();
67}
68
69void InterfaceDefinition::createBuiltinTypes()
70{

Callers 5

mainMethod · 0.80
runMethod · 0.80
DataTemplateMethod · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80

Calls 5

startWalkMethod · 0.80
getProgramMethod · 0.80
getIdlCrc16Method · 0.45
dispatchMethod · 0.45
dumpMethod · 0.45

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.64