aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin T. Gibbs <gibbs@FreeBSD.org>2003-01-20 18:02:11 +0000
committerJustin T. Gibbs <gibbs@FreeBSD.org>2003-01-20 18:02:11 +0000
commit3d46a68893e415fb00bbf7acf6189f63dd3d1f6d (patch)
treee5dc26ba9bd54c29fb209e2690a462ab9fc9d228
parent357c1c6a4c721aa4e6a5c74ed22ca69fc9d2f6e5 (diff)
downloadsrc-3d46a68893e415fb00bbf7acf6189f63dd3d1f6d.tar.gz
src-3d46a68893e415fb00bbf7acf6189f63dd3d1f6d.zip
Allow constants to be complex expressions so long as those
expressions can be fully evaluated during assembly. Remove the numerical_value portion of the grammer which is no longer referenced.
Notes
Notes: svn path=/head/; revision=109576
-rw-r--r--sys/dev/aic7xxx/aicasm/aicasm_gram.y21
1 files changed, 6 insertions, 15 deletions
diff --git a/sys/dev/aic7xxx/aicasm/aicasm_gram.y b/sys/dev/aic7xxx/aicasm/aicasm_gram.y
index fb3aa14d0e0b..67e046d96625 100644
--- a/sys/dev/aic7xxx/aicasm/aicasm_gram.y
+++ b/sys/dev/aic7xxx/aicasm/aicasm_gram.y
@@ -38,7 +38,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_gram.y#26 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_gram.y#29 $
*
* $FreeBSD$
*/
@@ -209,7 +209,7 @@ static int is_download_const(expression_t *immed);
%type <value> export ret f1_opcode f2_opcode jmp_jc_jnc_call jz_jnz je_jne
-%type <value> numerical_value mode_value mode_list macro_arglist
+%type <value> mode_value mode_list macro_arglist
%left '|'
%left '&'
@@ -707,7 +707,7 @@ expression:
;
constant:
- T_CONST T_SYMBOL numerical_value
+ T_CONST T_SYMBOL expression
{
if ($2->type != UNINITIALIZED) {
stop("Re-definition of symbol as a constant",
@@ -716,7 +716,7 @@ constant:
}
$2->type = CONST;
initialize_symbol($2);
- $2->info.cinfo->value = $3;
+ $2->info.cinfo->value = $3.value;
}
| T_CONST T_SYMBOL T_DOWNLOAD
{
@@ -784,17 +784,6 @@ macro_arglist:
}
;
-numerical_value:
- T_NUMBER
- {
- $$ = $1;
- }
-| '-' T_NUMBER
- {
- $$ = -$2;
- }
-;
-
scratch_ram:
T_SRAM '{'
{
@@ -994,6 +983,7 @@ critical_section_start:
cs->begin_addr = instruction_ptr;
in_critical_section = TRUE;
}
+;
critical_section_end:
T_END_CS ';'
@@ -1008,6 +998,7 @@ critical_section_end:
cs->end_addr = instruction_ptr;
in_critical_section = FALSE;
}
+;
export:
{ $$ = 0; }