Commit Graph

33 Commits

Author SHA1 Message Date
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
Will Hawkins 708f65a0a9 Make Formatter Happy
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-04-06 08:50:20 -04:00
Will Hawkins 68ee5b1067 P4Lang/Program/InstancesWithTypes and TypesWithTypes
Add helper functions to fetch globally instantiated/declared
parser/controls (etc) and types in a user's P4 program.

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-04-06 08:49:35 -04:00
Will Hawkins 29dfa62472 Start Handling Control Blocks
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-04-06 08:49:28 -04:00
Will Hawkins 443b21b890 Initial Work on Compiling Function Declarations
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-04-02 02:49:04 -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 8962235aca Support Parameters For Parsers
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-30 07:57:41 -04:00
Will Hawkins 8299d76285 Make Formatter Happy
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-30 05:18:11 -04:00
Will Hawkins 7c9ecc2438 Refactor Parser States
Refactor the class hierarchy for parser states so that
there is a parser state that acts more like a type and
one that acts more like a value (the latter, then, serves
as the base class for the other instantiated parser states).

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-30 05:16:48 -04:00
Will Hawkins 4d787394cd Fix Bug In Struct Field Initialization
Fields were not given default values when a struct was declared
without initializers.

Also, cleanup code in the helper function for binary operations
on struct instances.

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-27 03:54:44 -04:00
Will Hawkins cd26d1d22c Parse Struct Declarations
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-27 03:33:15 -04:00
Will Hawkins 99804e3053 Better Support For Keysets
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-27 01:36:38 -04:00
Will Hawkins fafc80553e Support Binary Math Operators
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-26 23:48:39 -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 6ff7c5175d Make Formatter Happy
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-20 04:30:07 -04:00
Will Hawkins 6a9a138afe Add Defaults For All Types
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-20 04:29:44 -04:00
Will Hawkins 04627f20e2 Support Setting Arrays/Fields
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-20 04:29:37 -04:00
Will Hawkins 2fd5ecf8d6 Work On Derived Types
1. Add support for field access
2. Add support for proper type checking of array access
3. Add tests for nested field and array access

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-16 08:31:16 -04:00
Will Hawkins 75f9f68349 Make Formatter Happy
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-13 09:45:43 -04:00
Will Hawkins 0b4db34177 Initial Array Access Implementation
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-13 09:45:03 -04:00
Will Hawkins 4c63e7f92a Make Formatter Happy
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-13 08:27:41 -04:00
Will Hawkins d323434787 Begin Implementation of Binary Operator Support
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-13 08:26:47 -04:00
Will Hawkins 271092359c Make Formatter Happy
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-10 05:53:11 -04:00
Will Hawkins 3188b52965 Refactor Parsers and Parser States
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-10 03:56:18 -04: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 59d56e7b73 Make Formatter Happy
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-02 08:26:37 -05:00
Will Hawkins 6dba17c97a Refactor Parsing -> Compiling
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-03-02 08:25:29 -05:00
Will Hawkins 2c5bfc3e1c Start Moving Away From Queries
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-02-27 06:16:14 -05:00
Will Hawkins 2c7f71dbd4 Make Formatter Happy
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-02-24 06:10:33 -05:00
Will Hawkins a2335a01ed Initial Support For If Statements
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-02-24 06:08:12 -05:00
Will Hawkins 5dbb8d3d60 Make Formatter Happy
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-02-24 00:44:04 -05:00
Will Hawkins 64a0fe4255 Refactor Parsing/Runtime
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
2026-02-24 00:28:41 -05:00