From 2e0de3cc53d031ac2fa48eddc9a472b0e4c34a45 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Wed, 18 Jan 2017 19:11:57 -0600 Subject: nqasm: reformat argument rules in grammar --- parser.y | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'parser.y') diff --git a/parser.y b/parser.y index f63a70f..e698e47 100644 --- a/parser.y +++ b/parser.y @@ -149,20 +149,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: 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); } regp: "@" reg { $$ = $2; } reg: T_LABEL { -- cgit v1.2.3