From c4b37b58b7f9936fb8456b71b24b19829e5d77a0 Mon Sep 17 00:00:00 2001 From: Tom Everett Date: Mon, 29 Feb 2016 20:53:18 -0700 Subject: [PATCH] closer --- antlr/pdp7asm.g4 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/antlr/pdp7asm.g4 b/antlr/pdp7asm.g4 index 9364753..3a49a0f 100644 --- a/antlr/pdp7asm.g4 +++ b/antlr/pdp7asm.g4 @@ -45,19 +45,21 @@ declarations ; declaration - : instruction - | label - | expression + : label? (instruction | assignment | expression)? ; instruction - : opcode argument+ + : opcode argument* ; argument : expression ; +assignment + : variable '=' expression + ; + expression : multiplyingExpression ((PLUS|MINUS) multiplyingExpression)* ; @@ -87,7 +89,7 @@ comment ; label - : LABEL argument? + : LABEL ; variable