7 #include "ILPushLexer.hh"
8 #include "APushParser.hh"
9 #include "TDictionary.hh"
11 ILPushLexer::ILPushLexer(ALogger& l, APushParser& p, TDictionary& d) : LPushLexer(l, p), dictionary(d)
17 ILPushLexer::complete()
21 std::list<std::string> complete_list;
22 std::string new_buffer = dictionary.complete(buffer, complete_list);
24 if (!complete_list.size())
27 logger.warning("no known macro with `" + buffer + "' prefix");
29 else if (complete_list.size() == 1)
31 // good! we have found the macro
36 // we have more than one matching macro
37 logger.warning("ambiguous prefix `" + buffer + "'");
38 for (std::list<std::string>::const_iterator p = complete_list.begin();
39 p != complete_list.end();
42 logger.info("Candidate: " + *p);