Skip to content
Snippets Groups Projects
Commit 01722a64 authored by rk's avatar rk
Browse files

Parser (ANTLR and our Parser) has been moved to Wccl namespace.

parent c15e3fc3
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,8 @@
#include "ANTLRLexer.hpp"
#include "ANTLRParser.hpp"
namespace Wccl {
/**
* @desc Parser constructor. Default tagset is NULL
*/
......@@ -221,3 +223,5 @@ boost::shared_ptr<ANTLRParserResultBase> Parser::parseAnyOperator(
}
return result;
}
} // end Wccl ns
......@@ -19,6 +19,8 @@
// ----------------------------------------------------------------------------
namespace Wccl{
class Parser {
public:
Parser(const Corpus2::Tagset&);
......@@ -67,4 +69,6 @@ private:
const Corpus2::Tagset &tagset_;
};
} // end Wccl ns
#endif // LIBWCCL_PARSER_PARSER_H
This diff is collapsed.
......@@ -14,7 +14,7 @@ int main()
{
std::string str_in;
Corpus2::Tagset tagset;
Parser parser(tagset);
Wccl::Parser parser(tagset);
boost::shared_ptr<const Wccl::Bool> retVal;
boost::shared_ptr<ANTLRParserResult<Wccl::Bool> > retOp;
......
......@@ -90,7 +90,7 @@ void libedit_read_loop(boost::function<bool (const std::string&)>& line_cb)
}
#endif
bool process_line(const std::string& line, Parser& parser,
bool process_line(const std::string& line, Wccl::Parser& parser,
Wccl::SentenceContext& sc, bool all_positions)
{
if (line.empty() || line == "exit" || line == "quit") {
......@@ -209,7 +209,7 @@ int main(int argc, char** argv)
Wccl::SentenceContext sc(sentence);
int pos = atoi(position.c_str());
sc.set_position(pos);
Parser parser(tagset);
Wccl::Parser parser(tagset);
if (!query.empty()) {
process_line(query, parser, sc, position == "all");
return 0;
......
......@@ -15,7 +15,7 @@ int main()
{
std::string str_in;
Corpus2::Tagset tagset;
Parser parser(tagset);
Wccl::Parser parser(tagset);
boost::shared_ptr<const Wccl::StrSet> retVal;
boost::shared_ptr<ANTLRParserResult<Wccl::StrSet> > retOp;
......
......@@ -17,7 +17,7 @@ int main()
{
std::string str_in;
const Corpus2::Tagset& tagset = Corpus2::get_named_tagset("kipi");
Parser parser(tagset);
Wccl::Parser parser(tagset);
boost::shared_ptr<const Wccl::TSet> retVal;
boost::shared_ptr<ANTLRParserResult<Wccl::TSet> > retOp;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment