-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add support for automatic ports #57
Comments
Darn! I thought I suggested that too! Probably in an answer to someone else! :-) Sorry! |
Perhaps this issue is in the wrong repo. I'm talking about how we capture these ports in the .fbp DSL Those links only appear to talk about what automatic ports do. |
This repo is responsible for parsing .fbp files into json data. It doesn't care about implementation-specific details such as auto-ports and their naming conventions. What is relevant to this repo is the regex used for port names. To support this we need to make the regex less strict, though we can't make it too lax or the tokenizer will break. |
I feel like I'm not articulating the purpose of this ticket clearly. My understanding is that this repo is responsible (in part) for defining what constitutes a valid .fbp file, since it defines an .fbp parser. I agree that the implementation of automatic ports is implementation specific. However, the concept of automatic ports is not. They are a feature of a generic FBP network. Thus, it makes sense to me that the DSL that describes FBP networks should be able to describe automatic ports. Also, automatic ports do not have naming conventions. They are, by definition, nameless. However, they do require notation conventions in .fbp files... hence this issue. The regex does not need to be less strict. All this would need is some logic to recognize when the port name is a single asterisk (or whatever notation is settled on) and to understand that that represents a nameless automatic port. Or am I missing something here? |
Can you explain what you think the json output should be in the case that one uses an automatic port? The sub-document for a port produced by this project looks like this: {
"process": "Count",
"port": "IN"
} In my mind, the proper result for your case would be: {
"process": "Count",
"port": "*"
} This project does not need to know about the existence of automatic ports in order to achieve this result, it merely needs to modify the regex for allowable port names. It would then be up to a runtime to interpret the above document as an automatic port. This is not just semantics. I would argue that using |
Surely the goal is to have a notation that is identically understood across Do you look to another source to determine how the parser should interpret If there is no other source then there becomes a de facto standard or else I agree that using asterisks is just a convention, but every element in the On Wed, Jun 8, 2016, 17:12 Chad Dombrova [email protected] wrote:
|
The parser doesn't interpret the elements of the language, it parses them into a data structure that is interpreted by a runtime. I understand and appreciate what you are looking for, but I don't think this is the project that defines what you're after. Perhaps others will disagree.
The practical difference is that the parser does not need to know what an auto-port is to do its job, because the existence of auto-ports are not part of the .fbp syntax. For example, in python, using a leading underscore in a variable name (e.g. From the perspective of an fbp parser (which this project is), adding support for auto-ports is a matter of adding another character in a regex. I don't know what other action can or should be taken other than extending the port regex. So can you be more explicit about what you think the json output should be in the case that one uses a port named "*"? |
In so far as I understand this discussion, I don't see a problem with adding Parenthetically, I am not sure what the current standard is for (non-*) port names: in a discussion with @bergie a few years ago, I thought he argued for simple alphameric ports, because of the potential for a Chinese network to use an English-language component, or v.v. More recently, I understood him to be arguing for a looser spec for port names - but maybe I misunderstood. Where do we stand now? Perhaps an agreed-upon regex should be (is?) part of the spec... |
FBP defines automatic ports diagramatically and functionally, but there doesn't appear to be defined support for them in the DSL.
I propose that they be represented by an asterisk in place of an explicit name. This is in line with conventions set by JavaFBP.
The text was updated successfully, but these errors were encountered: