In P4, parsers are considered types. Those parsers are instantiated.
The instantiated parsers are values. Previously, gp4 treated a parser
type and a parser value as identical. This PR makes that difference
clear _and_ sets the stage for the future.
TODO: Make the same distinction between control and action types and
values.
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
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>
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>
update method will allow the creation of a new compilation context
based on the current one with new types/names.
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
Compilation interface(s) now contain a compilation context.
The change will make it easier to expand on what each step
of the compilation process needs to know to complete its task
without having to make major changes to the interface.
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
Do not pass around the MutableTree -- now that we are not
using queries for walking the AST, it is unnecessary.
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>