]> ocean-lang.org Git - ocean/blobdiff - csrc/parsergen.mdc
parsergen: change sort order for items.
[ocean] / csrc / parsergen.mdc
index 4ec6d6682339cca49b5c5de12858fdea3fe14f63..7b917b408d3cd7193504863dabca86b5a299918f 100644 (file)
@@ -1003,7 +1003,7 @@ the list in the symset, and then only compare items before the first "0".
 ###### 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)
        {
@@ -1011,7 +1011,7 @@ the list in the symset, and then only compare items before the first "0".
        }
        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