Skip to content

Capturing RDL syntax errors #106

Closed Answered by amykyta3
hcadavid asked this question in Q&A
Discussion options

You must be logged in to vote

Correct that by default, the compiler prints all messages to the stderr stream.
However if you need to, you can override the MessagePrinter class that is used when creating the RDLCompiler object.
See the message_printer argument to the compiler's constructor: https://systemrdl-compiler.readthedocs.io/en/latest/api/compiler.html#systemrdl.RDLCompiler

Extend the MessagePrinter class and customize with your own implementation.

You can look at the default MessagePrinter implementation for more guidance on how it works: https://github.com/SystemRDL/systemrdl-compiler/blob/master/systemrdl/messages.py#L41
The src_ref object that is passed into the printer will provide file and line number cont…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@amykyta3
Comment options

Answer selected by amykyta3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants