[sword-devel] lex driver unit test

Troy A. Griffitts sword-devel@crosswire.org
Fri, 26 Jul 2002 22:54:35 -0700


This is a multi-part message in MIME format.
--------------030204020009070309010809
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

OK guys,
	I'm trying to get around to fixing all these lexicon issues.  I have 
added a simple lextest unit test file in sword/tests, and have attached 
the file as well.  If you guys could give me something like this that I 
can just compile and bring up in a debugger that demonstrates your 
problems, I would really appreciate it.

	Even imp2ld data files I could try that don't seem to produce what you'd 
expect would be great.  Thanks tons!

	-Troy.


--------------030204020009070309010809
Content-Type: text/plain;
 name="lextest.cpp"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="lextest.cpp"

#include <rawld.h>

void main(int argc, char **argv) {

	RawLD::createModule("tmp/lextest");
	RawLD lex("tmp/lextest");

	lex.SetKey("a");
	lex << "aaa";

	lex.SetKey("c");
	lex << "ccc";

	lex.SetKey("b");
	lex << "bbb";

	for (lex = TOP; !lex.Error(); lex++) {
		cout << lex.KeyText() << ":\n";
		cout << lex << "\n------------------\n";
	}
	return 0;
}

--------------030204020009070309010809--