Beispiel #1
0
func getGotoRowData(itemSet *items.ItemSet, sym *symbols.Symbols) []gotoRowElement {
	row := make([]gotoRowElement, sym.NumNTSymbols())
	for i, nt := range sym.NTList() {
		row[i].NT = nt
		row[i].State = itemSet.NextSetIndex(nt)
	}
	return row
}
Beispiel #2
0
func getGotoTableData(itemSets *items.ItemSets, sym *symbols.Symbols) *gotoTableData {
	data := &gotoTableData{
		NumNTSymbols: sym.NumNTSymbols(),
		Rows:         make([]string, itemSets.Size()),
	}
	for i, set := range itemSets.List() {
		data.Rows[i] = genGotoRow(set, sym)
	}
	return data
}