SPRUT(1)
π 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 saysIRTDgenerates 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 asunsigned 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 than255bytes, and as a consequence much memory is economized. It should be remember that functionIR_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 asunsigned short. See also option-long-node-size. πΈ-macroβ SPRUT generates access macros and functions (see SPI). Only option-macrooronly-macrocan 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 usesprefixinstead ofIR_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 filefile.cβ generated SPI implementation filefile.cppβ generated C++ implementation filefile.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
- nixos 26.05: cocom 0.996
- nixpkgs unstable: cocom 0.996
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms