diff --git a/program.gem b/program.gem deleted file mode 100644 index a05ba92..0000000 --- a/program.gem +++ /dev/null @@ -1,75 +0,0 @@ -= -: -| -! - -+ -- -* -/ - - -( -) -[ -] -{ -} - -dsafsdgvvgxc -543564765 -int -float -as - -short -long -half -double -signed -unsigned - -ref -type -local -global -static - -if -else - -while - -in -out -fun - -, -; -== -&& -|| -!! -^^ -& -| -^ -! -. - -import -silent -box -# -typeof -sizeof -filename -funname -lineno -extsupport - -"fdsdfsdfsdfsdf" -"test" -"""gsdffgsdfgdf \ -dasad""" -"""""" diff --git a/src/main.c b/src/main.c index 27df7ed..6b48e00 100644 --- a/src/main.c +++ b/src/main.c @@ -1,13 +1,6 @@ #include -#include - -extern FILE* yyin; int main() { - FILE* input = fopen("program.gem", "r"); - - yyin = input; - yyparse(); return 0; } \ No newline at end of file diff --git a/src/yacc/parser.y b/src/yacc/parser.y index 92a193e..7decf27 100644 --- a/src/yacc/parser.y +++ b/src/yacc/parser.y @@ -1,12 +1,9 @@ %{ - #include extern int yylineno; int yyerror(char*); extern int yylex(); - - int array[256]; %} %union { @@ -64,87 +61,9 @@ %% -program: decllist; - -decllist: decl - | decllist decl; - -decl: '=' {printf("=\n"); }; - | ':' {printf(":\n"); }; - | '|' {printf("|\n"); }; - | '(' {printf("(\n"); }; - | ')' {printf(")\n"); }; - | '[' {printf("[\n"); }; - | ']' {printf("]\n"); }; - | '{' {printf("{\n"); }; - | '}' {printf("}\n"); }; - | '!' {printf("!\n"); }; - - | '+' {printf("+\n"); }; - | '-' {printf("-\n"); }; - | '*' {printf("*\n"); }; - | '/' {printf("/\n"); }; - - | '&' {printf("&\n"); }; - | '^' {printf("^\n"); }; - | '.' {printf(".\n"); }; - | ',' {printf(",\n"); }; - | ';' {printf(";\n"); }; - | '#' {printf("#\n"); }; - - - - | Ident {printf("Ident\n"); }; - | ValInt {printf("ValInt\n"); }; - | KeyInt {printf("KeyInt\n"); }; - | KeyFloat {printf("KeyFloat\n"); }; - | KeyAs {printf("KeyAs\n"); }; - - | KeyShort {printf("KeyShort\n"); }; - | KeyLong {printf("KeyLong\n"); }; - | KeyHalf {printf("KeyHalf\n"); }; - | KeyDouble {printf("KeyDouble\n"); }; - | KeySigned {printf("KeySigned\n"); }; - | Keyunsigned {printf("Keyunsigned\n"); }; - - | KeyRef {printf("KeyRef\n"); }; - | KeyType {printf("KeyType\n"); }; - | KeyLocal {printf("KeyLocal\n"); }; - | KeyGlobal {printf("KeyGlobal\n"); }; - | KeyStatic {printf("KeyStatic\n"); }; - - | KeyIf {printf("KeyIf\n"); }; - | KeyElse {printf("KeyElse\n"); }; - - | KeyWhile {printf("KeyWhile\n"); }; - - | KeyIn {printf("KeyIn\n"); }; - | KeyOut {printf("KeyOut\n"); }; - | KeyFun {printf("KeyFun\n"); }; - | OpEquals {printf("OpEquals\n"); }; - | OpAnd {printf("OpAnd\n"); }; - | OpOr {printf("OpOr\n"); }; - | OpNot {printf("OpNot\n"); }; - | OpXor {printf("OpXor\n"); }; - - | KeyImport {printf("KeyImport\n"); }; - | KeySilent {printf("KeySilent\n"); }; - | KeyBox {printf("KeyBox\n"); }; - | FunTypeof {printf("FunTypeof\n"); }; - | FunSizeof {printf("FunSizeof\n"); }; - | FunFilename {printf("FunFilename\n"); }; - | FunLineno {printf("FunLineno\n"); }; - | FunExtsupport {printf("FunExtsupport\n"); }; - | FunFunname {printf("FunFunname\n"); }; - - | ValStr {printf("ValStr\n"); }; - | ValMultistr {printf("ValMultistr\n"); }; - - +program: ; %% - - int yyerror(char *s) { return 0; } \ No newline at end of file