[fpc-devel] Node outputting feature

J. Gareth Moreton gareth at moreton-family.com
Thu Dec 27 20:59:17 CET 2018


 Seems fair.  Users probably wouldn't find much use for it anyway, and it
would only increase the size of the compiler binary.

 I figure though it could be very useful for, say, allowing compilation and
linking with C++ code (if https://www.freepascal.org/future.html is still
accurate!)

 I'm happy to know that you like the idea though.

 Gareth aka. Kit

 On Thu 27/12/18 20:43 , Florian Klämpfl florian at freepascal.org sent:
 Am 23.12.2018 um 17:09 schrieb J. Gareth Moreton: 
 > Hi everyone, 
 > 
 > I've developed a feature to output the compiler-generated node trees
into XML files that could prove useful for 
 > debugging purposes.  While the ability to print the nodes to the
console or a log file already exist, it gets buried 
 > especially if the System unit has its nodes output (the XML file it
generated for me is 4.8 MB in size!). 
 > 
 > I plan to use this to help me debug and analyse code paths for the
"pure" feature that's been on my table for a while, 
 > and it might help with debugging in general.  I figure it's a bit more
convenient than a console output because you can 
 > open the file afterwards in Notepad++ or some other editor that can
handle XML files (which I hope are valid!!) and 
 > hence visually open and close branches. 
 > 
 > Note that it is currently very much a work in progress and hasn't been
fully tested, and reuses a lot of features like 
 > the "printnodeindent" variable and an error message if it fails to
access a file. 
 > 
 > To activate, specify the "-Cm" command line parameter (I wanted either
"-Cn" or "-Ci", for 'node' and 'intermediate' 
 > respectively, but both are taken!).  It's not documented at present,
especially as it might be rejected or changed.  The 
 > XML files have .ppx extensions and are placed in the output directory. 
Let me know how it works out for you. 

 While I like the possibility to output the node tree as xml, I do not
think that it should be exposed to users by 
 command line switches. Instead, if the compiler is compiled with a certain
define, it could generate xml node tree output. 

 _______________________________________________ 
 fpc-devel maillist - fpc-devel at lists.freepascal.org [1] 
 http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[2]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel 

 

Links:
------
[1] mailto:fpc-devel at lists.freepascal.org
[2] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20181227/63100c2a/attachment.html>


More information about the fpc-devel mailing list