Pretty-prints a class definition.




list() pretty-prints the whole of the loaded AST while list(className) lists a class and its children. It keeps all annotations and comments intact but strips out any comments and normalizes white-space.

list(className,interfaceOnly=true) works on functions and pretty-prints only the interface parts (annotations and protected sections removed). String-comments on public variables are kept.

If the specified class does not exist (or is not a function when interfaceOnly is given), the empty string is returned.


function list
  input TypeName class_ = $Code(AllLoadedClasses);
  input Boolean interfaceOnly = false;
  input Boolean shortOnly = false "only short class definitions";
  input ExportKind exportKind = ExportKind.Absyn;
  output String contents;
end list;


Revision Author Comment
16124 sjoelund.se Added replaced exportAsCode option with exportKind (selecting which kind of unparsing to use)
10796 sjoelund.se Added shortOnly option
10756 sjoelund.se Added interfaceOnly option

Generated at 2022-06-29T00:33:29Z by OpenModelicaOpenModelica 1.20.0~dev-170-g821fd8f using GenerateDoc.mos