da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/***********************************************************************
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* This software is part of the ast package *
34f9b3eef6fdadbda0a846aa4d68691ac40eace5Roland Mainz* Copyright (c) 2000-2009 AT&T Intellectual Property *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* and is licensed under the *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Common Public License, Version 1.0 *
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin* by AT&T Intellectual Property *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* A copy of the License is available at *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Information and Software Systems Research *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* AT&T Research *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Florham Park NJ *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Glenn Fowler <gsf@research.att.com> *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin***********************************************************************/
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * Glenn Fowler
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * AT&T Research
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * C message catalog preprocessor
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"[-?\n@(#)$Id: msgcpp (AT&T Research) 2002-03-11 $\n]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"[+NAME?msgcpp - C language message catalog preprocessor]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"[+DESCRIPTION?\bmsgcpp\b is a C language message catalog preprocessor."
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" It accepts \bcpp\b(1) style options and arguments. \bmsgcpp\b"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" preprocesses an input C source file and emits keyed lines to the"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" output, usually for further processing by \bmsgcc\b(1). \bmsgcc\b"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" output is in the \bgencat\b(1) syntax. Candidate message text is"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" determined by arguments to the \bast\b \b<error.h>\b and"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" \b<option.h>\b functions. The \bmsgcpp\b keyed output lines are:]{"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" [+cmd \acommand\a?\acommand\a is a candidate for \b--??keys\b"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" option string generation. Triggered by"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" \bb_\b\acommand\a\b(int argc,\b in the input.]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" [+def \aname\a \astring\a?\aname\a is a candidate variable with"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" string value \astring\a.]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" [+str \astring\a?\astring\a should be entered into the catalog.]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" [+var \aname\a?If \bdef\b \aname\a occurs then its \astring\a value"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" should be entered into the catalog.]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"[+?The input source file is preprocessed with the \bpp:allpossible\b"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" option on. This enables non-C semantics; all source should first"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" be compiled error-free with a real compiler before running \bmsgcpp\b."
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" The following changes are enabled for the top level files (i.e.,"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" included file behavior is not affected):]{"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" [+(1)?All \b#if\b, \b#ifdef\b and \b#ifndef\b branches"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" are enabled.]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" [+(2)?The first definition for a macro is retained, even when"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" subsequent \b#define\b statements would normally"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" redefine the macro. \b#undef\b must be used to"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" redefine a macro.]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" [+(3)?Macro calls with an improper number of arguments are"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" silently ignored.]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" [+(4)?\b#include\b on non-existent headers are silently"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" ignored.]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" [+(5)?Invalid C source characters are silently ignored.]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"[+?\b\"msgcat.h\"\b is included if it exists. This file may contain macro"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" definitions for functions that translate string arguments. If \afoo\a"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" is a function that translates its string arguments then include the"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" line \b#define \b\afoo\a\b _TRANSLATE_\b in \bmsgcat.h\b or specify"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" the option \b-D\b\afoo\a\b=_TRANSLATE_\b. If \abar\a is a function"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" that translates string arguments if the first argument is \bstderr\b"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" then use either \b#define \b\abar\a\b _STDIO_\b or"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" \b-D\b\abar\a\b=_STDIO_\b.]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"[+?The macro \b_BLD_msgcat\b is defined to be \b1\b. As an alternative to"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" \bmsgcat.h\b, \b_TRANSLATE_\b definitions could be placed inside"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" \b#ifdef _BLD_msgcat\b ... \b#endif\b.]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"\n[ input [ output ] ]\n"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin"[+SEE ALSO?\bcc\b(1), \bcpp\b(1), \bgencat\b(1), \bmsggen\b(1),"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin" \bmsgcc\b(1), \bmsgcvt\b(1)]"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define OMIT "*@(\\[[-+]*\\?*\\]|\\@\\(#\\)|Copyright \\(c\\)|\\\\000|\\\\00[!0-9]|\\\\0[!0-9])*"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register char* s;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register int x;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register int c;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ppop(PP_DEFINE, "ERROR_translate(l,i,c,m)=_TRANSLATE_(m)");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin switch (c)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin switch (c = pplex())
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (x > 0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (x > 0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if ((c = pplex()) != '(' || (c = pplex()) != T_STDERR || (c = pplex()) != ',')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (x > 0)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if ((c = pplex()) == '(' && (c = pplex()) == T_INT && (c = pplex()) == T_ID && (c = pplex()) == ',' && (c = pplex()) == T_CHAR && (c = pplex()) == '*')
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (c != ']')