2018-12-29 17:56:29 -08:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
## Distributed under the CC0 public domain license.
|
2019-08-14 09:20:54 -07:00
|
|
|
## By Alison Watson. Attribution is encouraged, though not required.
|
2018-12-29 17:56:29 -08:00
|
|
|
## <https://creativecommons.org/publicdomain/zero/1.0/legalcode>
|
|
|
|
## TreeGen: Generates the glossary files for classes.
|
2019-08-12 19:19:01 -07:00
|
|
|
## Example usage:
|
2019-08-14 02:27:32 -07:00
|
|
|
## tools/treegen.rb \
|
2019-08-12 19:19:01 -07:00
|
|
|
## '/mnt/g/Archive/gzdoom-g4.1.0/wadsrc/static/zscript/**/*.zs' \
|
|
|
|
## 4.1.0
|
2018-12-29 17:56:29 -08:00
|
|
|
|
|
|
|
require "./tools/zsclasstree.rb"
|
|
|
|
|
2019-08-14 02:27:32 -07:00
|
|
|
FILES = ARGV.shift
|
|
|
|
VERSION = ARGV.shift
|
2018-12-29 17:56:29 -08:00
|
|
|
|
2019-08-14 02:27:32 -07:00
|
|
|
siphon = ClassSiphon.new FILES
|
2018-12-29 17:56:29 -08:00
|
|
|
|
2019-09-10 02:53:21 -07:00
|
|
|
file = open "glossary/Classes.md", "wb"
|
2019-08-14 02:27:32 -07:00
|
|
|
file.puts <<_end_
|
2018-12-29 17:56:29 -08:00
|
|
|
# Classes
|
|
|
|
|
2019-08-14 02:27:32 -07:00
|
|
|
Here is a full tree of all classes in ZScript as of GZDoom #{VERSION}. There
|
|
|
|
are #{siphon.classes.count + 1} classes total.
|
2018-12-29 17:56:29 -08:00
|
|
|
|
|
|
|
```
|
|
|
|
Object
|
|
|
|
_end_
|
|
|
|
|
2019-08-14 02:27:32 -07:00
|
|
|
siphon.print_classes file
|
2018-12-29 17:56:29 -08:00
|
|
|
|
2019-08-14 02:27:32 -07:00
|
|
|
file.puts <<_end_
|
2018-12-29 17:56:29 -08:00
|
|
|
```
|
|
|
|
|
|
|
|
<!-- EOF -->
|
|
|
|
_end_
|
|
|
|
|
2019-09-10 02:53:21 -07:00
|
|
|
file = open "glossary/Structures.md", "wb"
|
2019-08-14 02:27:32 -07:00
|
|
|
file.puts <<_end_
|
2018-12-29 17:56:29 -08:00
|
|
|
# Structures
|
|
|
|
|
2019-08-14 02:27:32 -07:00
|
|
|
Here is a full list of all structures in ZScript as of GZDoom #{VERSION}.
|
|
|
|
There are #{siphon.structs.count} structures total. Note that some of these
|
|
|
|
are merely implementation details and should not be used in code.
|
2018-12-29 17:56:29 -08:00
|
|
|
|
|
|
|
```
|
|
|
|
Struct
|
|
|
|
_end_
|
|
|
|
|
2019-08-14 02:27:32 -07:00
|
|
|
siphon.print_structs file
|
2018-12-29 17:56:29 -08:00
|
|
|
|
2019-08-14 02:27:32 -07:00
|
|
|
file.puts <<_end_
|
2018-12-29 17:56:29 -08:00
|
|
|
```
|
|
|
|
|
|
|
|
<!-- EOF -->
|
|
|
|
_end_
|
|
|
|
|
|
|
|
## EOF
|