[PARSER] Grammar done and some note.
This commit is contained in:
parent
734906e46c
commit
c22ab63479
2 changed files with 69 additions and 0 deletions
55
src/grammar
Normal file
55
src/grammar
Normal file
|
@ -0,0 +1,55 @@
|
|||
__________ __ _____ ____ ___ ____ _____ __________
|
||||
/_ __/ __ \/ |/ / / / __ \/ | / __ \/ ___// ____/ __ \
|
||||
/ / / / / / /|_/ / / / /_/ / /| | / /_/ /\__ \/ __/ / /_/ /
|
||||
/ / / /_/ / / / / /___/ ____/ ___ |/ _, _/___/ / /___/ _, _/
|
||||
/_/ \____/_/ /_/_____/_/ /_/ |_/_/ |_|/____/_____/_/ |_|
|
||||
|
||||
toml : content
|
||||
|
||||
content : content tomlEntries
|
||||
| tomlEntries
|
||||
|
||||
tomlEntries : table
|
||||
| object
|
||||
|
||||
table : '[' ID ']'
|
||||
| '[' '[' ID ']' ']'
|
||||
|
||||
object : key '=' value
|
||||
| key '=' array --
|
||||
| key '=' dict -- talvez coloque isto numa regra separada chamada inlinetable
|
||||
|
||||
array : '[' aCont ']'
|
||||
| '[' ']'
|
||||
|
||||
aCont : aCont ',' aElem
|
||||
| aElem
|
||||
|
||||
aElem : value
|
||||
| dict
|
||||
| array
|
||||
|
||||
dict : '{' dictCont '}'
|
||||
| '{' '}'
|
||||
|
||||
dictCont : dictCont ',' dictElem
|
||||
| dictElem
|
||||
|
||||
dictElem : object
|
||||
|
||||
key : ID
|
||||
| STR
|
||||
| FLOAT
|
||||
| INT
|
||||
|
||||
value : STR
|
||||
| DATE
|
||||
| DATETIME
|
||||
| INT
|
||||
| FLOAT
|
||||
| HEX
|
||||
| BIN
|
||||
| OCT
|
||||
| INF
|
||||
| NAN
|
||||
|
14
src/notes.md
Normal file
14
src/notes.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
|
||||
# LEXER
|
||||
TODO:
|
||||
- multiline strings
|
||||
- exponent floats and ints
|
||||
- tirar as aspas das strings, com o match object (4.18 Internal lexer state https://www.dabeaz.com/ply/ply.html#ply_nn20)
|
||||
- mudar ids para poderem existir keys com o formato yessir."olympus".2
|
||||
- inlinetables nao podem ter espacos no meio a menos que um dos values o permita (exemplo : multiline strings)
|
||||
|
||||
|
||||
# PARSER
|
||||
## GRAMMAR
|
||||
- por agora esta tudo porreiro
|
||||
|
Loading…
Add table
Reference in a new issue