MCPcopy Create free account
hub / github.com/YosysHQ/nextpnr / main

Function main

3rdparty/python-console/test_cli.cpp:34–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32};
33
34int main( int argc, char *argv[] )
35{
36 Interpreter::Initialize( );
37 const std::string* prompt = &STD_PROMPT;
38 ParseHelper helper;
39 ParseListener* listener = new InterpreterRelay;
40 helper.subscribe( listener );
41
42 std::string str;
43 std::cout << *prompt;
44 std::getline( std::cin, str );
45 while ( str != "quit" )
46 {
47 std::cout << str << "\n";
48 helper.process( str );
49 if ( helper.buffered( ) )
50 {
51 prompt = &MULTILINE_PROMPT;
52 }
53 else
54 {
55 prompt = &STD_PROMPT;
56 }
57 std::cout << *prompt;
58 std::getline( std::cin, str );
59 }
60
61 Interpreter::Finalize( );
62 return 0;
63}

Callers

nothing calls this directly

Calls 3

subscribeMethod · 0.80
bufferedMethod · 0.80
processMethod · 0.45

Tested by

no test coverage detected