📄 notes
字号:
----------------------------------------------------------------------------- Have a column number at which to put names in variable and typedef declarations. Have another option to choose whether a '*' preceding a name should be left- or right-justified within the skipped space: int *foo; or int * foo;----------------------------------------------------------------------------- Support the /* * */ form for multi-line comments.----------------------------------------------------------------------------- Have an indentation parameter for the word "else" by itself on a line.----------------------------------------------------------------------------- Allow real comments to come before top-of-file comments like {Language}.----------------------------------------------------------------------------- Teach the line breaker to remove spaces around innermost operators if in a crunch.----------------------------------------------------------------------------- Is it possible that the line breaker is losing counts? A line that included lots of invisible parens converted to visible ones was allowed to be suspiciously long.----------------------------------------------------------------------------- The notation t^ where t is a text file should convert \n's to spaces if necessary.----------------------------------------------------------------------------- The assignment and type cast "f4 := tf4(i)" where type "tf4 = function (i, j : integer) : str255" generates something really weird.----------------------------------------------------------------------------- The conditional expression strsub(s,1,4) = 'Spam' could be translated as strncmp(s, "Spam", 4)----------------------------------------------------------------------------- Consider an option which generates a "file.p2c" or "module.p2c" file, that will in the future be read in by p2c as another p2crc type of file, both when the module is re-translated later and when it is imported. This file would contain commands like "NoSideEffects" for functions which are found to have this property, etc.----------------------------------------------------------------------------- Extend the "file.log" or "module.log" file to contain a more detailed account of the translation, including all notes and warnings which were even considered. For example, ALL calls to na_lsl with non-constant shifts would be noted, even if regular notes in this case were not requested. Also, funny transformations along the lines of "str[0] := chr(len)" and "ch >= #128" should be mentioned in the log. How about a summary of non-default p2crc options and command-line args?----------------------------------------------------------------------------- Create a TypeMacro analogous to FuncMacro, VarMacro, and ConstMacro. Should the definition be expressed in C or Pascal notation? (Yuck---not a C type parser!)----------------------------------------------------------------------------- In argument type promotions, should "unsigned char" be promoted to "unsigned int"?----------------------------------------------------------------------------- Turbo's FExpand translation is really weird.----------------------------------------------------------------------------- Can we translate Erase(x) to unlink(x)? (This could just be a FuncMacro.)----------------------------------------------------------------------------- There should be an option that causes a type to be explicitly named, even if it would not otherwise have had a typedef name. Have a mode that does this for all pointer types.----------------------------------------------------------------------------- Make sure that the construction: if blah then {comment} else other does not rewrite to if (!blah) other; i.e., a comment in this situation should generate an actual placeholder statement. Or perhaps, a null statement written explicitly by the Pascal programmer should always produce a placeholder.----------------------------------------------------------------------------- Allow the line breaker to treat a \003 as if it were a \010. The penalty should be enough less than SameIndentPenalty that same-indent cases will cause the introduction of parentheses.----------------------------------------------------------------------------- A comment of the form "{------}" where the whole comment is 78, 79 or 80 columns wide, should be reduced by two to take the larger C comment brackets into account. Also, "{*****}", etc.----------------------------------------------------------------------------- There should be a mode that translates "halt" as "exit(0)", and another that translates it as "exit(1)".----------------------------------------------------------------------------- There should be a mode in which strread's "j" parameter is completely ignored. Also, in this mode, don't make a copy of the string being read.----------------------------------------------------------------------------- Is there an option that generates an fflush(stdout) after every write (not writeln) statement? It should be easy to do---the code is already there to support the prompt statement.----------------------------------------------------------------------------- Check out the Size_T_Long option; size_t appears to be int on most machines, not long.----------------------------------------------------------------------------- The type "size_t" should really be made into a separate type, with a function to cast to type "size_t". This function would always do the cast unless sizeof(int) == sizeof(long), or unless the expression only involves constants and objects or functions of type "size_t".----------------------------------------------------------------------------- Finish the Turbo Pascal features (in the file turbo.imp).----------------------------------------------------------------------------- Are there any ways to take advantage of "x ?: y" in GCC? Is it worth using GCC constructor expressions for procedure variables? How about generating "volatile" and "const" for suitable functions? (doing this in the .h file would be very difficult...) Use the "asm" notation of 5.17 to implement var x ['y'] declarations.----------------------------------------------------------------------------- Recognize GCC extensions in pc_expr(). (By the way, remember to implement += and friends in pc_expr(), too!)----------------------------------------------------------------------------- Lightspeed C can't handle "typedef char foo[];" which arises from a MAXINT-sized array type declaration.----------------------------------------------------------------------------- "Return" and friends are only introduced once. In code of the form: if (!done) { foo(); } if (!done) { bar(); } p2c should, after patching up bar(), check if the foo() branch is now also ripe for rearranging.----------------------------------------------------------------------------- Have a global "paranoia" flag. Default=use current defaults for other options. 1=conservative defaults for other options. 0=sloppy defaults for other options.----------------------------------------------------------------------------- Rather than just generating a note, have writes of attribute characters convert into calls to a "set attribute" procedure, such as nc_sethighlight. Is there any way of generalizing this into something useful for non-HP-Pascal-workstation users?----------------------------------------------------------------------------- Warn when character constants which are control codes are produced. (E.g., arrow keys, etc.) Also, have an option which deletes all highlighting codes from strings being output.----------------------------------------------------------------------------- Think how nice things would be if the arithmetic routines actually maintained the distinction between tp_int and tp_integer themselves, so that makeexpr_longcast didn't have to second-guess them.----------------------------------------------------------------------------- Importing FS *still* copies its "file support" comment into the importing program!----------------------------------------------------------------------------- Should parameterize those last few hard-wired names, such as "P_eoln", "LONG_MAX", ... ?----------------------------------------------------------------------------- Check if we need to cache away any more options' values, as we did for VarStrings. How about FoldConstants, SetBits, CopyStructs?============================================================================= Support the "CSignif" option (by not generating C identifiers which would not be unique if only that many characters were significant).----------------------------------------------------------------------------- What if a procedure accesses strmax of a var-string parameter of a parent procedure? (Right now this generates a note.)----------------------------------------------------------------------------- Handle full constructors for strings. Handle small-array constants.----------------------------------------------------------------------------- Have an option that causes ANYVAR's to be translated to void *'s. In this mode, all uses of ANYVAR variables will need to be cast to the proper type, in the function body rather than in calls to the function.----------------------------------------------------------------------------- Handle reading enums. Add full error checking for reading booleans. (And integer subranges?)-----------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -