#include <limits.h>
#include <algorithm>
+#include <functional>
#define QLALR_NO_DEBUG_NULLABLES
#define QLALR_NO_DEBUG_LOOKBACKS
non_terminals.insert (accept_symbol);
}
-struct _Nullable: public std::unary_function<Name, bool>
+struct Nullable: public std::unary_function<Name, bool>
{
Automaton *_M_automaton;
- _Nullable (Automaton *aut):
+ Nullable (Automaton *aut):
_M_automaton (aut) {}
bool operator () (Name name) const
for (RulePointer rule = _M_grammar->rules.begin (); rule != _M_grammar->rules.end (); ++rule)
{
- NameList::iterator nn = std::find_if (rule->rhs.begin (), rule->rhs.end (), std::not1 (_Nullable (this)));
+ NameList::iterator nn = std::find_if (rule->rhs.begin (), rule->rhs.end (), std::not1 (Nullable (this)));
if (nn == rule->rhs.end ())
changed |= nullables.insert (rule->lhs).second;
if (! _M_grammar->isNonTerminal (*A))
continue;
- NameList::iterator first_not_nullable = std::find_if (dot, rule->rhs.end (), std::not1 (_Nullable (this)));
+ NameList::iterator first_not_nullable = std::find_if (dot, rule->rhs.end (), std::not1 (Nullable (this)));
if (first_not_nullable != rule->rhs.end ())
continue;
Recognizer::~Recognizer()
{
if (stack_size)
- ::qFree(state_stack);
+ ::free(state_stack);
}
inline void Recognizer::reallocateStack()
sym_stack.resize (stack_size);
if (! state_stack)
- state_stack = reinterpret_cast<int*> (::qMalloc(stack_size * sizeof(int)));
+ state_stack = reinterpret_cast<int*> (::malloc(stack_size * sizeof(int)));
else
- state_stack = reinterpret_cast<int*> (::qRealloc(state_stack, stack_size * sizeof(int)));
+ state_stack = reinterpret_cast<int*> (::realloc(state_stack, stack_size * sizeof(int)));
}
int Recognizer::nextToken()
Recognizer::~Recognizer()
{
if (stack_size)
- ::qFree(state_stack);
+ ::free(state_stack);
}
inline void Recognizer::reallocateStack()
sym_stack.resize (stack_size);
if (! state_stack)
- state_stack = reinterpret_cast<int*> (::qMalloc(stack_size * sizeof(int)));
+ state_stack = reinterpret_cast<int*> (::malloc(stack_size * sizeof(int)));
else
- state_stack = reinterpret_cast<int*> (::qRealloc(state_stack, stack_size * sizeof(int)));
+ state_stack = reinterpret_cast<int*> (::realloc(state_stack, stack_size * sizeof(int)));
}
int Recognizer::nextToken()