Start of CONSTRUCTOR for the Grammar G22.grm Sat Apr 03 15:46:39 2004

Terminal alphabet

# 1 = #
# 2 = a
# 3 = b
# 4 = 0
# 5 = 1


Nonterminal alphabet

# 6 = `T'
# 7 = `S'
# 8 = `A'
# 9 = `B'
#10 = `C'


Productions

P 1: `T' -> # `S' #
P 2: `S' -> a `A'
P 3: `S' -> b `B'
P 4: `A' -> 0 `A' 1
P 5: `A' -> `C' 1
P 6: `B' -> 1 `C' 1
P 7: `C' -> 1

Leftmost-set

Symbol#ab01TSABC
6.T*000000000
7.S0**0000000
8.A000**0000*
9.B0000*00000
10.C0000*00000

Rightmost-set

Symbol#ab01TSABC
6.T*000000000
7.S0000*00**0
8.A0000*00000
9.B0000*00000
10.C0000*00000

Leftmost & rightmost sets

`T' leftmost set: `#'
`T' rightmost set: #

`S' leftmost set: `a' , `b'
`S' rightmost set: 1 , A , B

`A' leftmost set: `0' , `1' , `C'
`A' rightmost set: 1

`B' leftmost set: `1'
`B' rightmost set: 1

`C' leftmost set: `1'
`C' rightmost set: 1


Precedence matrix

Symbol#ab01TSABC
1.#0<<000=000
2.a000<<00=0<
3.b0000<000=0
4.0000<<00=0<
5.1>000 60000=
6.T0000000000
7.S=000000000
8.A>000=00000
9.B>000000000
10.C0000=00000

The relationships of symbol #1 #:
<• a<• b=• `S'

The relationships of symbol #2 a:
<• 0<• 1=• `A'<• `C'

The relationships of symbol #3 b:
<• 1=• `B'

The relationships of symbol #4 0:
<• 0<• 1=• `A'<• `C'

The relationships of symbol #5 1:
•> #<••> 1=• `C'

The relationships of symbol #6 `T':

The relationships of symbol #7 `S':
=• #

The relationships of symbol #8 `A':
•> #=• 1

The relationships of symbol #9 `B':
•> #

The relationships of symbol #10 `C':
=• 1


Precedence varies


P1-conflict:
1 <••> 1
The source is the production P 6: `B' -> 1 `C' 1
I'll add a new NT P 8: `B1' -> 1
I'll change the production P 6: `B' -> `B1' `C' 1

New grammar

P 1: `T' -> # `S' #
P 2: `S' -> a `A'
P 3: `S' -> b `B'
P 4: `A' -> 0 `A' 1
P 5: `A' -> `C' 1
P 6: `B' -> `B1' `C' 1
P 7: `C' -> 1
P 8: `B1' -> 1

Leftmost-set

Symbol#ab01TSABCB1
6.T*0000000000
7.S0**00000000
8.A000**0000*0
9.B0000*00000*
10.C0000*000000
11.B10000*000000

Rightmost-set

Symbol#ab01TSABCB1
6.T*0000000000
7.S0000*00**00
8.A0000*000000
9.B0000*000000
10.C0000*000000
11.B10000*000000

Leftmost & rightmost sets

`T' leftmost set: `#'
`T' rightmost set: #

`S' leftmost set: `a' , `b'
`S' rightmost set: 1 , A , B

`A' leftmost set: `0' , `1' , `C'
`A' rightmost set: 1

`B' leftmost set: `1' , `B1'
`B' rightmost set: 1

`C' leftmost set: `1'
`C' rightmost set: 1

`B1' leftmost set: `1'
`B1' rightmost set: 1


Precedence matrix

Symbol#ab01TSABCB1
1.#0<<000=0000
2.a000<<00=0<0
3.b0000<000=0<
4.0000<<00=0<0
5.1>000>0000>0
6.T00000000000
7.S=0000000000
8.A>000=000000
9.B>0000000000
10.C0000=000000
11.B10000<0000=0

The relationships of symbol #1 #:
<• a<• b=• `S'

The relationships of symbol #2 a:
<• 0<• 1=• `A'<• `C'

The relationships of symbol #3 b:
<• 1=• `B'<• `B1'

The relationships of symbol #4 0:
<• 0<• 1=• `A'<• `C'

The relationships of symbol #5 1:
•> #•> 1•> `C'

The relationships of symbol #6 `T':

The relationships of symbol #7 `S':
=• #

The relationships of symbol #8 `A':
•> #=• 1

The relationships of symbol #9 `B':
•> #

The relationships of symbol #10 `C':
=• 1

The relationships of symbol #11 `B1':
<• 1=• `C'


Grammar G22.grm is a precedence grammar

Grammar G22.grm is not invertible


Left Context


Symbol#ab01TSABCB1
6.T00000000000
7.S*0000000000
8.A0*0*0000000
9.B00*00000000
10.C0*0*000000*
11.B100*00000000

Right Context


Symbol#ab01
6.T00000
7.S*0000
8.A*000*
9.B*0000
10.C0000*
11.B10000*


Independent context

`T' left context:
`T' right context:

`S' left context: #
`S' right context: #

`A' left context: a , 0
`A' right context: # , 1

`B' left context: b
`B' right context: #

`C' left context: a , 0 , `B1'
`C' right context: 1

`B1' left context: b
`B1' right context: 1


Equivalent definitions:
`C' —> 1 & `B1' —> 1
`C' left context: a , 0 , `B1'
`C' right context: 1

`B1' left context: b
`B1' right context: 1


The left context of `C' and `B1' is different

Grammar G22.grm is BRC(1|1)-reducible


Semantics

Semantics file is G22.sem
#=1
a=2
b=3
0=4
1=5
P1=6 $P 1: `T' -> # `S' #
P2=7 $P 2: `S' -> a `A'
P3=8 $P 3: `S' -> b `B'
P4=9 $P 4: `A' -> 0 `A' 1
P5=10 $P 5: `A' -> `C' 1
P6=11 $P 6: `B' -> `B1' `C' 1
P7=12 $P 7: `C' -> 1
P8=13 $P 8: `B1' -> 1

Result tables


FileSize
G22.prm28
G22.pm144
G22.t240
G22.tt120
G22.ht1348
G22.sm60
G22.v580
G22.lc144
G22.rc144

Look at result tables

Finish of CONSTRUCTOR Sat Apr 03 15:46:40 2004