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>
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>
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>
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>