mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-python
synced 2026-01-15 09:53:32 +01:00
Line numbers of parsed input are now automatically maintained. More needed data structures are now automatically created in the API header file. Signed-off-by: Jan Lindemann <jan@janware.com>
30 lines
562 B
C++
30 lines
562 B
C++
#include <string>
|
|
|
|
#include <slog.h>
|
|
#include <YMisc.h>
|
|
|
|
#include "include/grammartest.h"
|
|
|
|
using namespace std;
|
|
|
|
int main(int argc, const char *argv[])
|
|
{
|
|
if (argc < 2) {
|
|
fprintf(stderr, "usage: %s input-file\n", filenotdir(argv[0]));
|
|
return 1;
|
|
}
|
|
|
|
const char *path = argv[1];
|
|
string content;
|
|
if (YMisc::suck_in_file(path, content)<0) {
|
|
slog(PRI_ERR, "failed to read [%s] (%s)", path, err());
|
|
return 1;
|
|
}
|
|
|
|
if (FB_SYM(create_ast)(content.c_str())<0) {
|
|
slog(PRI_ERR, "failed to create AST from [%s] (%s)", path, err());
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|