diff --git a/wcclparser/main.cpp b/wcclparser/main.cpp
index aed4a47d274549a704a008b0723fb4f8a722b674..7bb1a81f1f599f9a31f203109bf8db6437f4f57b 100644
--- a/wcclparser/main.cpp
+++ b/wcclparser/main.cpp
@@ -1,5 +1,7 @@
 #include <cstdlib>
 #include <fstream>
+#include <iomanip>
+
 
 #include <libwccl/values/strset.h>
 #include <libwccl/parser/Parser.h>
@@ -88,7 +90,8 @@ void libedit_read_loop(boost::function<bool (const std::string&)>& line_cb)
 }
 #endif
 
-bool process_line(const std::string& line, Parser& parser, Wccl::SentenceContext& sc)
+bool process_line(const std::string& line, Parser& parser,
+	Wccl::SentenceContext& sc, bool all_positions)
 {
 	if (line.empty() || line == "exit" || line == "quit") {
 		return true;
@@ -102,15 +105,28 @@ bool process_line(const std::string& line, Parser& parser, Wccl::SentenceContext
 	try {
 		retOp = parser.parseAnyOperator(line);
 		if (retOp) {
-			Wccl::FunExecContext cx(sc, retOp->variables);
-			retVal = retOp->get_op_base()->apply_internal(cx);
-			if (retVal) {
-				std::cerr << "Parsed expression: "
-					<< retVal->to_string(parser.tagset())
-					<< std::endl;
+			int pb, pe;
+			if (all_positions) {
+				pb = 0;
+				pe = sc.get_sentence().empty() ? 1 : sc.size();
 			} else {
-				std::cerr << "Problem while parsing -- "
-					<< "retVal is NULL!" << std::endl;
+				pb = sc.get_position();
+				pe = sc.get_position() + 1;
+			}
+			for (int i = pb; i < pe; ++i) {
+				sc.set_position(i);
+				Wccl::FunExecContext cx(sc,
+					boost::shared_ptr<Wccl::Variables>(retOp->variables->clone()));
+				retVal = retOp->get_op_base()->apply_internal(cx);
+				if (retVal) {
+					std::cerr << "[" << std::setw(2) << sc.get_position() << "] "
+						<< "Parsed expression: "
+						<< retVal->to_string(parser.tagset())
+						<< std::endl;
+				} else {
+					std::cerr << "Problem while parsing -- "
+						<< "retVal is NULL!" << std::endl;
+				}
 			}
 		} else {
 			std::cerr << "Problem while parsing -- "
@@ -195,11 +211,12 @@ int main(int argc, char** argv)
 		sc.set_position(pos);
 		Parser parser(tagset);
 		if (!query.empty()) {
-			process_line(query, parser, sc);
+			process_line(query, parser, sc, position == "all");
 			return 0;
 		}
 		boost::function<bool (const std::string&)> f;
-		f = boost::bind(&process_line, _1, boost::ref(parser), boost::ref(sc));
+		f = boost::bind(&process_line, _1, boost::ref(parser), boost::ref(sc),
+			position == "all");
 #ifdef HAVE_LIBEDIT
 		libedit_read_loop(f);
 #else