From d9f959f40015565694bc7bbcbec76b2904d765d5 Mon Sep 17 00:00:00 2001 From: Filleo Date: Mon, 15 Apr 2024 22:02:53 +0200 Subject: [PATCH] completed all keywords and symbols in base language. created keywords for strings and multiline strings. --- program.gem | 75 +++++++++++++++++++++++++++++++++++++++++++++++ src/yacc/parser.y | 25 +++++++++++++++- 2 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 program.gem diff --git a/program.gem b/program.gem new file mode 100644 index 0000000..a05ba92 --- /dev/null +++ b/program.gem @@ -0,0 +1,75 @@ += +: +| +! + ++ +- +* +/ + + +( +) +[ +] +{ +} + +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/yacc/parser.y b/src/yacc/parser.y index ac5608e..92a193e 100644 --- a/src/yacc/parser.y +++ b/src/yacc/parser.y @@ -50,6 +50,17 @@ %token OpXor +%token KeyImport +%token KeySilent +%token KeyBox +%token FunTypeof +%token FunSizeof +%token FunFilename +%token FunFunname +%token FunLineno +%token FunExtsupport +%token ValStr +%token ValMultistr %% @@ -79,6 +90,7 @@ decl: '=' {printf("=\n"); }; | '.' {printf(".\n"); }; | ',' {printf(",\n"); }; | ';' {printf(";\n"); }; + | '#' {printf("#\n"); }; @@ -115,9 +127,20 @@ decl: '=' {printf("=\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"); }; - %%