1
0
mirror of https://github.com/YosysHQ/nextpnr.git synced 2026-01-26 04:02:25 +00:00

initial import of python-console

This commit is contained in:
Miodrag Milanovic
2018-06-28 13:16:53 +02:00
parent 66670831b8
commit c63274342f
28 changed files with 2120 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
#include <iostream>
#include "Interpreter.h"
int main( int argc, char *argv[] )
{
std::string commands[] = {
"from time import time,ctime\n",
"print 'Today is',ctime(time())\n"
};
Interpreter::Initialize( );
Interpreter* interpreter = new Interpreter;
for ( int i = 0; i < 2; ++i )
{
int err;
std::string res = interpreter->interpret( commands[i], &err );
std::cout << res;
}
delete interpreter;
Interpreter::Finalize( );
return 0;
}