Question: 5. Use the EBNF for Modula-2 notes to determine which binary operators (if any) may be adjacent to the unary plus and minus operators in
5. Use the EBNF for Modula-2 notes to determine which binary operators (if any) may be adjacent to the unary plus and minus operators in Modula-2 expressions. Binary operators means all binary operators in Modula-2, not just the binary arithmetic operators.





EBNF Description of Modula-2's Syntax This appendix contains a complete EBNF (Extended Backus-Naur Form) descrip tion of Modula-2's syntax. An EBNF escription of a language consists of a series of productions. Each production defines a syntactic construct for example, the production Enumeration IdentList states that an enumeration type consists of a left parenthesis, followed by an iden- tifier list, followed by a right parenthesis. The symbol to the left of the equals sign is called a nonterminal; it represents the syntactic construct being defined. The symbols to the right of the equals sign define the construct; these symbols include both nonterminals (identList, in the preceding example) and terminals (symbols that can actually appear in a program including letters, digits, reserved words, and special symbols). Each production ends with a period The equals sign and period are called metasymbols, because they are part of the EBNF description not part of the language being defined. Terminals (other than reserved words) are always enclosed in quotation marks to avoid confusion with metasymbols addition to the equals sign and period, several other metasymbols can appear in productions A vertical bar l separates alternate definitions of a syntactic construct. For example, the production Number Integer l Real. states that a Number can be either an Integer or a Real. Square brackets [j surround an optional portion of a construct. The pro duction Formal Type ARRAY OF] Qualident states that a Formal Type is a Qualident, possibly preceded by the words ARRAY OF Braces surround a portion that we can omit or repeat as many times as we desire. The production EBNF Description of Modula-2's Syntax This appendix contains a complete EBNF (Extended Backus-Naur Form) descrip tion of Modula-2's syntax. An EBNF escription of a language consists of a series of productions. Each production defines a syntactic construct for example, the production Enumeration IdentList states that an enumeration type consists of a left parenthesis, followed by an iden- tifier list, followed by a right parenthesis. The symbol to the left of the equals sign is called a nonterminal; it represents the syntactic construct being defined. The symbols to the right of the equals sign define the construct; these symbols include both nonterminals (identList, in the preceding example) and terminals (symbols that can actually appear in a program including letters, digits, reserved words, and special symbols). Each production ends with a period The equals sign and period are called metasymbols, because they are part of the EBNF description not part of the language being defined. Terminals (other than reserved words) are always enclosed in quotation marks to avoid confusion with metasymbols addition to the equals sign and period, several other metasymbols can appear in productions A vertical bar l separates alternate definitions of a syntactic construct. For example, the production Number Integer l Real. states that a Number can be either an Integer or a Real. Square brackets [j surround an optional portion of a construct. The pro duction Formal Type ARRAY OF] Qualident states that a Formal Type is a Qualident, possibly preceded by the words ARRAY OF Braces surround a portion that we can omit or repeat as many times as we desire. The production
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
