-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fall 2024 Planning #1
Comments
|
Below is a functional decomposition of plcc.
The problem with a functional decomposition is that they are functions, and so are verbs. I had been using nouns for packages (folders) and verbs for modules (files). Maybe we name packages as verbs too if we want to use the above to organize code. That should be easy to do now, because there is only one package right now. Let's try it.
|
OK, that makes it much clearer about what needs to be done. I'll just convert that functional decomp into a checklist ...
That's probably enough for now. We'll add the code generate stuff when we are further along. We also need to enumerate the different validations for each spec. We'll do that also when when we are further along. OK, so now we need to think about parsing the individual specs: lexical, syntactic, and semantic. Each of these will receive only the part of the rough that is directly related to their section (so they won't have to deal with section dividers). We should be able to work on them in parallel, independently. Or we can work on them as a team, one at a time. Or some combination thereof. |
Just want to make sure I understand, and that my thought process is on the right track as we move towards the parsing. Please feel free to tell me that all of this is unnecessary, and there is a better system in place to accomplish this goal, however I just wanted to share the ideas that I was brainstorming: Would the best way to split the rough spec into the 3 different sections (with the possibility of multiple semantic sections) be to simply iterate over the rough_spec list of objects and create a hashmap/dict that holds the three sections, and add the objects to their respective section until a divider is encountered? The semantic section of the dict will likely require its own dict for multiple languages, maybe the languages can be the keys and the objects will be the values? Another thing, is it safe the assume that the dividers in the semantic section will have the language of the code that follows written after the divider, similar to the example below, or will we need to figure that out ourselves somehow? Provided Input from parse_rough_test.py:
For example, the dict could look something like this:
And using the provided example, after iteration, the output should look something like this:
Also, where would this process take place? Is it better to create its own section, or will this be done at the end of the rough_spec section? Maybe the best way would be to create a file under the parse_spec section, so that we can send the resulting sections to each part? |
The syntax for %include is up in the air. But it looks like we need to decide this now. The good news is that how the language and tool name are determined will be isolated to this component. So if we need to change it later, it should only effect this module (yeah!). So lets go with this... There are three forms of separators.
The first defaults to Java for both language and tool name. I think we need to update Divider to hold the language and tool name. For example, after parsed we should get something like this:
Also, we'll eventually make a validator that checks that tool names are unique since they will be used to generate subdirectories in the same parent directory. But notice that having a tool name allows multiple semantic sections to use the same language. All of the above should be part of load_rough_spec. With the above changes, we can now include the Divider object with with semantic section that follows it. We probably don't need to include the divider in front of the syntactic section with the syntactic section. So now we can make something like @AksharP5 described. My only adjustment would be to make 'sem' hold a list of sections instead of a dict. We don't yet know if order matters between semantic sections. So let's be conservative and assume oder matters does. The top level dictionary could be a list and just assume that the first section is the lexical section, the second is the syntactic, and the remaining are semantic sections. But a dict works too. Let me try to answer the remaining questions asked by @AksharP5:
I think all of the above is more closely affiliated with load_rough_spec. I don't think parse_spec should have to know how the "sub specs" where organized in the file (beyond knowing the order of the semantic sections). So let's make all of this part of load_rough_spec. I'll uncheck that box to indicate that it is not yet complete. |
Starting to think about the validators for the subsections... Lexical checks
Syntactic checks
Semantic checks
|
No description provided.
The text was updated successfully, but these errors were encountered: