How to use preprocess_file in compiler.py #205
-
Currently I'm using a perl script alone to process the systemRDL file with embedded perl, and then using the generated systemRDL file to pass it to the compile_file function, I found that the compiler provides the preprocess_file function, may I ask what to do with this function, I found that it's return value is a class. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The From that object, you can extract the preprocessed text via: |
Beta Was this translation helpful? Give feedback.
The
RDLCompiler.preprocess_file()
method returns aFileInfo
object which contains information about the preprocessed source code.See the API reference here: https://systemrdl-compiler.readthedocs.io/en/stable/api/compiler.html#systemrdl.compiler.FileInfo
From that object, you can extract the preprocessed text via:
FileInfo.preprocessed_text