# File: # pascal-grammar.txt # Author: # Samuel A. Rebelsky # Based on the official Pascal grammar taken from pp. 110-118 # of Jensen and Wirth. # Summary: # A grammar for Pascal. # Notation: # Nonterminals are represented as # less-than sign, nonterminal name, greater-than sign. # erminals are represented as all-caps. # Comments begin with hash signs. # Differences from Standard Pascal Grammar: # Identifiers are treated as terminals rather than nonterminals. # Unsigned integers and unsigned reals are treated as terminals # rather than nonterminals. # Strings are treated as terminals rather than nonterminals. # Nonterminals are presented in alphabetical order. # No or (|) symbols are used. Instead, multiple rules are presented. ::= ARRAY OPENBRACKET { , } CLOSEBRACKET OF ::= ::= ::= ::= ::= ::= ::= SRING ::= PIDENTIFIER = ::= ::= CONS SEMI { SEMI } ::= PIDENTIFIER ::= ::= ::= SEMI ::= ::= PIDENTIFIER ::= { SEMI } ::=