|
|
00001 #ifndef substitute_MODULE 00002 #define substitute_MODULE 00003 00004 /* 00005 * Copyright (c) 1989 by the Massachusetts Institute of Technology. 00006 * For copying and distribution information, see the file 00007 * "mit-copyright.h". 00008 * 00009 * Modified for jwgc by Daniel Henninger. 00010 */ 00011 00012 #include "mit-copyright.h" 00013 00014 #include "new_string.h" 00015 00016 /* 00017 * string substitute(string (*lookup)(string); string text) 00018 * Effects: returns the result of expanding all variable 00019 * references in text using lookup. Example: 00020 * "test $foo.$bar baz" would be translated to 00021 * "text <foo>.<bar> baz" where "<foo>" is the value of 00022 * lookup("foo") and "<bar>" is the value of lookup("bar"). 00023 * Variables are case sensitive and have the form 00024 * {identifier_char}+ where identifier_char is defined 00025 * in lexer.h by is_identifier_char. $(foo) and 00026 * ${foo} are alternate forms for $foo. In particular, 00027 * ${foo}bar is a reference to foo followed by "bar" while 00028 * $foobar is a reference to foobar. Incomplete variable 00029 * references like $(foo bar are displayed as if they 00030 * were not variable references. To allow quoting, "$$" 00031 * is translated to "$". Only the first 00032 * MAX_IDENTIFIER_LENGTH characters of an identifier are 00033 * significant. The strings returned by lookup are not 00034 * modified in any way or freed. 00035 */ 00036 00037 extern string substitute(); 00038 00039 #endif
Last updated at Tue Dec 18 21:07:42 PST 2007. | This site and project hosted by... |