#!/usr/bin/env perl ##### # keywords.pl # Andy Hammerlindl 2006/07/31 # # Extract keywords from camp.l and list them in a keywords file. These # keywords are used in autocompletion at the interactive prompt. ##### # Extra keywords to add that aren't automatically extracted, currently none. @extrawords = (); open(keywords, ">keywords.cc") || die("Couldn't open keywords.out for writing."); print keywords <) { if (/^%%\s*$/) { last; # Break out of the loop. } } # Grab simple keyword definitions from camp.l while () { if (/^%%\s*$/) { last; # A second %% indicates the end of definitions. } if (/^([A-Za-z_][A-Za-z0-9_]*)\s*\{/) { add($1); } } # Grab the special commands from the interactive prompt. open(process, "process.cc") || dir("Couldn't open process.cc"); while () { if (/^\s*ADDCOMMAND\(\s*([A-Za-z_][A-Za-z0-9_]*),/) { add($1); } }