Meaning of square brackets in Alloy grammar spec -
On the mixed web site, I confuse myself with the intersection bracket.
In a production like the following, things look clear.
Specification :: = [module] open * paragraph * I think class brackets indicate an option and that star clenclones are clusters, Therefore, only the quoted rule means that the highest one module statement, zero or more open section and zero or more para in a specification. I understand this (although I'm slowly coming to use the INBF notation of Worth, wherever possible, so my notes have been sent to it by [module] {open} {paragraph} ). In the following production, however, brackets are confusing me.
cmdDecl :: = [name ":"] ["run" | "Check"] [name | Block] scope If the keyword run and check were optional in the order, and accordingly to run for the name of the payment, The name of the claim should be investigated, or the unknown block should be run or checked. But it seems that it seems that this rule is saying. Then Question 1: What do do indicate in the field bracket grammar? Question 2: Is using square brackets where some readers may expect a typo to type? To wit. Should you take the following form instead of this rule?
cmdDecl :: = [name ":"] ("play" | "check") (name | block) radius I am not quite familiar with the various grammatical notes found in the wild; Perhaps it would be helpful to point to the tool, or point to the details of the notation.
Q3: Is this installation used by some parser generation tools? which one?
Question 1: What do the square brackets in grammar indicate?
You correctly state that the use of square brackets used in grammar is inconsistent. I think the grammar was copied from the first version of the "Software Abstractions" book; I'm not sure that the second version of the book contains the same grammar.
Question 2: Is square brackets used where some readers might expect Typo to type?
Perfect.
Q3: Is this installation used by some parser generation tools? which one?
Not so. Mixed aliiser uses grammar written in the cup. Alex and .cup files ( Alloy.lex and Alloy.cup ) are included in the mixed distribution jar file ("edu / mit / csail / sdg / Alloy4compiler / Parser /").
Comments
Post a Comment