Every program has a subject domain. In a shipping system, that domain might involve customers, orders, prices, inventory, shippers and so on. In a medical office, it would be patients, records and procedures. For some special programs, however, the domain is programs. These special programs are called metaprograms, and the language a metaprogram is written in is called the metalanguage. The most familiar metaprograms are compilers, virtual machines, IDEs and the like; these are Commonly written in C, C++, Java or C#. A Perl script to check for naming conventions in your Java code is also a metaprogram, with Perl as the metalanguage. Using grep to look for calls to a certain procedure is also metaprogramming, with grep regular expressions as the metalanguage.
展开▼