Files
triton/examples/matrix.cpp

28 lines
572 B
C++
Raw Normal View History

2018-12-15 22:29:36 -05:00
#include <cstring>
#include <cstdio>
2018-12-16 16:15:40 -05:00
#include "ast.h"
2018-12-15 22:29:36 -05:00
typedef struct yy_buffer_state * YY_BUFFER_STATE;
extern int yyparse();
extern YY_BUFFER_STATE yy_scan_string(const char * str);
extern void yy_delete_buffer(YY_BUFFER_STATE buffer);
2018-12-17 10:43:49 -05:00
using tdl::ast::translation_unit;
2018-12-16 16:15:40 -05:00
extern translation_unit *ast_root;
2018-12-15 22:29:36 -05:00
const char src[] =
"\
void test(int32 id){\
fp32 c[16, 16] = {0};\
int32 i = 0;\
i += 1;\
}\
";
2018-12-15 22:29:36 -05:00
int main() {
YY_BUFFER_STATE buffer = yy_scan_string(src);
yyparse();
2018-12-15 22:29:36 -05:00
yy_delete_buffer(buffer);
2018-12-16 16:15:40 -05:00
translation_unit *program = ast_root;
2018-12-15 22:29:36 -05:00
return 0;
}