Parsodus/templates/c++/lr.cpp

14 lines
421 B
C++

#include "{{name}}.h"
#define TABLE {{name}}___Table___{{name}}
#define REDUCE_COUNT {{name}}___Num_Reduces___{{name}}
const std::uint64_t TABLE[{{num_states}}][{{num_symbols}}] = {
{{#states}}
{ {{#actions}}({{action}} | ({{data}}) << 2),{{/actions}}
{{#gotos}}(({{.}}) << 2),{{/gotos}} },
{{/states}}
};
const unsigned char REDUCE_COUNT[{{num_rules}}] = { {{#rules}}{{rhs_length}},{{/rules}} };