struct CpgotoTable
{
+ static const uint TABLE_SIZE;
uint * table;
CpgotoTable (const Span * span, uint nSpans);
void emit (OutputFile & o, uint ind);
delete bspan;
}
+const uint CpgotoTable::TABLE_SIZE = 0x100;
+
CpgotoTable::CpgotoTable (const Span * span, uint nSpans)
- : table (new uint [0x100])
+ : table (new uint [TABLE_SIZE])
{
uint c = 0;
for (uint i = 0; i < nSpans; ++i)
{
vUsedLabels.insert(span[i].to->label);
- for(; c < span[i].ub && c < 0x100; ++c)
+ for(; c < span[i].ub && c < TABLE_SIZE; ++c)
{
table[c] = span[i].to->label;
}
{
o << indent (ind) << "static void *" << mapCodeName["yytarget"] << "[256] = {\n";
o << indent (++ind);
- for (uint i = 0; i <= 0xFF; ++i)
+ for (uint i = 0; i < TABLE_SIZE; ++i)
{
o << "&&" << labelPrefix << table[i];
- if (i == 0xFF)
+ if (i == TABLE_SIZE - 1)
{
o << "\n";
}