cleaned up a bit

This commit is contained in:
ceriel 1989-01-26 14:43:09 +00:00
parent 6ee3538d91
commit 7f0b775587
4 changed files with 4 additions and 55 deletions

View file

@ -9,9 +9,7 @@ OFILES = pars.o Lpars.o scan.o mylex.o default.o C_instr2.o help.o eval.o\
action.o
IFILES = -I$(EM)/h -I$(EM)/modules/h
CC = cc
.c.o :
$(CC) $(IFILES) -c $<
CFLAGS = $(IFILES)
all : dummy $(OFILES)

View file

@ -12,7 +12,7 @@ char **as_instructions; /* The buffer(?) where the instructions are saved */
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 '.' ? */

View file

@ -9,7 +9,6 @@
* 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'
@ -82,13 +81,6 @@ int mylex()
}
break;
case ':' : if ( equiv()) {
CD_pos = FALSE;
CALL_pos = TRUE;
return( EQUIV);
}
break;
case 'd' : if ( CD_pos && _default()) {
CD_pos = FALSE;
special = FALSE;
@ -194,18 +186,6 @@ int arrow() /* '==>' */
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();
@ -266,7 +246,7 @@ read_call()
read_condition()
/* A CONDITION is followed by either '==>' or '::='.
/* A CONDITION is followed by '==>'
*/
{
while ( TRUE) {
@ -281,15 +261,6 @@ read_condition()
return;
}
break;
case ':' : if ( equiv()) {
backc( '=');
backc( ':');
backc( ':');
next -= 3;
return;
}
break;
}
}
}
@ -299,12 +270,6 @@ char *str;
{
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);
}

View file

@ -44,7 +44,7 @@ char *to_change;
}
%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;
@ -79,13 +79,6 @@ simple : ARROW { save_output();}
actionlist { back_patch();}
;
/*
| EQUIV { no_conversions = TRUE; save_output();}
actionlist { no_conversions = FALSE; back_patch();}
;
*/
actionlist : { first_action = TRUE;}
[ action { first_action = FALSE;}
@ -131,9 +124,6 @@ Dspecial: CONDITION { out( " %s ", yytext);}
Dsimple : ARROW { out( "%s", yytext);}
Dactionlist
| EQUIV { out( "%s", yytext);}
Dactionlist
;
Dactionlist :
@ -196,8 +186,6 @@ c_special : CONDITION
c_simple: ARROW
c_actionlist
| EQUIV
c_actionlist
;
c_actionlist :
@ -254,8 +242,6 @@ int token;
break;
case ARROW : fprint( STDERR, "==> ");
break;
case EQUIV : fprint( STDERR, "::= ");
break;
case CONDITION: fprint( STDERR, "CONDITION %s", yytext);
break;
case DEFAULT : fprint( STDERR, "default ");