18 lines
		
	
	
	
		
			317 B
		
	
	
	
		
			Text
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
	
		
			317 B
		
	
	
	
		
			Text
		
	
	
		
			Executable file
		
	
	
	
	
awk '
 | 
						|
BEGIN	{ n = 0 }
 | 
						|
	{ print "#define " $1 " " n; n++
 | 
						|
	  if ($3 !~ /0/) print "extern int " $3 "();" ;
 | 
						|
	}
 | 
						|
' < $1 > ops.h
 | 
						|
 | 
						|
cat > ops.c <<'EOF'
 | 
						|
#include "operator.h"
 | 
						|
#include "ops.h"
 | 
						|
 | 
						|
t_operator operators[] = {
 | 
						|
EOF
 | 
						|
awk '	{ print "{ " $2 ", " $3 "}, /* " $1 " */" }' < $1 >> ops.c
 | 
						|
cat >> ops.c <<'EOF'
 | 
						|
{ 0, 0 }
 | 
						|
};
 | 
						|
EOF
 |