Response Language

Auto responses include the response string, which can contain various syntax features such as shortcodes, reactions, lists (which can themselves be nested). To allow for an arbitrary level of nesting, an antlr language definition was developed to generate a parser.

This parser is then run upon auto response creation/updating to develop a syntax tree that can be used for:

  1. template/shortcode substitution upon auto response triggering
  2. syntax highlighting on the web dashboard

Example

This should be updated to show a graphical tree instead of this garbage

hello [adj] [this is a list, with nested stuff [owl], [[member], [author]]]
(response
  hello
  (respObj [adj])
  (respObj
    (respList
      [
      (listElement
        (response this is a list)
        ,
      )
      (listElement
        (response
          with nested stuff
          (respObj [owl])
        )
        ,
      )
      (response
        (respObj
          (respList
            [
            (listElement
              (response
                (respObj [member])
              )
              ,
            )
            (response
              (respObj [author])
            )
            ]
          )
        )
      )
      ]
    )
  )
)

Grammar

this should link to develop once it’s merged

How to Update the Parser

antlr4 -Dlanguage=Python3 Response.g4


Joseph Azevedo profile
Last modified 2 years ago
Edit this page on GitHub
Built with using