temporary fix for commas within operands
This commit is contained in:
		
							parent
							
								
									6439f09220
								
							
						
					
					
						commit
						c9f7d845a2
					
				
					 2 changed files with 9 additions and 6 deletions
				
			
		| 
						 | 
					@ -3,7 +3,6 @@
 | 
				
			||||||
 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
 | 
					 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
 | 
				
			||||||
 * See the copyright notice in the ACK home directory, in the file "Copyright".
 | 
					 * See the copyright notice in the ACK home directory, in the file "Copyright".
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
typedef struct item *item_p;
 | 
					 | 
				
			||||||
typedef struct queue_t *queue;
 | 
					typedef struct queue_t *queue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct queue_t {
 | 
					struct queue_t {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -14,8 +14,7 @@ extern char *lstrip();
 | 
				
			||||||
extern instr_p newinstr();
 | 
					extern instr_p newinstr();
 | 
				
			||||||
extern instr_p read_instr();
 | 
					extern instr_p read_instr();
 | 
				
			||||||
extern instr_p gen_instr();
 | 
					extern instr_p gen_instr();
 | 
				
			||||||
extern char *eval_templ();
 | 
					extern char * malloc();
 | 
				
			||||||
extern instr_p malloc();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct variable var[NRVARS+1];
 | 
					struct variable var[NRVARS+1];
 | 
				
			||||||
struct variable ANY;  /* ANY symbol matching any instruction */
 | 
					struct variable ANY;  /* ANY symbol matching any instruction */
 | 
				
			||||||
| 
						 | 
					@ -64,7 +63,6 @@ optimize()
 | 
				
			||||||
	struct queue_t windowq, backupq;
 | 
						struct queue_t windowq, backupq;
 | 
				
			||||||
	queue window, backup;
 | 
						queue window, backup;
 | 
				
			||||||
	instr_p ip;
 | 
						instr_p ip;
 | 
				
			||||||
	bool change;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	window = &windowq;
 | 
						window = &windowq;
 | 
				
			||||||
	backup = &backupq;
 | 
						backup = &backupq;
 | 
				
			||||||
| 
						 | 
					@ -344,10 +342,15 @@ bool operand(ip,n)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	register char *p;
 | 
						register char *p;
 | 
				
			||||||
	int oplen;
 | 
						int oplen;
 | 
				
			||||||
 | 
						int nesting = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	skip_white(ip);
 | 
						skip_white(ip);
 | 
				
			||||||
	p = ip->rest_line;
 | 
						p = ip->rest_line;
 | 
				
			||||||
	while( *p != OP_SEPARATOR && *p != '\n') p++;
 | 
						while((*p != OP_SEPARATOR || nesting) && *p != '\n') {
 | 
				
			||||||
 | 
							if (*p == '(') nesting++;
 | 
				
			||||||
 | 
							else if (*p == ')') nesting--;
 | 
				
			||||||
 | 
							p++;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	oplen = p - ip->rest_line;
 | 
						oplen = p - ip->rest_line;
 | 
				
			||||||
	if (oplen == 0 || oplen > MAXOPLEN) return FALSE;
 | 
						if (oplen == 0 || oplen > MAXOPLEN) return FALSE;
 | 
				
			||||||
	strncpy(ip->op[n],ip->rest_line,oplen);
 | 
						strncpy(ip->op[n],ip->rest_line,oplen);
 | 
				
			||||||
| 
						 | 
					@ -571,7 +574,8 @@ instr_p newinstr()
 | 
				
			||||||
	int i;
 | 
						int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (instr_pool == NIL) {
 | 
						if (instr_pool == NIL) {
 | 
				
			||||||
		instr_pool = malloc(sizeof(struct instruction));
 | 
							instr_pool = (instr_p) malloc(sizeof(struct instruction));
 | 
				
			||||||
 | 
							instr_pool->fw = 0;
 | 
				
			||||||
		nr_mallocs++;
 | 
							nr_mallocs++;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	assert(instr_pool != NIL);
 | 
						assert(instr_pool != NIL);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue