Neopolitan Parser Grammar
All this stuff is in pre tags becaue to avoid having to comment out all the pipes
This is where I'm working on the Parser grammar to make the AST for the LSP and Tree - Sitter parsers for Neopolitan. (I built the original parser before learning how to define this grammar. Any differences will be normalized to use this moving forward)
- This is kinda a scratch pade since it's working a few different things. It's not a direct right now because the tree - sitter parser in volvues using regex and c and I haven't consolidted those things down yet
- The current todo check marks are for adding the specific items to the Tree - Sitter parser
- Thing with a 'ts' have been handled in tree sitter
*Primitives**
These are all the things that don't call another item. They're what will be used to assemble the full items. They'll be created in the scanner.cc file
*SECTION TOKENS**
These tokens are used for basic sections as well as container sections. The assembly of the container section start and end triggers is done in a later step
*SECTION HEADERS**
There are "SECTION" and "CONTAINER" template. Some section types have one, some have the other, and some have both.
*Full Items**
These are the things that are made from either primitives, other full items, or both. They'll be assembled in the tree - sitter grammar.js file
Prior Work
This is an example that someone from chat helped me put together
CMD -> '!bear' ' ' BEAR_COMMAND_LIST
BEAR_COMMAND_LIST -> BEAR_COMMAND | BEAR_COMMAND ',' OPTIONAL_WHITESPACE BEAR_COMMAND_LIST
BEAR_COMMAND -> OP ':' OPTIONAL_WHITESPACE COLOR
OPTIONAL_WHITESPACE -> NOTHING | ' ' OPTIONAL_WHITESPACE
OP -> 'head' | 'body' | 'eyes'
COLOR -> HEXCOLOR | COLORNAME
HEXCOLOR -> '#' HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT
COLORNAME -> 'red' | 'green' | 'blue' | 'white' | ...
Footnotes And References
- •