author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 07 Dec 2016 13:18:16 +0000 | |
changeset 26 | b2c091b8cea1 |
parent 25 | 5a6921729520 |
permissions | -rw-r--r-- |
1 | 1 |
"{ Package: 'stx:goodies/smaCC' }" |
2 |
||
3 |
"{ NameSpace: SmaCC }" |
|
4 |
||
5 |
SmaCCNonTerminalSymbol subclass:#SmaCCStartingSymbol |
|
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'SmaCC-Parser Generator' |
|
10 |
! |
|
11 |
||
12 |
SmaCCStartingSymbol comment:'SmaCCStartingSymbol is the starting symbol in the grammar. A grammar can only have one starting symbol, but it can have may different starting item sets.' |
|
13 |
! |
|
14 |
||
15 |
||
16 |
!SmaCCStartingSymbol methodsFor:'accessing'! |
|
17 |
||
18 |
asLRItemSet |
|
19 |
| itemSet | |
|
20 |
itemSet := SmaCCItemSet new. |
|
21 |
productions do: |
|
22 |
[:each | |
|
23 |
itemSet add: (SmaCCLR1Item |
|
24 |
symbol: self |
|
25 |
rhs: each |
|
26 |
follow: ((SmaCCSymbolSet new) |
|
27 |
add: self class empty; |
|
28 |
yourself))]. |
|
29 |
^itemSet |
|
30 |
! |
|
31 |
||
32 |
compileName |
|
33 |
^(productions first at: 1) name |
|
34 |
! ! |
|
35 |
||
36 |
!SmaCCStartingSymbol methodsFor:'public'! |
|
37 |
||
38 |
isStartingSymbol |
|
39 |
^true |
|
40 |
! ! |
|
41 |
||
42 |
!SmaCCStartingSymbol class methodsFor:'documentation'! |
|
43 |
||
44 |
version |
|
25
5a6921729520
UI improvements: added menu items to show FIRST() and LAST() sets for non-terminal symbols.
vranyj1
parents:
15
diff
changeset
|
45 |
^ '$Id$' |
15 | 46 |
! |
47 |
||
48 |
version_SVN |
|
49 |
^ '$Id$' |
|
1 | 50 |
! ! |
25
5a6921729520
UI improvements: added menu items to show FIRST() and LAST() sets for non-terminal symbols.
vranyj1
parents:
15
diff
changeset
|
51 |