Commit Graph

8 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 883b4127e8 Make Formatter Happy
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-04-20 05:54:00 -04:00
Will Hawkins 5bc9db9aca compiler, common, testing: Support For Checking For Invalid Statements
Add support functions to check whether a (block of) statement(s) contains
any statements that should not appear in that block (e.g., switch in
an action).

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-04-20 03:25:58 -04:00
Will Hawkins 82c125e4d1 compiler, runtime, common: Support (in)out Parameters
When a function is called, if there is an (in)out parameter,
make sure that updated values are propogated to the calling
function.

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-04-16 06:58:45 -04:00
Will Hawkins 94086c8e17 compiler, runtime, common, documentation: Refactor Type System
The type system (and the value system) now include attributes
for each type (things like direction, const-ness).

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-04-14 20:25:11 -04:00
Will Hawkins 35b2537754 compiler, runtime, common, testing: Support Directions on Parameters and Attributed Types
Add support for directions on parameters and attributed types. The
latter is necessary to support the former, but is not limited to
the direction use case. An attributed type is a P4 type with attributes
(like its direction, whether it is read only, etc.) Other attributes
will be added in the future.

Changes necessary to support attributed types include:
1. Global instances tracked during compilation are not attributed
types and not simply types.
2. (future) Type checking will have to make sure that a types
attributes do not affect type compatibility.

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-04-13 06:25:08 -04:00
Will Hawkins ad7e5a6f6d Make Formatter Happy
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-04-09 23:17:18 -04:00
Will Hawkins d39127ac17 Support Function Calls
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-04-09 23:16:27 -04:00