omicron
71f1b0aa64
Add more grammar rules to the parser
Validate the build / validate-build (push) Successful in 26s
2025-04-01 23:43:05 +02:00
omicron
c3fcb917fc
Add a parser combinator to parse a delimited list
2025-04-01 23:39:48 +02:00
omicron
333991e05e
make parse_success always skip past trivia in the tokenlist
2025-04-01 23:39:01 +02:00
omicron
a1b4cc21f4
TODO: REVIEW ME AND WRITE PROPER MESSAGE
...
Fix lexer issue where consuming n tokens always fails if there are n
tokens and always succeeds if they aren't n tokens
2025-04-01 23:36:08 +02:00
omicron
80957326bc
fix operands list grammar rule
2025-04-01 23:22:29 +02:00
omicron
da51d66bb2
Match ast nodes to new grammar
2025-04-01 22:09:36 +02:00
omicron
42445338a4
Update grammar to match implementation
2025-04-01 22:01:33 +02:00
omicron
03fc44f339
Use new validator function for parse_token calls on all primitives
...
Also adds new validated primitives for NODE_SECTION and NODE_REGISTER
2025-04-01 21:54:27 +02:00
omicron
eec02d6237
Fix incorrect error returned in parse_consecutive
2025-04-01 21:53:19 +02:00
omicron
39a4b2b0a7
Fix memory leak in ast.
...
If a node has children the array of children was never freed.
2025-04-01 21:51:48 +02:00
omicron
048b8fcf9d
Extend parse_token to accept an optional validator function
2025-04-01 21:10:19 +02:00
omicron
1b21364939
Expose err_parse_no_match in parser_util.h
2025-04-01 20:57:34 +02:00
omicron
41114d7f9c
Add basic parser combinators
2025-04-01 20:05:35 +02:00
omicron
dfc89a7493
Add "primitive" parsers for all the semantic tokens in the lexer grammar
2025-04-01 20:03:53 +02:00
omicron
43a62095bf
Add basic parser utilities
2025-04-01 20:03:28 +02:00
omicron
ff7d33bf2a
Add functions to skip over trivia in a tokenlist
2025-04-01 19:55:00 +02:00
omicron
208f30ac48
Expand AST node ids to support the lexer tokens and grammar rules
2025-04-01 19:26:54 +02:00
omicron
988b54aee3
Adjust grammar so that it never depends on newline tokens
2025-04-01 19:26:27 +02:00
omicron
ed1491db33
Fix parse_token to add the correct information to a parse node
2025-04-01 17:20:50 +02:00
omicron
0bf4ba3a1b
Fix ast nodes now containing token entry instead of token
2025-04-01 17:20:32 +02:00
omicron
e632764bf2
Partial parser implementation
2025-04-01 17:16:21 +02:00
omicron
a298e99895
Add invalid ast node id
2025-04-01 15:06:42 +02:00
omicron
126905a092
FIXME REORDER COMMIT -- Change main so it can parse the ast
...
FIXME THIS COMMIT NEEDS TO BE REORDERED
FIXME THIS COMMIT NEEDS TO BE REORDERED
FIXME THIS COMMIT NEEDS TO BE REORDERED
FIXME THIS COMMIT NEEDS TO BE REORDERED
2025-04-01 15:06:20 +02:00
omicron
0f6efa8050
Add basic AST functionality
Validate the build / validate-build (push) Successful in 24s
2025-03-31 18:43:50 +02:00
omicron
36af377ba0
Add a parser grammar
...
Currently this is a subset of the grammar, enough to get reasonable work
going.
2025-03-31 18:43:34 +02:00
omicron
bd37ddaeea
Add tokenlist, a linked list of lexer tokens
...
The linked list is doubly linked so the parser can look forward into it
and error reporting can look backward.
This commmit also reworks main to use the tokenlist instead of dealing
with the lexer manually.
2025-03-31 18:43:34 +02:00
omicron
42da7b1d05
Move err_allocation_failed into error.c and make it available to
...
everyone.
2025-03-31 18:43:34 +02:00
omicron
75fc72c35d
Add action to run validation on every commit
...
Validate the build / validate-build (push) Successful in 23s
Adds some flags to the makefile to make it build on alpine with a
different libc
2025-03-31 14:36:15 +02:00
omicron
5cdb60d395
Remove peek function
2025-03-30 22:51:47 +02:00
omicron
e5830daac9
Add documentation comments to the lexer code
2025-03-30 22:51:15 +02:00
omicron
4becfb868e
Reduce excessive line length in Makefile
2025-03-30 22:07:35 +02:00
omicron
942dd444cc
Fix infinite loop when lexing an invalid newline sequence
2025-03-30 22:03:12 +02:00
omicron
55f6dff543
Add basic fuzzing with afl++
2025-03-30 22:01:53 +02:00
omicron
df948b18c6
Initial commit, basic lexer structure
2025-03-30 17:45:51 +02:00