ipl2py#
- ipl2py.parse(content: str, include_comments=True, cache=False) Tree #
Parse IPL code into a parse tree.
- Parameters:
content – The IPL source file as a string. True by default.
include_comments – Include comments in the tree.
cache – Cache the parser generated by Lark. False by default.
- ipl2py.compile(content: str, include_comments=True, print_parse_tree=False, print_ast=False, pretty=False) str #
This function takes a string representing a raw IPL file and compiles it into Python code that is compatible with the RMS Python environment. By default it includes comments from the original IPL file and it tries its best to place these in the same semantic position. It can also receive some arguments to print the parse tree as well.
- Parameters:
content – A string containing the raw IPL file
include_comments – Preserve comments from the origin source. True by default.
print_parse_tree – Print the full parse tree before it’s converted into an AST. False by default.
print_ast – Print the AST. False by default.
pretty – Prettify the print of the parse tree. Only relevant if
print_parse_tree
or ``print_ast``is set to True. False by default.