I want items with larger indexes to always preceed smaller
indexes. This makes the report easier to follow.
So negate the index number (and add an offset) when sorting.
Signed-off-by: NeilBrown <neilb@suse.de>
###### declarations
static inline unsigned short item_num(int production, int index)
{
- return production | (((index-1)&0x1f) << 11);
+ return production | ((31-index) << 11);
}
static inline int item_prod(unsigned short item)
{
}
static inline int item_index(unsigned short item)
{
- return ((item >> 11)+1) & 0x1f;
+ return (31-(item >> 11)) & 0x1f;
}
For LR(1) analysis we need to compare not just the itemset in a state