.OpenModelica.Scripting.list

Information

Pretty-prints a class definition.

Syntax

list(Modelica.Math.sin)
list(Modelica.Math.sin,interfaceOnly=true)

Description

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.

Interface

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;

Revisions

RevisionAuthorComment
16124sjoelund.seAdded replaced exportAsCode option with exportKind (selecting which kind of unparsing to use)
10796sjoelund.seAdded shortOnly option
10756sjoelund.seAdded interfaceOnly option

Generated at 2024-04-19T18:16:02Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos