-
Notifications
You must be signed in to change notification settings - Fork 2
/
peyman.cc
42 lines (37 loc) · 984 Bytes
/
peyman.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <cstdio>
#include <iostream>
#include <parser.tab.h>
#define VERSION "0.1.0"
extern int yyparse();
extern FILE *yyin;
int main(int argc, char **argv) {
if (argc > 1) {
yyin = fopen(argv[1], "r+");
} else {
std::cout << R"(
_ _ /'/ )\,/,/(_ \ \
`//-.| ( ,\\)\//\)\/_ ) |
//___\ `\\\/\\/\/\\///' /
,-"~`-._ `"--'_ `"""` _ \`'"~-,_
\ `-. '_`. .'_` \ ,-"~`/
`.__.-'`/ (-\ /-) |-.__,'
|| | \O) /^\ (O/ |
`\\ | / `\ /
\\ \ / `\ /
`\\ `-. /' .---.--.\
`\\/`~(, '() ('
/(O) \\ _,.-.,_)
// \\ `\'` /
pey / | || `""""~"`
/' |__||
`o
)"
<< "\n";
std::cout << "Peyman programming language " << VERSION << "\n";
std::cout << "WARNING: INTERACTIVE MODE IS BUGGY YET, TRY THIS INSTEAD:\n"
<< "usage: peyman file_name.pey\n\n";
}
yyparse();
fclose(yyin);
return 0;
}