diff options
Diffstat (limited to 'grammer.cpp')
-rw-r--r-- | grammer.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/grammer.cpp b/grammer.cpp index a54b65d..8243fa8 100644 --- a/grammer.cpp +++ b/grammer.cpp @@ -59,24 +59,20 @@ bool Compiler::rootIsStartSymbol() const return GetTypeOfNode(root_node_id) == Top; } -namespace { - - bool ChildIdIsToken(int32_t child_id) - { - return child_id < 0; - } - - index_t TokenIdFromChildId(int32_t child_id) - { - return index_t(-child_id) - 1; - } +bool Gram::ChildIdIsToken(int32_t child_id) +{ + return child_id < 0; +} - int32_t ChildIdFromTokenId(index_t token_id) - { - return -1 - int32_t(token_id); - } +index_t Gram::TokenIdFromChildId(int32_t child_id) +{ + return index_t(-child_id) - 1; +} -} // namespace +int32_t Gram::ChildIdFromTokenId(index_t token_id) +{ + return -1 - int32_t(token_id); +} void Compiler::DumpTree() { |