35 lines
		
	
	
	
		
			594 B
		
	
	
	
		
			Text
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
	
		
			594 B
		
	
	
	
		
			Text
		
	
	
		
			Executable file
		
	
	
	
	
| cat <<'--EOT--'
 | |
| /* Generated by make.tokcase */
 | |
| /* $Id$ */
 | |
| #include "Lpars.h"
 | |
| 
 | |
| char *
 | |
| symbol2str(tok)
 | |
| 	int tok;
 | |
| {
 | |
| #define SIZBUF	8
 | |
| 	/* allow for a few invocations in f.i. an argument list */
 | |
| 	static char buf[SIZBUF] = { '\'', 0, '\'', 0, '\'', 0, '\'', 0};
 | |
| 	static int index = 1;
 | |
| 
 | |
| 	switch (tok) {
 | |
| --EOT--
 | |
| 
 | |
| sed '
 | |
| /{[A-Z]/!d
 | |
| s/.*{\(.*\),.*\(".*"\).*$/	case \1 :\
 | |
| 		return \2;/
 | |
| '
 | |
| 
 | |
| cat <<'--EOT--'
 | |
| 	default:
 | |
| 		if (tok <= 0) return "end of file";
 | |
| 		if (tok < 040 || tok >= 0177) {
 | |
| 			return "bad token";
 | |
| 		}
 | |
| 		index = (index+4) & (SIZBUF-1);
 | |
| 		buf[index] = tok;
 | |
| 		return &buf[index-1];
 | |
| 	}
 | |
| }
 | |
| --EOT--
 |