Changeset 99


Ignore:
Timestamp:
Apr 14, 2008, 9:51:39 AM (11 years ago)
Author:
cameron
Message:

Internal entity parsing.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/engine.c

    r98 r99  
    4444        }       
    4545}
     46
     47Parser_Interface * Parser_Interface::ParserFactory(unsigned char * byte_buffer, int byte_count, Model_Info * m);
     48        Byteplex * b = Byteplex::ByteplexFactory(m, byte_buffer, byte_count);
     49        if (m->code_unit_base == ASCII) {
     50                return new ParsingEngine<ASCII>(m, b, false);
     51        }
     52        else /* if (m->code_unit_base == EBCDIC) */ {
     53                return new ParsingEngine<EBCDIC>(m, b, false);
     54        }       
     55}
     56
    4657
    4758Parser_Interface::~Parser_Interface() {
     
    340351                Advance(1);
    341352                Reference_action(GetCodeUnitPtr(text_or_markup_start), LengthFrom(text_or_markup_start));
     353//      The following code will replace Reference_Action.
     354//              entity_info = LookupEntity();
     355//              ParserInterface * entity_parser;
     356//              if (entity_info->is_external) {
     357//                      entity_parser = ParserFactory(filename, model_info);
     358//              }
     359//              else {
     360//                      replText = GetReplacementText(LookupEntity());
     361//                      entity_parser = ParserFactory(replText, strlen(replText), model_info);
     362//              }
     363//              entity_parser->ParseContent();
     364//              entity_parser->~ParserInterface();
    342365        }
    343366}
  • trunk/src/engine.h

    r98 r99  
    2222        ~Parser_Interface();
    2323        static Parser_Interface * ParserFactory(char * filename, bool is_external);
     24        // Constructor for a subsidiary parser for internal entities.
     25        static Parser_Interface * ParserFactory(unsigned char * byte_buffer, int byte_count, Model_Info * m);
    2426        virtual void ParseContent() = 0;
    2527        virtual void Parse_ExtSubsetDecl() = 0;
     
    3133        bool has_EncodingDecl();
    3234        unsigned char * get_Encoding();
    33                 Model_Info * model_info;
     35        Model_Info * model_info;
    3436protected:
    3537        /* Co-classes */
Note: See TracChangeset for help on using the changeset viewer.