Commit Graph

13 Commits

Author SHA1 Message Date
Will Hawkins 0f0662709e compiler, testing: Build System for Compilation
The compilation code was written as a precursor for implementation
with macros. The updates in this commit make the switch.

There is still plenty to do:

1. Comment Walker.
2. Comment Macros.

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-04-27 08:39:40 -04:00
Will Hawkins d33066c543 compiler, runtime, testing, common: Centralize Execution/Evaluation
Centralize the execution of statements and evaluation of expressions
so that the user can specify a debugging "callback" after every
execution/evaluation.

The callback can be used for myriad things, but it seems likely that
it will be useful for implementing:
1. Testing
2. Debugger

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-04-20 05:53:43 -04:00
Will Hawkins d971aab1fe Support Calling Parsers With Parameters
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-04-02 01:28:43 -04:00
Will Hawkins 2861a82777 Implement Binary Operators and Grouping (in Expressions)
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-23 07:55:11 -04:00
Will Hawkins 81b9345c7f Make Formatter Happy
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-06 21:40:37 -05:00
Will Hawkins eff19df968 Completely Refactor Execution
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-06 21:40:19 -05:00
Will Hawkins f96350f89d Make Formatter Happy
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-06 08:03:07 -05:00
Will Hawkins c3b3be77eb Update Compiler To Use Macros
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-06 08:02:35 -05:00
Will Hawkins 1495074459 Add UseErrorResult Macro
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-02-27 08:22:50 -05:00
Will Hawkins 64a0fe4255 Refactor Parsing/Runtime
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-02-24 00:28:41 -05:00
Will Hawkins d9c8c5aeb0 Refactor Runtime
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-02-19 22:50:19 -05:00
Will Hawkins 3693bdc02d Start Evaluation
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-02-10 03:37:57 -05:00
Will Hawkins 989c9b1212 Refactor
Refactor into four major components:

1. Common: Things shared among all other components.
2. Lang: P4-language-related components.
3. Runtime: Components required to run a P4 program.
4. Parser: Components for parsing a P4 program from source.

Other components:

1. Macros
2. Tests
3. TreeSitterExtensions: Extra tree sitter functionality

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-02-03 08:22:58 -05:00