File: defatom.awk

package info (click to toggle)
swi-prolog 3.1.0-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 8,772 kB
  • ctags: 12,869
  • sloc: ansic: 43,657; perl: 12,577; lisp: 4,359; sh: 1,534; makefile: 798; awk: 14
file content (14 lines) | stat: -rw-r--r-- 369 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
BEGIN	{ atom = functor = 0;
	}
/^#/	{ next;
	}
/^A/	{ printf "#define ATOM_%-12s MK_ATOM(%d)\n",$2,atom  > "pl-atom.ih"
	  printf "ATOM(%s),\n",$3  > "pl-atom.ic"
	  atom++;
	  next;
	}
/^F/	{ name = $2 $3;
	  printf "#define FUNCTOR_%-12s MK_FUNCTOR(%d, %d)\n",name,functor,$3 > "pl-funct.ih"
	  printf "FUNCTOR(ATOM_%s, %d),\n",$2,$3 > "pl-funct.ic"
	  functor++;
	}