From 48b3e4525e4cc2730e53de9b926223d9da94d063 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Thu, 19 Jan 2017 19:31:41 -0600 Subject: nqasm: use " " in grammar instead of T_SPACE --- parser.y | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/parser.y b/parser.y index 31cc63a..f11ab63 100644 --- a/parser.y +++ b/parser.y @@ -38,7 +38,6 @@ void yyerror(const char *msg) %token END 0 "end of file" %token T_UNKNOWN -%token T_SPACE %token T_EOL %token T_ADD @@ -85,6 +84,7 @@ void yyerror(const char *msg) %token T_COLON ":" %token T_DOT "." %token T_DEREF "@" +%token T_SPACE " " %token T_OPERATOR_ADD "+" %token T_OPERATOR_SUB "-" @@ -124,7 +124,7 @@ line: ; bol: - T_SPACE + " " | T_LABEL ":" { add_label($1); } ; @@ -166,13 +166,13 @@ inst: | T_NOP { $$ = INSTRUCTION(NOP); } ; -a_reg2: T_SPACE reg "," reg { $$ = MKARGS($2, $4); } -a_reg3: T_SPACE reg "," reg "," reg { $$ = MKARGS($2, $4, $6); } -a_regp: T_SPACE regp { $$ = MKARGS($2); } -a_regp_reg: T_SPACE regp "," reg { $$ = MKARGS($2, $4); } -a_reg_regp: T_SPACE reg "," regp { $$ = MKARGS($2, $4); } -a_reg_expr: T_SPACE reg "," expr { $$ = MKARGS($2, $4); } -a_expr: T_SPACE expr { $$ = MKARGS($2); } +a_reg2: " " reg "," reg { $$ = MKARGS($2, $4); } +a_reg3: " " reg "," reg "," reg { $$ = MKARGS($2, $4, $6); } +a_regp: " " regp { $$ = MKARGS($2); } +a_regp_reg: " " regp "," reg { $$ = MKARGS($2, $4); } +a_reg_regp: " " reg "," regp { $$ = MKARGS($2, $4); } +a_reg_expr: " " reg "," expr { $$ = MKARGS($2, $4); } +a_expr: " " expr { $$ = MKARGS($2); } regp: "@" reg { $$ = $2; } reg: T_LABEL { @@ -214,5 +214,5 @@ intlit: T_INT } eol: T_EOL - | T_SPACE T_EOL + | " " T_EOL ; -- cgit v1.2.3