Changes

→‎Grammar 4: format grammar box
Line 943: Line 943:     
If one imposes the distinction between empty and significant types on each non-terminal symbol in Grammar&nbsp;2, then the non-terminal symbols <math>^{\backprime\backprime} S ^{\prime\prime}</math> and <math>^{\backprime\backprime} T ^{\prime\prime}</math> give rise to the expanded set of non-terminal symbols <math>^{\backprime\backprime} S ^{\prime\prime}, \, ^{\backprime\backprime} \, S' \, ^{\prime\prime}, \, ^{\backprime\backprime} T ^{\prime\prime}, \, ^{\backprime\backprime} \, T' \, ^{\prime\prime},</math> leaving the last three of these to form the new intermediate alphabet.  Grammar&nbsp;4 has the intermediate alphabet <math>\mathfrak{Q} \, = \, \{ \, ^{\backprime\backprime} \, S' \, ^{\prime\prime}, \, ^{\backprime\backprime} T ^{\prime\prime}, \, ^{\backprime\backprime} \, T' \, ^{\prime\prime} \, \},</math> with the set <math>\mathfrak{K}</math> of covering rules as listed in the next display.
 
If one imposes the distinction between empty and significant types on each non-terminal symbol in Grammar&nbsp;2, then the non-terminal symbols <math>^{\backprime\backprime} S ^{\prime\prime}</math> and <math>^{\backprime\backprime} T ^{\prime\prime}</math> give rise to the expanded set of non-terminal symbols <math>^{\backprime\backprime} S ^{\prime\prime}, \, ^{\backprime\backprime} \, S' \, ^{\prime\prime}, \, ^{\backprime\backprime} T ^{\prime\prime}, \, ^{\backprime\backprime} \, T' \, ^{\prime\prime},</math> leaving the last three of these to form the new intermediate alphabet.  Grammar&nbsp;4 has the intermediate alphabet <math>\mathfrak{Q} \, = \, \{ \, ^{\backprime\backprime} \, S' \, ^{\prime\prime}, \, ^{\backprime\backprime} T ^{\prime\prime}, \, ^{\backprime\backprime} \, T' \, ^{\prime\prime} \, \},</math> with the set <math>\mathfrak{K}</math> of covering rules as listed in the next display.
 +
 +
<br>
 +
 +
{| align="center" cellpadding="12" cellspacing="0" style="border-top:1px solid black" width="90%"
 +
| align="left"  style="border-left:1px solid black;"  width="50%" |
 +
<math>\mathfrak{C} (\mathfrak{P}) : \text{Grammar 4}\!</math>
 +
| align="right" style="border-right:1px solid black;" width="50%" |
 +
<math>\mathfrak{Q} = \{ \, ^{\backprime\backprime} \, S' \, ^{\prime\prime}, \, ^{\backprime\backprime} \, T \, ^{\prime\prime}, \, ^{\backprime\backprime} \, T' \, ^{\prime\prime} \, \}</math>
 +
|-
 +
| colspan="2" style="border-top:1px solid black; border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black" |
 +
<math>\begin{array}{rcll}
 +
1.
 +
& S
 +
& :>
 +
& \varepsilon
 +
\\
 +
2.
 +
& S
 +
& :>
 +
& S'
 +
\\
 +
3.
 +
& S'
 +
& :>
 +
& m_1
 +
\\
 +
4.
 +
& S'
 +
& :>
 +
& p_j, \, \text{for each} \, j \in J
 +
\\
 +
5.
 +
& S'
 +
& :>
 +
& ^{\backprime\backprime} \, \operatorname{(} \, ^{\prime\prime} \, \cdot \, T \, \cdot \, ^{\backprime\backprime} \, \operatorname{)} \, ^{\prime\prime}
 +
\\
 +
6.
 +
& S'
 +
& :>
 +
& S' \, \cdot \, S'
 +
\\
 +
7.
 +
& T
 +
& :>
 +
& \varepsilon
 +
\\
 +
8.
 +
& T
 +
& :>
 +
& T'
 +
\\
 +
9.
 +
& T'
 +
& :>
 +
& T \, \cdot \, ^{\backprime\backprime} \operatorname{,} ^{\prime\prime} \, \cdot \, S
 +
\\
 +
\end{array}</math>
 +
|}
 +
 +
<br>
    
<pre>
 
<pre>
| !C!(!P!).  Grammar 4
  −
|
  −
| !Q! = {"S'", "T", "T'"}
  −
|
  −
| 1.  S  :>  !e!
  −
|
  −
| 2.  S  :>  S'
  −
|
  −
| 3.  S'  :>  m_1
  −
|
  −
| 4.  S'  :>  p_j, for each j in J
  −
|
  −
| 5.  S'  :>  "-(" · T · ")-"
  −
|
  −
| 6.  S'  :>  S' · S'
  −
|
  −
| 7.  T  :>  !e!
  −
|
  −
| 8.  T  :>  T'
  −
|
  −
| 9.  T'  :>  T · "," · S
  −
   
In this version of a grammar for !L! = !C!(!P!), the intermediate type T
 
In this version of a grammar for !L! = !C!(!P!), the intermediate type T
 
is partitioned as T = %e% + T', thereby parsing the intermediate symbol T
 
is partitioned as T = %e% + T', thereby parsing the intermediate symbol T
12,080

edits