RR – Railroad Diagram Generator
github.com
github.com
Like many accompanying tools, pikchr comes from the hand of SQLite creater Dr. Richard Hipp (and anyone can guess what that means for the quality of the program).
Now pikchr has become my "goto" tool for professional looking diagrams and sketches of all kinds. With its intuitive syntax grammar it is quick to learn - you should give it a try if not yet done!
Full exhaustive list is below (though it's missing Fossil):
The diagrams for the H2 database [1], and Apache Jackrabbit Oak [2], do have links. (I wrote the generator for those.)
[1] https://h2database.com/html/grammar.html [2] https://jackrabbit.apache.org/oak/docs/query/grammar-sql2.ht...
This means that there are sometimes blatant bugs and ambiguities. Test your AST assumptions against a real SQLite!
Syntax Diagram Generator https://lukaslueg.github.io/macro_railroad_wasm_demo/
GrammKit https://dundalek.com/grammkit/
DrawGrammar https://jacquev6.github.io/DrawGrammar/
There are other kind of text-to-diagram tools which I occasionally find (usually here on HN) and add in this list https://xosh.org/text-to-diagram/
<style>
@media (prefers-color-scheme: dark) {
.line {
stroke: #eed;
}
rect, circle, polygon {
fill: #eed;
stroke: #eed;
}
}
</style>
is valid SVG, and would fix the issue.I think it’s a great tool!
Nice story: around 2016 the OP project was not yet open source, just a web app. Cockroach Labs wanted to automate using it into their docs build. I asked and was approved to donate a fairly good amount to the author. My argument was that that amount of money, though high, was less than my time to add a few other features we wanted (BNF pre-processing things).
I'd love to read an article with an overview of libraries like these. There seem to be many and it would be neat to see them compared side-by-side on input syntax, output format, configuration, results, tools used, etc.
if_stmt:
| 'if' named_expression ':' block elif_stmt
| 'if' named_expression ':' block [else_block]
elif_stmt:
| 'elif' named_expression ':' block elif_stmt
| 'elif' named_expression ':' block [else_block]
else_block:
| 'else' ':' block
Whilst I can read this, I need to jump around to find the definitions of labels, and it requires mental effort to remember how each label was defined. The effort would be greater for a more complex example.The diagram essentially avoids this by inlining the definitions of `elif_stmt` and `else_block`. This makes it much faster for me to read.
if_stmt:
'if' named_expression ':' block
('elif' named_expression ':' block)*
('else' ':' block)?
...which is no more complex than the original diagram, and reads much easily at least for me. In fact, that "original grammar" does support the equivalent syntax because it's a direct input to Python's PEG code generator. I don't know why `if_stmt` was described in that way, but such duplication is often done for readability and hardly surprising.I had no trouble reading the ones in the back of my Pascal book when I was a 16-year-old high school student.
I certainly did not understand formal grammars back then. I didn't even know what a formal language was. (I was using one, but that doesn't mean I understood that I was.)
https://stackoverflow.com/questions/796824/tool-for-generati...
I have to say I really detest SO for making this a generic rule. These questions are often top Google results and perhaps all the answers were good 3 year ago but it's missing up to date info because it's locked.
This was more about health and safety, being able to schedule maintenance etc and ensure electric rail turned off.
Fascinating to discover that the "current" (HEAD) version of the documents for certain parts of the track were from the original Victorian era (pre-1900) diagrams when things like tunnels were first created!
Fun stuff...
It burns the CPU/GPU as its basically alpha- but its fun as heck.
I mentally instantly went there when I saw the post.
https://store.steampowered.com/app/1066780/Transport_Fever_2...
on an IRL note - would you like to purchase a bunch of model train stuff?
(serious Q