mirror of
https://github.com/cwbaker/lalr.git
synced 2026-09-26 16:33:18 +03:00
Reorder class member for better memory usage/alignment.
This commit is contained in:
parent
a807827db8
commit
7f1ea72807
2 changed files with 7 additions and 7 deletions
|
|
@ -13,10 +13,10 @@ class ParserSymbol
|
|||
{
|
||||
public:
|
||||
int index; ///< The index of this symbol.
|
||||
SymbolType type; ///< The type of this symbol.
|
||||
const char* identifier; ///< The identifier of this symbol.
|
||||
const char* lexeme; ///< The lexeme of this symbol or null if this symbol is non-terminal.
|
||||
const char* label; ///< The human-readable label for this symbol.
|
||||
SymbolType type; ///< The type of this symbol.
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -296,15 +296,15 @@ void generate_cxx_parser_state_machine( const ParserStateMachine* state_machine
|
|||
const ParserSymbol* symbols_end = symbols + state_machine->symbols_size;
|
||||
for ( const ParserSymbol* symbol = symbols; symbol != symbols_end; ++symbol )
|
||||
{
|
||||
write( " {%d, \"%s\", \"%s\", \"%s\", (SymbolType) %d},\n",
|
||||
symbol->index,
|
||||
symbol->identifier,
|
||||
write( " {%d, (SymbolType) %d, \"%s\", \"%s\", \"%s\"},\n",
|
||||
symbol->index,
|
||||
symbol->type,
|
||||
symbol->identifier,
|
||||
sanitize(symbol->lexeme).c_str(),
|
||||
sanitize(symbol->label).c_str(),
|
||||
symbol->type
|
||||
sanitize(symbol->label).c_str()
|
||||
);
|
||||
}
|
||||
write( " {-1, nullptr, nullptr, nullptr, (SymbolType) 0}\n" );
|
||||
write( " {-1, (SymbolType) 0, nullptr, nullptr, nullptr}\n" );
|
||||
write( "};\n" );
|
||||
write( "\n" );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue