Start of CONSTRUCTOR for the Grammar G16.grm Sat Apr 03 15:44:45 2004
Terminal alphabet
# 1 = #
# 2 = a
# 3 = b
Nonterminal alphabet
# 4 = `S'
# 5 = `A'
# 6 = `C'
# 7 = `B'
Productions
P 1: `S' -> # `A' #
P 2: `A' -> `C' `B'
P 3: `B' -> a
P 4: `B' -> `B' a
P 5: `C' -> b
Leftmost-set
Symbol | # | a | b | S | A | C | B |
4.S | * | 0 | 0 | 0 | 0 | 0 | 0 |
5.A | 0 | 0 | * | 0 | 0 | * | 0 |
6.C | 0 | 0 | * | 0 | 0 | 0 | 0 |
7.B | 0 | * | 0 | 0 | 0 | 0 | * |
Rightmost-set
Symbol | # | a | b | S | A | C | B |
4.S | * | 0 | 0 | 0 | 0 | 0 | 0 |
5.A | 0 | * | 0 | 0 | 0 | 0 | * |
6.C | 0 | 0 | * | 0 | 0 | 0 | 0 |
7.B | 0 | * | 0 | 0 | 0 | 0 | 0 |
Leftmost & rightmost sets
`S' leftmost set: `#'
`S' rightmost set: #
`A' leftmost set: `b' , `C'
`A' rightmost set: a , B
`C' leftmost set: `b'
`C' rightmost set: b
`B' leftmost set: `a' , `B'
`B' rightmost set: a
Precedence matrix
Symbol | # | a | b | S | A | C | B |
1.# | 0 | 0 | < | 0 | = | < | 0 |
2.a | > | > | 0 | 0 | 0 | 0 | 0 |
3.b | 0 | > | 0 | 0 | 0 | 0 | > |
4.S | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5.A | = | 0 | 0 | 0 | 0 | 0 | 0 |
6.C | 0 | < | 0 | 0 | 0 | 0 | 3 |
7.B | > | = | 0 | 0 | 0 | 0 | 0 |
The relationships of symbol #1 #:
The relationships of symbol #2 a:
The relationships of symbol #3 b:
The relationships of symbol #4 `S':
The relationships of symbol #5 `A':
The relationships of symbol #6 `C':
The relationships of symbol #7 `B':
Precedence varies
P2-conflict: `C' <= `B'
The source is the production P 2: `A' -> `C' `B'
I'll add a new NT P 6: `A1' -> `B'
I'll change the production P 2: `A' -> `C' `A1'
Leftmost-set
Symbol | # | a | b | S | A | C | B | A1 |
4.S | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5.A | 0 | 0 | * | 0 | 0 | * | 0 | 0 |
6.C | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 |
7.B | 0 | * | 0 | 0 | 0 | 0 | * | 0 |
8.A1 | 0 | * | 0 | 0 | 0 | 0 | * | 0 |
New grammar
P 1: `S' -> # `A' #
P 2: `A' -> `C' `A1'
P 3: `B' -> a
P 4: `B' -> `B' a
P 5: `C' -> b
P 6: `A1' -> `B'
Leftmost-set
Symbol | # | a | b | S | A | C | B | A1 |
4.S | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5.A | 0 | 0 | * | 0 | 0 | * | 0 | 0 |
6.C | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 |
7.B | 0 | * | 0 | 0 | 0 | 0 | * | 0 |
8.A1 | 0 | * | 0 | 0 | 0 | 0 | * | 0 |
Rightmost-set
Symbol | # | a | b | S | A | C | B | A1 |
4.S | * | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5.A | 0 | * | 0 | 0 | 0 | 0 | * | * |
6.C | 0 | 0 | * | 0 | 0 | 0 | 0 | 0 |
7.B | 0 | * | 0 | 0 | 0 | 0 | 0 | 0 |
8.A1 | 0 | * | 0 | 0 | 0 | 0 | * | 0 |
Leftmost & rightmost sets
`S' leftmost set: `#'
`S' rightmost set: #
`A' leftmost set: `b' , `C'
`A' rightmost set: a , B , A1
`C' leftmost set: `b'
`C' rightmost set: b
`B' leftmost set: `a' , `B'
`B' rightmost set: a
`A1' leftmost set: `a' , `B'
`A1' rightmost set: a , B
Precedence matrix
Symbol | # | a | b | S | A | C | B | A1 |
1.# | 0 | 0 | < | 0 | = | < | 0 | 0 |
2.a | > | > | 0 | 0 | 0 | 0 | 0 | 0 |
3.b | 0 | > | 0 | 0 | 0 | 0 | > | > |
4.S | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5.A | = | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6.C | 0 | < | 0 | 0 | 0 | 0 | < | = |
7.B | > | = | 0 | 0 | 0 | 0 | 0 | 0 |
8.A1 | > | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
The relationships of symbol #1 #:
The relationships of symbol #2 a:
The relationships of symbol #3 b:
The relationships of symbol #4 `S':
The relationships of symbol #5 `A':
The relationships of symbol #6 `C':
The relationships of symbol #7 `B':
The relationships of symbol #8 `A1':
Grammar G16.grm is a precedence grammar
Grammar G16.grm is invertible
Semantics
Semantics file is G16.sem
#=1
a=2
b=3
P1=4 $P 1: `S' -> # `A' #
P2=5 $P 2: `A' -> `C' `A1'
P3=6 $P 3: `B' -> a
P4=7 $P 4: `B' -> `B' a
P5=8 $P 5: `C' -> b
P6=9 $P 6: `A1' -> `B'
Result tables
File | Size |
G16.prm | 28 |
G16.pm | 81 |
G16.t | 180 |
G16.tt | 80 |
G16.ht | 1256 |
G16.sm | 44 |
G16.v | 416 |
Look at result tablesFinish of CONSTRUCTOR Sat Apr 03 15:44:45 2004