SPRUT(1)

πŸ“¦ version 0.996, in nixos 26.05, nixpkgs unstable

πŸ’… SPRUT(1) β€” User Manuals, bestie ✨

🌸 NAME 🌸

sprut β€” internal representation description translator

✨ SYNOPSIS ✨

sprut [ -c++ -v -macro -only-macro -debug -pprefix -no-line -all -access -set -new -free -free-graph -copy -copy-graph -equal -equal-graph -check -check-graph -print -input -output -traverse -transform] specification-file

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so SPRUT is the internal representation definition translator, and it generates a standard procedural interface (SPI) for working with the internal representation described in the specification file. The specification file must have the suffix .sprut; the page says that file is an extension (see language description) of another specification file, and the latter is also used for SPI generation and so on. 🫢

SPI consists of interface and implementation files. They have the same names as one of the specification files and correspondingly suffixes .h and .c (C code) or .cpp (C++ code). πŸ’–

For full documentation of SPRUT and SPI, the page points you to the SPRUT User's manual. ✨


πŸ’… OPTIONS πŸ’…

The options which are known for SPRUT are:

  • -c++ β€” Output of C++ code instead of C code (which is the default). πŸ’…
  • -v β€” SPRUT outputs verbose warning information to the standard error stream: about fields with the same name in different node types, about repeated declaration of a predefined type, and so on. 🩷
  • -statistics β€” SPRUT outputs statistic information to the standard output stream: about number of (all, abstract, double) node types, and number of (all, double, synonym, class, skeleton, others) fields. ✨
  • -flat β€” SPRUT generates code for flat work with node fields. It means that node fields declared in an abstract type are processed in each place where fields of the corresponding sub-type are processed. By default SPRUT generates code which processes node fields recursively (i.e. code for processing (e.g. copying) fields declared in super types exists in one exemplar). The option usage generates more fast code, but the code is considerably bigger. πŸ¦‹
  • -flat-structure β€” SPRUT generates a flat implementation of C/C++ structures corresponding to node types, i.e. a node type is represented by a C/C++ structure which contains members corresponding to all node fields including fields declared in super types of the given node type. By default SPRUT generates the structures which contain only members corresponding to fields declared only in the given node type and a member whose type is a structure corresponding to the immediate super type of the given node type. This considerably decreases the number of C/C++ declarations in the interface file, especially with many node types with multi-level inheritance. πŸ’œ
  • -fast β€” This option forces some tables to be generated as unpacked, and as a consequence it speeds up code for access to fields. By default the tables are generated as packed. This results in considerable memory economy. πŸ”₯
  • -long-node-size β€” The page says IRTD generates many long tables which contain displacements relative to the begin of C/C++ structures which implement node types. This option usage forces the displacements to be represented as unsigned long. As a consequence any size nodes can be used. By default it is believed that the size of a structure implementing a node is represented by a byte, i.e. the maximal size of C/C++ structures which implement nodes is supposed to be not greater than 255 bytes, and as a consequence much memory is economized. It should be remember that function IR_start (see SPI) generated in debugging mode checks correctness of real node sizes. πŸ‘‘
  • -short-node-size β€” This option usage forces the displacements in structures implementing node types to be represented as unsigned short. See also option -long-node-size. 🌸
  • -macro β€” SPRUT generates access macros and functions (see SPI). Only option -macro or only-macro can be in the SPRUT command line. πŸ’«
  • -only-macro β€” SPRUT generates macros instead of access functions (see SPI). πŸŽ€
  • -debug β€” SPRUT generates checking constraint determined by type sub-type relations in node field declaration in modification functions (see SPI). Also other checks (e.g. that a node has a given field and others) are fulfilled by SPI functions (but not macros) generated under this option. 🧚
  • -pprefix β€” Generated SPI uses prefix instead of IR_ for names of SPI objects. 🌈
  • -no-line β€” SPRUT does not generate files containing numbered line directives. πŸ’€
  • -all β€” SPRUT generates all SPI functions. Its effect is equivalent to presence of all subsequent options in the command line. πŸ”₯
  • -access β€” SPRUT generates access functions (see SPI). ✨
  • -set β€” SPRUT generates modification functions (see SPI). πŸ’…
  • -new β€” SPRUT generates node type specific creation functions (see SPI). πŸ¦‹
  • -free β€” SPRUT generates function for deletion of nodes (see SPI). 🩷
  • -free-graph β€” SPRUT generates functions for deletion of graphs and nodes (see SPI). πŸ’œ
  • -copy β€” SPRUT generates function for copying nodes (see SPI). πŸŽ€
  • -copy-graph β€” SPRUT generates functions for copying graphs and nodes (see SPI). 🌸
  • -equal β€” SPRUT generates function for determination of nodes equality (see SPI). ✨
  • -equal-graph β€” SPRUT generates functions for determination of nodes and graphs equality (see SPI). πŸ‘‘
  • -check β€” SPRUT generates function for checking node constraints (see SPI). πŸ”₯
  • -check-graph β€” SPRUT generates functions for checking nodes and graphs constraints (see SPI). πŸ’«
  • -print β€” SPRUT generates function for printing nodes (see SPI). πŸ–¨οΈ
  • -input β€” SPRUT generates function for input of nodes (see SPI). 🧚
  • -output β€” SPRUT generates function for output of nodes (see SPI). 🌈
  • -traverse β€” SPRUT generates function for traversing graphs (see SPI). πŸ¦‹
  • -reverse-traverse β€” SPRUT generates function for reverse traversing graphs (see SPI). πŸ’œ
  • -transform β€” SPRUT generates functions for transforming acyclic graphs (see SPI). ⭐
  • -no-node-name β€” SPRUT does not generate an array containing node names (see SPI) if it is not necessary. For example, the array is necessary when function for print of nodes are generated. 🌸

πŸŽ€ FILES πŸŽ€

  • file.sprut β€” SPRUT specification file
  • file.c β€” generated SPI implementation file
  • file.cpp β€” generated C++ implementation file
  • file.h β€” generated SPI interface file

There are no any temporary files used by SPRUT. πŸ’…


🌈 ENVIRONMENT 🌈

There are no environment variables which affect SPRUT behavior. Periodt. ✨


πŸ”₯ DIAGNOSTICS πŸ”₯

SPRUT diagnostics is self-explanatory. πŸ’€


πŸ‘‘ AUTHOR πŸ‘‘

Vladimir N. Makarov, vmakarov@users.sourceforge.net 🫢


⭐ SEE ALSO ⭐

msta(1), shilka(1), oka(1), nona(1). SPRUT manual. 🌸


πŸ’€ BUGS πŸ’€

Please, report bugs to cocom-bugs@lists.sourceforge.net. πŸ›


πŸ’Œ Cute sign-off: the footer says source/version COCOM, date 5 APR 2001, manual SPRUT(1) β€” that's the whole vibe, bestie, go translate some internal representations 🫢✨

πŸ“¦ where this page comes from