summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby Bingham <koorogi@koorogi.info>2017-01-19 19:31:41 -0600
committerBobby Bingham <koorogi@koorogi.info>2017-01-19 19:31:41 -0600
commit48b3e4525e4cc2730e53de9b926223d9da94d063 (patch)
tree38154a710b56eb8bb1cdb4d5fa95b30cd51f6ceb
parent1dfec70dc9f42c99ad682987ba2c76dece32bbb7 (diff)
nqasm: use " " in grammar instead of T_SPACE
-rw-r--r--parser.y20
1 files 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
;