Author Topic: ParseTS - Static TorqueScript documentation (and other stuff)  (Read 890 times)

ParseTS



ParseTS will automatically build documentation for your project, sort of like Javadoc. Currently the output looks like this:



Usage:

Code: [Select]
$ parsets docs <PATH>

Where <PATH> is either a file or a directory. The output should now be in dist/parsets-docs.

In order to add a documentation comment to a function, use the following style:

Code: [Select]
//| This function does X
function doX() {
}

Installing:

  • Install GHC (tested against GHC 7.8, I recommend MinGHC if you're on Windows)
  • Check out the docgen branch from GitHub
  • $ cabal install

You can also run directly from the source directory using the cabal run command.

From the title I was hoping it would be something like an open source 3rd party torquescript parser->compiler, but this is cool also!

From the title I was hoping it would be something like an open source 3rd party torquescript parser->compiler, but this is cool also!
It does actually contain a full TorqueScript parser, but I don't want to commit to an external interface to it yet. The plan is to first make the parser itself (pretty much done), then build a bunch of stuff based on it (like the documentation stuff), and then expose the parser itself once the dust has settled down. Of course, it's all open source so feel free to do whatever you want, just prepare for a lot of breakage later if you use any of the internals.

I meant to emphasize on the compiler part, but yeah, I really like the looks of the parser. I have my own written in C++ but since stuff like bison/flex can generate parsers that work faster than what normally can be written manually, it's a little discouraging to use it with anything beyond just tinkering with it. That and the fact that it would probably be better to have it in a higher level language, too. Maybe one day I'll use it with LLVM or something.

But anyways, the effort really shines through in the parser. Nice work!