ScottJDaley / ada

A Discord bot for the Satisfactory video game.
MIT License
29 stars 5 forks source link

Create railroad diagram for query grammar #71

Closed ScottJDaley closed 1 year ago

ScottJDaley commented 4 years ago

https://www.bottlecaps.de/rr/ui

ScottJDaley commented 4 years ago

For optimization query:

optimization_query ::= outputs inputs? includes? excludes?
outputs            ::= ("produce" | "make" | "create") ("only"? ("?" | "_" | [0-9]+) ("power" | "tickets" | item)) (("and" | "+") ("only"? ("?" | "_" | [0-9]+) ("power" | "tickets" | item)))*
inputs             ::= "from" ("only"? ("?" | "_" | [0-9]+) ("power" | "space" | ("unweighted"? "resources") | "weighted resources" | resource | item)) (("and" | "+") ("only"? ("?" | "_" | [0-9]+) ("power" | "space" | ("unweighted"? "resources") | "weighted resources" | resource | item)))*
includes           ::= ("with" | "using") ("only"? (recipe | building)) (("and" | "+") ("only"? (recipe | building)))*
excludes           ::= ("without" | "excluding") ("alternate recipes" | recipe | building) ("or" ("alternate recipes" | recipe | building))*