Dumping Parser Data lazarus / 64-FPC development ---------------------------------------------------------------------- charles · 2023-12-23 15:11 I'm looking to automate analysis of some pascal programs, and step 1 is obtaining some structured representation of the programs. Looking through the compiler manual, it doesn't seem like there's already a way to dump AST information from the compiler - it almost looks like the compiler doesn't use syntax trees at all (after my cursory dig through the source). I'm sure I'm missing something though; are there any places I should start looking for adding in an AST dump flag to the compiler? ---------------------------------------------------------------------- Jonas Maebe · 2023-12-23 15:55 The -vp command line option dumps the node tree in a file called tree.log ---------------------------------------------------------------------- charles · 2023-12-23 16:18 That seems very promising! A few simple programs I've given it work well, I'll have to do some work to interpret the output but I can see where most of the data is represented. One question though - when compiling a simple "Hello World" program: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program HelloWorld; begin    writeln('Hello World!')end. no string constants are included in the log file. However, something like Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i x := 5 does include the int constant in the log file. Are strings lost after parsing or is there another way I can retrieve them?