NOTES
上传用户:upcnvip
上传日期:2007-01-06
资源大小:474k
文件大小:32k
源码类别:

编译器/解释器

开发平台:

C/C++

  1. THE GRAND P2C NOTES FILE:
  2. This file contains notes to myself recording bugs, flaws, and suggested
  3. improvements to p2c.  They have roughly been separated into "old", "older",
  4. and "oldest" groups.  I can't guarantee I'll do any of these.  If you do,
  5. please mail me the diffs so I can incorporate them into the next release.
  6. Thanks!
  7. -- Dave Gillespie
  8.    daveg@csvax.caltech.edu
  9. -----------------------------------------------------------------------------
  10.    The Pascal declaration
  11.       type foo = set of (one, two);
  12.    does not ever write out an "enum { one, two }" declaration in C!
  13. -----------------------------------------------------------------------------
  14.    Handling of comments that trail the ELSE clause of an IF statement
  15.    could use some work.
  16. -----------------------------------------------------------------------------
  17.    Technically speaking, "for byte := min to max do" is legal even
  18.    if min > 255, i.e., the limits only need to be in range if the
  19.    body of the loop executes.  Thus, FOR loops should really use a
  20.    shadow parameter not just when max is the constant 255, but
  21.    whenever min or max are not provably in byte range.
  22. -----------------------------------------------------------------------------
  23.    Have a "-M"-like mode in which FREE is suppressed altogether, useful
  24.    in case p2c crashes because bugs have corrupted malloc's free list.
  25. -----------------------------------------------------------------------------
  26.    For expressions building small-sets whose maximum element is <= 15,
  27.    use "1 << x" instead of "1L << x".
  28. -----------------------------------------------------------------------------
  29.    Handle VAX Pascal VARYING OF CHARs used as the arguments of WITH
  30.    statements.
  31. -----------------------------------------------------------------------------
  32.    Have a p2crc feature which identifies a given named constant as
  33.    being a character, not a string of length 1.  Have an option in
  34.    which this is the default interpretation.
  35. -----------------------------------------------------------------------------
  36.    StringTruncLimit would be helped by expr.c:strmax() interpreting
  37.    sprintf control strings.  For %s, use strmax of the corresponding
  38.    argument.  For %d, use 11, etc.  For %.10s, use min(10, strmax(arg)).
  39.    For %.*s, just use strmax(arg), I guess.
  40.    Have a mode in which such assignments are automatically truncated.
  41.    Perform truncation testing for non-VAR procedure arguments, too.
  42. -----------------------------------------------------------------------------
  43.    In cref.p, the "strappend(buf,#0)" statement translates into
  44.    "strcpy(STR1,buf); strcpy(buf,STR1)" with a warning about a null
  45.    character in a sprintf control string!
  46. -----------------------------------------------------------------------------
  47.    Still having problems where the opening comment of an imported
  48.    module's interface text is copied into the program.
  49. -----------------------------------------------------------------------------
  50.    VAX Pascal features not yet handled:
  51.       [UNSAFE] attribute is only implemented in a few situations.
  52.       [UNBOUND] attribute on a procedure says it doesn't need a static link.
  53.       [TRUNCATE] attribute on a parameter allows optional params w/no default.
  54.       [LIST] attribute on a parameter is like &rest in Lisp.
  55.       Support types like, e.g., [LONG] BOOLEAN.
  56.       Can assign "structurally compatible" but different record types.
  57.       File intrinsics need serious work, especially OPEN.
  58.       If a copy param is [READONLY], don't need to copy it.
  59.       If a procedure is [ASYNCHRONOUS], make all its variables volatile.
  60.       If a procedure is [NOOPTIMIZE], make all its variables volatile.
  61.       Provide a real implementation of BIN function and :BIN read format.
  62.       BIT_OFFSET and CARD intrinsics are not supported.
  63. -----------------------------------------------------------------------------
  64.    Modula-2 features not yet handled:
  65.       Local modules are faked up in a pretty superficial way.
  66.       WORD is compatible with both pointers and CARDINALs.
  67.       WORD parameters are compatible with any word-sized object.
  68.       ARRAY OF WORD parameters are compatible with absolutely anything.
  69.       Improve treatment of character strings.
  70.       Find manuals for real implementations of Modula-2 and implement
  71.          any common language extensions.
  72.       Fix p2c to read system.m2 instead of system.imp automatically.
  73. -----------------------------------------------------------------------------
  74.    Oregon Software Pascal features not yet handled:
  75. procedure noioerror(var f:file);
  76. Built-in.  Sets a flag on an already-open file so that
  77. I/O errors record an error code rather than crashing.
  78. Each file has its own error code.
  79. function ioerror(var f:file) : boolean;
  80. True if an error has occurred in the file.
  81. function iostatus(var f:file) : integer;
  82. The error code, when ioerror was true.
  83. reset and rewrite ignore the third parameter, and allow a fourth
  84. param which is an integer variable that receives a status code.
  85. Without this param, open errors are fatal.  An optional param
  86. may be omitted as in reset(f,'foo',,v);
  87. -----------------------------------------------------------------------------
  88.    In p_search, if a file contains const/var/type/procedure/function
  89.    declarations without any module declaration, surround the entire
  90.    file with an implicit "module <generated-name>; {PERMANENT}" ... "end.".
  91.    This would help the Oregon Software dialect considerably.
  92. -----------------------------------------------------------------------------
  93.    Provide an explicit IncludeFrom syntax for "no include file".
  94.    E.g., "IncludeFrom dos 0".
  95. -----------------------------------------------------------------------------
  96.    In docast, smallsets are converted to large sets of the requested type.
  97.    Wouldn't it be better to convert to a set of 0..31 of the base type?
  98.    This would keep foo([]), where the argument is "set of char", from
  99.    allocating a full 256-bit array for the temporary.
  100. -----------------------------------------------------------------------------
  101.    When initializing a constant variant record or array of same in which
  102.    non-first variants are initialized, create a function to do the
  103.    initialization, plus, for modules w/o initializers, a note to call
  104.    this function.  Another possibility:  Initialize the array as well as
  105.    possible, but leave zeros in the variant parts.  Then the function
  106.    has only to fix up the non-first variant fields.
  107. -----------------------------------------------------------------------------
  108.    Figure out some way to initialize packed array constants, e.g., a short
  109.    macro PACK4(x,y)=(((x)<<4)+(y)) which is used inside the C initializer.
  110.    Alternatively, implement initializer functions as above and use those.
  111. -----------------------------------------------------------------------------
  112.    How about declaring Volatile any variables local to a function which
  113.    are used after the first RECOVER?  GNU also suggests writing the
  114.    statement:  "&foo;" which will have no side effect except to make
  115.    foo essentially volatile, without relying on ANSI features.
  116. -----------------------------------------------------------------------------
  117.    Test the macros for GET, PUT, etc.
  118. -----------------------------------------------------------------------------
  119.    Can the #if 0'd code for strinsert in funcs.c be changed to test
  120.    strcpyleft?
  121. -----------------------------------------------------------------------------
  122.    Even in Ansi mode, p2c seems to be casting Anyptrs into other pointer
  123.    types explicitly.  This is an automatic conversion in Ansi C.
  124. -----------------------------------------------------------------------------
  125.    A Turbo typed constant or VAX initialized variable with a VarMacro
  126.    loses its initializer!
  127. -----------------------------------------------------------------------------
  128.    Test the ability of the parser to recover from common problems such
  129.    as too many/few arguments to a procedure, missing/extra semicolon, etc.
  130.    One major problem has been with undeclared identifiers being used as
  131.    type names.
  132. -----------------------------------------------------------------------------
  133.    Line breaker still needs considerable tuning!
  134. -----------------------------------------------------------------------------
  135.    How about indenting trailing comments analogously to the code:
  136.    Try to indent to column C+(X-Y), where C=original column number,
  137.    X=output indentation, Y=original input indentation.
  138.    Even fancier would be to study all the comment indentations in the
  139.    function or struct decl to discover if most comments are at the same
  140.    absolute indentation; if so, compute the average or minimum amount of
  141.    space preceding the comments and indent the C comments to an analogous
  142.    position.
  143. -----------------------------------------------------------------------------
  144.    After "type foo = bar;" variables declared as type foo are translated
  145.    as type bar.  Ought to assume the user has two names for a reason,
  146.    and copy the distinction into the C code.
  147. -----------------------------------------------------------------------------
  148.    Warn if address is taken of an arithmetic expression like "v1+1".
  149.    Allow user to declare certain bicalls as l-values, e.g., so that
  150.    LSC's topLeft and botRight macros won't generate complaints.
  151. -----------------------------------------------------------------------------
  152.    Consider changing the "language" modes into a set of p2crc files
  153.    which can be included to support the various modes.
  154. -----------------------------------------------------------------------------
  155.    If we exchange the THEN and ELSE parts of an IF statement, be sure
  156.    to exchange their comments as well!
  157. -----------------------------------------------------------------------------
  158.    How about checking for a ".p2crc" file in the user's home directory.
  159. -----------------------------------------------------------------------------
  160.    Store comments in the following situations:
  161.       On the first line of a record decl.
  162.       On the default clause of a CASE statement
  163.         (use same trick as for ELSE clauses).
  164.       On the "end" of a CASE statement.
  165.       On null statements.
  166.       Use stealcomments for, e.g., decl_comments and others.
  167. -----------------------------------------------------------------------------
  168.    Think of other formatting options for format_gen to support.
  169. -----------------------------------------------------------------------------
  170.    Consider converting gratuitous BEGIN/END pairs into gratuitous
  171.    { } pairs.
  172. -----------------------------------------------------------------------------
  173.    The construction "s := copy(s, 1, 3)" converts to a big mess that
  174.    could be simplified to "s[3] = 0".
  175. -----------------------------------------------------------------------------
  176.    Have a mode (and make it the default!) in which declarations are mixed
  177.    if and only if the original Pascal decls were mixed.  Simply store
  178.    a flag in each meaning to mark "mixed-with-preceding-meaning".
  179. -----------------------------------------------------------------------------
  180.    Have a column number at which to put names in variable and typedef
  181.    declarations.  Have another option to choose whether a '*' preceding
  182.    a name should be left- or right-justified within the skipped space:
  183. int     *foo;     or
  184.         int *    foo;
  185. -----------------------------------------------------------------------------
  186.    Support the /*
  187.                 *
  188.                 */ form for multi-line comments.
  189. -----------------------------------------------------------------------------
  190.    Have an indentation parameter for the word "else" by itself on a line.
  191. -----------------------------------------------------------------------------
  192.    Have an option to use C++'s "//" comments when possible.
  193.    (0=never, 1=always, def=only for trailing comments.)
  194. -----------------------------------------------------------------------------
  195.    Allow real comments to come before top-of-file comments like {Language}.
  196. -----------------------------------------------------------------------------
  197.    Teach the line breaker to remove spaces around innermost operators
  198.    if in a crunch.
  199. -----------------------------------------------------------------------------
  200.    Is it possible that the line breaker is losing counts?  A line that
  201.    included lots of invisible parens converted to visible ones was
  202.    allowed to be suspiciously long.
  203. -----------------------------------------------------------------------------
  204.    The notation t^ where t is a text file should convert n's to
  205.    spaces if necessary.
  206. -----------------------------------------------------------------------------
  207.    The assignment and type cast "f4 := tf4(i)" where type
  208.       "tf4 = function (i, j : integer) : str255"
  209.    generates something really weird.
  210. -----------------------------------------------------------------------------
  211.    The conditional expression  strsub(s,1,4) = 'Spam'
  212.    could be translated as      strncmp(s, "Spam", 4)
  213. -----------------------------------------------------------------------------
  214.    Consider an option which generates a "file.p2c" or "module.p2c"
  215.    file, that will in the future be read in by p2c as another p2crc
  216.    type of file, both when the module is re-translated later and when
  217.    it is imported.  This file would contain commands like "NoSideEffects"
  218.    for functions which are found to have this property, etc.
  219. -----------------------------------------------------------------------------
  220.    Extend the "file.log" or "module.log" file to contain a more detailed
  221.    account of the translation, including all notes and warnings which were
  222.    even considered.  For example, ALL calls to na_lsl with non-constant
  223.    shifts would be noted, even if regular notes in this case were not
  224.    requested.  Also, funny transformations along the lines of
  225.    "str[0] := chr(len)" and "ch >= #128" should be mentioned in the log.
  226.    How about a summary of non-default p2crc options and command-line args?
  227. -----------------------------------------------------------------------------
  228.    Create a TypeMacro analogous to FuncMacro, VarMacro, and ConstMacro.
  229.    Should the definition be expressed in C or Pascal notation?  (Yuck---not
  230.    a C type parser!)
  231. -----------------------------------------------------------------------------
  232.    In argument type promotions, should "unsigned char" be promoted to
  233.    "unsigned int"?
  234. -----------------------------------------------------------------------------
  235.    Turbo's FExpand translation is really weird.
  236. -----------------------------------------------------------------------------
  237.    Can we translate Erase(x) to unlink(x)?  (This could just be a FuncMacro.)
  238. -----------------------------------------------------------------------------
  239.    There should be an option that causes a type to be explicitly named,
  240.    even if it would not otherwise have had a typedef name.  Have a mode
  241.    that does this for all pointer types.
  242. -----------------------------------------------------------------------------
  243.    Make sure that the construction:  if blah then {comment} else other
  244.    does not rewrite to if (!blah) other; i.e., a comment in this situation
  245.    should generate an actual placeholder statement.  Or perhaps, a null
  246.    statement written explicitly by the Pascal programmer should always
  247.    produce a placeholder.
  248. -----------------------------------------------------------------------------
  249.    Allow the line breaker to treat a 03 as if it were a 10.  The penalty
  250.    should be enough less than SameIndentPenalty that same-indent cases will
  251.    cause the introduction of parentheses.
  252. -----------------------------------------------------------------------------
  253.    A comment of the form "{------}" where the whole comment is 78, 79 or 80
  254.    columns wide, should be reduced by two to take the larger C comment
  255.    brackets into account.  Also, "{*****}", etc.
  256. -----------------------------------------------------------------------------
  257.    There should be a mode that translates "halt" as "exit(0)", and another
  258.    that translates it as "exit(1)".
  259. -----------------------------------------------------------------------------
  260.    There should be a mode in which strread's "j" parameter is completely
  261.    ignored.  Also, in this mode, don't make a copy of the string being
  262.    read.
  263. -----------------------------------------------------------------------------
  264.    Is there an option that generates an fflush(stdout) after every write
  265.    (not writeln) statement?  It should be easy to do---the code is already
  266.    there to support the prompt statement.
  267. -----------------------------------------------------------------------------
  268.    Check out the Size_T_Long option; size_t appears to be int on most
  269.    machines, not long.
  270. -----------------------------------------------------------------------------
  271.    The type "size_t" should really be made into a separate type, with a
  272.    function to cast to type "size_t".  This function would always do
  273.    the cast unless sizeof(int) == sizeof(long), or unless the expression
  274.    only involves constants and objects or functions of type "size_t".
  275. -----------------------------------------------------------------------------
  276.    Finish the Turbo Pascal features (in the file turbo.imp).
  277. -----------------------------------------------------------------------------
  278.    Are there any ways to take advantage of "x ?: y" in GCC?
  279.    Is it worth using GCC constructor expressions for procedure variables?
  280.    How about generating "volatile" and "const" for suitable functions?
  281.       (doing this in the .h file would be very difficult...)
  282.    Use the "asm" notation of 5.17 to implement var x ['y'] declarations.
  283. -----------------------------------------------------------------------------
  284.    Recognize GCC extensions in pc_expr().  (By the way, remember
  285.    to implement += and friends in pc_expr(), too!)
  286. -----------------------------------------------------------------------------
  287.    Lightspeed C can't handle "typedef char foo[];" which arises from a
  288.    MAXINT-sized array type declaration.
  289. -----------------------------------------------------------------------------
  290.    "Return" and friends are only introduced once.  In code of the form:
  291.       if (!done) { foo(); }  if (!done) { bar(); }
  292.     p2c should, after patching up bar(), check if the foo() branch is
  293.     now also ripe for rearranging.
  294. -----------------------------------------------------------------------------
  295.    Have a global "paranoia" flag.  Default=use current defaults for other
  296.    options.  1=conservative defaults for other options.  0=sloppy defaults
  297.    for other options.
  298. -----------------------------------------------------------------------------
  299.    Rather than just generating a note, have writes of attribute characters
  300.    convert into calls to a "set attribute" procedure, such as nc_sethighlight.
  301.    Is there any way of generalizing this into something useful for
  302.    non-HP-Pascal-workstation users?
  303. -----------------------------------------------------------------------------
  304.    Warn when character constants which are control codes are produced.
  305.    (E.g., arrow keys, etc.)  Also, have an option which deletes all
  306.    highlighting codes from strings being output.
  307. -----------------------------------------------------------------------------
  308.    Think how nice things would be if the arithmetic routines actually
  309.    maintained the distinction between tp_int and tp_integer themselves,
  310.    so that makeexpr_longcast didn't have to second-guess them.
  311. -----------------------------------------------------------------------------
  312.    Importing FS *still* copies its "file support" comment into the importing
  313.    program!
  314. -----------------------------------------------------------------------------
  315.    Should parameterize those last few hard-wired names, such as "P_eoln",
  316.    "LONG_MAX", ... ?
  317. -----------------------------------------------------------------------------
  318.    Check if we need to cache away any more options' values, as we did for
  319.    VarStrings.  How about FoldConstants, SetBits, CopyStructs?
  320. =============================================================================
  321.    Support the "CSignif" option (by not generating C identifiers which
  322.    would not be unique if only that many characters were significant).
  323. -----------------------------------------------------------------------------
  324.    What if a procedure accesses strmax of a var-string parameter of a
  325.    parent procedure?  (Right now this generates a note.)
  326. -----------------------------------------------------------------------------
  327.    Handle full constructors for strings.
  328.    Handle small-array constants.
  329. -----------------------------------------------------------------------------
  330.    Have an option that causes ANYVAR's to be translated to void *'s.  In
  331.    this mode, all uses of ANYVAR variables will need to be cast to the
  332.    proper type, in the function body rather than in calls to the function.
  333. -----------------------------------------------------------------------------
  334.    Handle reading enums.  Add full error checking for reading booleans.
  335.    (And integer subranges?)
  336. -----------------------------------------------------------------------------
  337.    Support the "BigSetConst" option by creating constant arrays just as the
  338.    Pascal compiler does.
  339. -----------------------------------------------------------------------------
  340.    The 2^(N+1) - 2^M method for generating [M..N] is not safe if N is 31.
  341.    If the small-sets we are dealing with encompass the value 31 (== setbits-1)
  342.    then we must use the bitwise construction instead.  (Currently, the
  343.    translator just issues a note.)
  344.    (If N is 31, 2^32 will most likely evaluate to 0 on most machines, which
  345.    is the correct value.  So this is only a minor problem.)
  346. -----------------------------------------------------------------------------
  347.    Big-set constants right now are always folded.  Provide a mechanism
  348.    for defined set constants, say by having a #define with an argument
  349.    which is the name of the temporary variable to use for the set.
  350. -----------------------------------------------------------------------------
  351.    Should we convert NA_LONGWORD-type variants into C casts?
  352. -----------------------------------------------------------------------------
  353.    Are there implementations of strcpy that do not return their first
  354.    argument?  If so, should have an option that says so.
  355. -----------------------------------------------------------------------------
  356.    Handle absolute-addressed variables better.  For  var a[12345]:integer,
  357.    create an initialized int *.  For  var a['foo']:integer, create an int *
  358.    which is initialized to NULL and accessed by a macro which locates the
  359.    symbol the first time the variable is used.
  360. -----------------------------------------------------------------------------
  361.    Handle the idiom, "reset(f, name); open(f);"
  362. -----------------------------------------------------------------------------
  363.    Should have an option that lowercases all file names used in "reset",
  364.    "fixfname", etc.  This should be on by default.
  365. -----------------------------------------------------------------------------
  366.    Add more complete support for conformant arrays.  Specifically, support
  367.    non-GNU compilers by converting variable-sized array declarations into
  368.    pointer declarations with calls to alloca or malloc/free (what if the
  369.    function uses free and contains return statements)?  Also convert
  370.    variable-array references into explicit index arithmetic.
  371. -----------------------------------------------------------------------------
  372.    Have a mode in which the body of a TRY-RECOVER is moved out into
  373.    a sub-procedure all its own, communicating with the parent through
  374.    varstructs as usual, so that the ANSI C warning about what longjmp
  375.    can do to the local variables is avoided.  Alternatively, have an
  376.    option in which all necessary locals are declared volatile when
  377.    setjmps are present.
  378. -----------------------------------------------------------------------------
  379.    If a sub-procedure refers to a parent's variable with the VAX Pascal
  380.    [STATIC] attribute, that variable is declared "static" inside the
  381.    varstruct!  Need to convert it into a varref to a static variable in
  382.    the parent.
  383. -----------------------------------------------------------------------------
  384.    When comparing records and arrays a la UCSD Pascal, should expand
  385.    into an "&&" expression comparing each field individually.  (What about
  386.    variants?  Maybe just compare the first variant, or the tagged
  387.    variant.)  Probably best to write a struct-comparison function the
  388.    first time a given type of struct is compared; that way, the function
  389.    can include a complete if tree or switch statement in the case of
  390.    tagged unions.
  391. -----------------------------------------------------------------------------
  392.    In the checkvarchanged code, take aliasing of VAR parameters into account.
  393.    For example, in "procedure p(s1 : string; var s2 : string)" p2c now avoids
  394.    copying s1 if s1 is not changed within p, but probably should also require
  395.    that s2 not change, or at least that s1 have been read and used before s2
  396.    is changed.
  397. -----------------------------------------------------------------------------
  398.    Provide an option that tells the code generator to provide helpful
  399.    comments of its own when generated code may be obscure.
  400. =============================================================================
  401.    Compact the various data structures.  In particular, typical runs
  402.    show the majority of memory is used by Meanings and Symbols for
  403.    global and imported objects.
  404. -----------------------------------------------------------------------------
  405.    The program wastes memory.  Find ways to reduce memory usage, and to
  406.    avoid leaving dead records on the heap.  (Garbage collection?  Yuck!)
  407.    (Maybe GC between each function declaration would be okay.)
  408. -----------------------------------------------------------------------------
  409.    Assign better names to temporaries.  Also, could avoid making redundant
  410.    temporaries by generating a unique temporary every time one is needed,
  411.    then crunching them down at the end just before the declarations are
  412.    written out.  Each temporary would maintain a list of all the other
  413.    temporaries (of the same type) with which it would conflict.  (This
  414.    would avoid the current method's waste when several temps are created,
  415.    then most are cancelled.)  Also, note that char STR1[10], STR2[20] can
  416.    be considered type-compatible and merged into STR[20].
  417. -----------------------------------------------------------------------------
  418.    Don't generate _STR_xxx structure names if they aren't forward-referenced.
  419. -----------------------------------------------------------------------------
  420.    Can optimize, e.g., "strpos(a,b) = 0" to a call to strstr() or strchr(),
  421.    even though these ANSI functions are not Pascal-like enough to use in 
  422.    the general case.
  423. -----------------------------------------------------------------------------
  424.    Complete the handling of "usecommas=0" mode.
  425. -----------------------------------------------------------------------------
  426.    Optimize "s := strltrim(s)", "s := strrtrim(s)", and both together.
  427. -----------------------------------------------------------------------------
  428.    Convert "(ch < 'a') or (ch > 'z')" to "!islower(ch)", and so on.
  429.    Also do "!islower(ch) && !isupper(ch)" => "!isalpha(ch)", etc.
  430. -----------------------------------------------------------------------------
  431.    Find other cases in which to call mixassignments().
  432. -----------------------------------------------------------------------------
  433.    The sequence:   sprintf(buf + strlen(buf), "...", ...);
  434.                    sprintf(buf + strlen(buf), "...", ...);
  435.    could be changed to a single sprintf.
  436.    Also, "sprintf(temp, "...%s", ..., buf); strcpy(buf, temp); (above);"
  437.    could be crunched down.  (This comes from strinsert, then strappend.)
  438. -----------------------------------------------------------------------------
  439.    If there is only one assignment to a structured function's return
  440.    variable, and that assignment is at the very end and assigns a local
  441.    variable to the return variable, then merge the variables.
  442.    (Example: name_list in netcmp's datastruct module.  RET_name_list
  443.    should be renamed to namestr.)
  444. -----------------------------------------------------------------------------
  445.    Have an option that causes if-then-else's to be replaced by ? :'s in
  446.    certain cases.  If the branches of the if are either both returns or
  447.    both assignments to the same variable, which has no side effects, and
  448.    if the whole conditional will be simple enough to fit on one line when
  449.    printed, then the ? : transformation is okay.
  450. -----------------------------------------------------------------------------
  451.    Have an option that makes limited use of variable initialization.
  452.    If the first statement of a function is an assignment of a constant
  453.    to a local variable, then the assignment is changed to an initialization.
  454.    (Non-constant initializers are probably too hard to check for safety.)
  455.    Should variables with initializers still be mixed?
  456.    (Example: valid_node_class in netcmp's datastructs module.)
  457.    File variable initialization is an especially good application for this.
  458. -----------------------------------------------------------------------------
  459.    Have an option that finds cases of multiple assignment.  For example:
  460.       a := x; b := x;   =>  a = b = x;
  461.       a := x; b := a;   =>  a = b = x;
  462.    (provided the objects in question have the same type).
  463. -----------------------------------------------------------------------------
  464.    Need an option that causes $if$'s to change to #if's, instead of being
  465.    evaluated at translation-time.  (This is *really hard* in general;
  466.    do it for some common cases, such as entire statements being commented
  467.    out, or fields being commented out of records.)
  468. -----------------------------------------------------------------------------
  469.    Have an option that prevents generation and inclusion of .h files for
  470.    modules; instead, each module would contain extern declarations for
  471.    the things it imports.  (Only declare names that are actually used---
  472.    this means the declarations will have to be emitted on a procedure-by-
  473.    procedure basis.)
  474. -----------------------------------------------------------------------------
  475.    Extend the ExpandIncludes option to compile include files as separate
  476.    stand-alone C modules.  The hard part is warning when the new module
  477.    uses a procedure which was declared static in an earlier C module.
  478.    Remember to re-emit all the proper #include's at the beginning.
  479.    Anything else?
  480. -----------------------------------------------------------------------------
  481.    Consider an option where the variables in a varStruct are made into
  482.    globals instead, or into parameters if there are few of them.
  483. -----------------------------------------------------------------------------
  484.    Perform a flow analysis after everything else is done; use this to
  485.    eliminate redundant checks, e.g., for nil pointers or non-open or
  486.    already-open files.  Also eliminate redundant "j" variables for
  487.    strwrite statements.
  488. -----------------------------------------------------------------------------
  489.    Need a method for simple pattern matching predicates in FuncMacros.
  490.    For example, allow special translations of functions where a given
  491.    argument is a known constant, or known to be positive, or two
  492.    arguments are the same, etc.
  493. -----------------------------------------------------------------------------
  494.    Have some way to provide run-time templates for fixblock/fixexpr-like
  495.    applications.  The user enters two C expressions A and B, possibly including
  496.    Prolog-like logical variables.  If fixexpr sees an expression matching A,
  497.    it rewrites it into the form of B.
  498. -----------------------------------------------------------------------------
  499.    Have an option to cause selected Pascal procedures or functions to be
  500.    expanded in-line.  Do this either by generating the keyword "inline",
  501.    or by doing the expansion in the translator.
  502. -----------------------------------------------------------------------------
  503.    Technically speaking, strcmp shouldn't be used to compute < and > for
  504.    strings on a machine with signed chars.  Should we care?
  505. -----------------------------------------------------------------------------
  506.    Have an option for creating a "display" of LINK pointers local to a
  507.    function.  Should only create such pointers for static levels which are
  508.    referred to in the function body.
  509. -----------------------------------------------------------------------------