--- parser3/src/include/pa_dictionary.h 2003/07/24 11:31:21 1.14 +++ parser3/src/include/pa_dictionary.h 2003/11/20 16:34:24 1.16 @@ -8,7 +8,7 @@ #ifndef PA_DICTIONARY_H #define PA_DICTIONARY_H -static const char* IDENT_DICTIONARY_H="$Date: 2003/07/24 11:31:21 $"; +static const char * const IDENT_DICTIONARY_H="$Date: 2003/11/20 16:34:24 $"; #include "pa_table.h" @@ -16,18 +16,30 @@ static const char* IDENT_DICTIONARY_H="$ class Dictionary: public PA_Object { public: + struct Subst { + const char *from; size_t from_length; + const String* to; + + Subst(int): from(0) {} + Subst(const char* afrom, const String* ato): from(afrom), to(ato) { + from_length=strlen(afrom); + } + operator bool() { return from!=0; } + }; + /// construct wrapper, grabbing first letters of first column into @b first Dictionary(Table& atable); /// find first row that contains string in first column which starts @b src - Table::element_type first_that_begins(const char* str) const; + Subst first_that_begins(const char* str) const; private: - Table& table; + Array substs; private: friend void pa_dictionary_add_first(Table::element_type row, Dictionary* self); + //friend bool starts(FromTo row, First_that_begins_info* info); int starting_line_of[0x100]; int constructor_line; };