-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge progress on SuperP4 #165
Draft
paulgazz
wants to merge
94
commits into
master
Choose a base branch
from
changing_merging_algo
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
big push includes initial code that parses and generates call graphs for specific P4 grammar constructs and support to export dot files. Also modified parser so that function calls under the expression grammar is now separated into a new grammar value.
… addToScope to reuse existing entity addToScope now checks if the name is present under the current scope and returns that entity so that we do not create a new entity for that name. New entity is created and added to the symtab if it doesn't exist.
Right now only builds up the definitions, yet to rebuild call graph and type checker
A lot of repeated code in call graph generation dispatcher to implement scoping. Need to refactor that
actionList is tagged as list, so wraps inside constructs with conditionals, so have a helper function to deal with that
separating actionList into two constructs and updating call graph generator to reflect that
…call graph separating out assignment and method call constructs in the parser for easier identification in the call graph generation. Plus now lvalue is supported in call graph generation with a single assertion that method calls' lvalue only contain name and no dot values. Still yet to assert that lvalues called under assignment are only of the three constructs mentioned in comments
Invoking regular expressions and non brace expressionswq
for actions like .apply()
…onditional nodes extern function declarations are invokable constructs as per the language specs, so keeping track of that in the symbol table so that future invocations don't fail. Plus handling conditional nodes where we skip empty conditional nodes when present and get the children
between callees and definitions
… differentiate generated generic function with same return types in before and after
…side them to simplify generateInstance function Changing externfunctiondeclaration and functiondeclaration to extend respective functionPrototype class (either regular or generator class) so that it inherits function prototype logic since both the constructs are more or less just the function prototype. Added helper function to create the new parent or sub class objects.
Function prototype was not converted to a generator function when the return value wasn't of generic type and no new optTypeParameters were passed in. If the type parameter was passed in through a parent construct - like extern declaration - then function prototype remained normal class. Fixed that by checking if any parameter is of generic type. Algorithm can be optimized
Uncaught error; P4 language allows preprocessor usage to have multi-lines when the first line is ended with a backslash, like in Python. Adding support and a test case for that since p4_16_samples does not have a related test case
One case not supported yet as it looks like it needs a considerable amount of change - checkout test case CGTest_generic_struct_nested_inside_header.p4 Assert statements have been included to make sure those cases don't silently fail
…iple lines in lexer
Handling of generics had a big bug - so refactored the code to handle generics better. Now when resolving generic constructs we go through the AST again for the body of the construct we are resolving generics for. Required more values to be passed and hence the change. Plus updating test cases
Previously when there are multiple subparsers and all of them have an error in it (parse error when the file has preprocessor usages). So this change quits if all subparsers have an error - but still not complete yet as error thrown when all subparsers are in the ERROR state needs to be handled
…for nonbraceexpressions
Backwards support for pragma not mentioned in P4 language specification document but in P4C lexer. Was used in other projects so had to support it. And was using EnterScope for some productions where ReenterScope was supposed to be used; fixed it.
… they do marking them as such
… they do marking them as such
…e test cases. Adding support for multiple function and method declarations that have different number of parameters. NOTE: P4 allows function and method overloading where they can have same number of parameters as long as the parameters have different names - current commit does not support that yet, just different number of parameters. Also fixing a good amount of bugs. Still need to update test cases
E.g. typedefs can shadow a variable in a problem. A new value can shadow any other value
…ctions There are cases when a P4 program invokes the package/switch multiple times with different configurations (there might be two parsers defined for example, and one switch/package uses parser A while another uses parser B). So adding support so that macro usage output will be displayed for any package or switch declaration that matches the passed in template (the -preprocessorUsageMatrix -templateFileForMatrix flags).
It is needed to make the call graph visuals
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.