action.o
IFILES = -I$(EM)/h -I$(EM)/modules/h
CC = cc
-
-.c.o :
- $(CC) $(IFILES) -c $<
+CFLAGS = $(IFILES)
all : dummy $(OFILES)
int quantum = 0, /* Max. nr. of instructions in as_instructions[] */
nr_instr, /* Number of saved instructions */
first_action, /* Is this block of assembler-instr. the first after
- * a '==>' or '::=' ?
+ * a '==>'?
*/
last_action; /* Is this block followed by a '.' ? */
* DEF_C_INSTR - 'C_loe..', 'C_ste..', '..icon, '..fcon', etc
* CONDITION - C-expression, for example: '$1 == 481'
* ARROW - '==>'
- * EQUIV - '::='
* CALL - C-style functioncall, for example: 'error( 17)'
* ASSEM_INSTR - C-style string, for example: '"mov r0, (r1)"'
* DEFAULT - 'default'
}
break;
- case ':' : if ( equiv()) {
- CD_pos = FALSE;
- CALL_pos = TRUE;
- return( EQUIV);
- }
- break;
-
case 'd' : if ( CD_pos && _default()) {
CD_pos = FALSE;
special = FALSE;
return( FALSE);
}
-int equiv() /* '::=' */
-{
- if ( ( *next++ = scanc()) == ':')
- if ( ( *next++ = scanc()) == '=')
- return( TRUE);
- else
- backc( *--next);
- else
- backc( *--next);
- return( FALSE);
-}
-
int _default() /* 'default' */
{
char c, skip_space();
read_condition()
-/* A CONDITION is followed by either '==>' or '::='.
+/* A CONDITION is followed by '==>'
*/
{
while ( TRUE) {
return;
}
break;
-
- case ':' : if ( equiv()) {
- backc( '=');
- backc( ':');
- backc( ':');
- next -= 3;
- return;
- }
- break;
}
}
}
{
if ( *str == 'C' && *(str+1) == '_') /* C_xxx */
return( TRUE);
- else if ( strncmp( "locals", str, 6) == 0)
- return( TRUE);
- else if ( strncmp( "jump", str, 4) == 0)
- return( TRUE);
- else if ( strncmp( "prolog", str, 6) == 0)
- return( TRUE);
else
return( FALSE);
}
}
-%token C_INSTR, DEF_C_INSTR, CONDITION, ARROW, EQUIV,
+%token C_INSTR, DEF_C_INSTR, CONDITION, ARROW,
CALL, ASSEM_INSTR, DEFAULT, ERROR;
%start table, table;
%start def_row, def_row;
actionlist { back_patch();}
;
-/*
- | EQUIV { no_conversions = TRUE; save_output();}
- actionlist { no_conversions = FALSE; back_patch();}
-
- ;
-*/
-
actionlist : { first_action = TRUE;}
[ action { first_action = FALSE;}
Dsimple : ARROW { out( "%s", yytext);}
Dactionlist
- | EQUIV { out( "%s", yytext);}
- Dactionlist
-
;
Dactionlist :
c_simple: ARROW
c_actionlist
- | EQUIV
- c_actionlist
;
c_actionlist :
break;
case ARROW : fprint( STDERR, "==> ");
break;
- case EQUIV : fprint( STDERR, "::= ");
- break;
case CONDITION: fprint( STDERR, "CONDITION %s", yytext);
break;
case DEFAULT : fprint( STDERR, "default ");