Changeset 73 for trunk/src/engine.h


Ignore:
Timestamp:
Mar 27, 2008, 9:28:33 AM (12 years ago)
Author:
cameron
Message:

Refactored Parsing Engine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/engine.h

    r66 r73  
    11/*  engine.h - parabix parsing engine
    2     Copyright (c) 2007, Robert D. Cameron
     2    Copyright (c) 2007, 2008 Robert D. Cameron
    33    Licensed to the public under the Open Software License 3.0.
    44    Licensed to International Characters, Inc., under the Academic
     
    99#define ENGINE_H
    1010
    11 #include "xmlparam.h"
    12 #include "xmlbuffer.h"
     11#include "xmlmodel.h"
     12#include "xmldecl.h"
     13#include "byteplex.h"
    1314#include "bitlex.h"
    1415
    15 
     16#define min(x,y) ((x) <(y) ?(x) :(y) )
    1617/* A ParsingEngine is the principal class for parsing XML
    1718data.  */
     
    1920class Parser_Interface {
    2021public:
    21     ~Parser_Interface();
     22        ~Parser_Interface();
    2223        static Parser_Interface * ParserFactory(char * filename);
    2324        virtual void ParseContent() = 0;
     
    2728        XML_standalone standalone_status();
    2829        bool has_EncodingDecl();
    29         int get_Encoding_pos();
    30         int get_Encoding_lgth();
     30        unsigned char * get_Encoding();
    3131protected:
    3232        /* Co-classes */
     33        Model_Info * model_info;
     34        Byteplex * byteplex;   
     35        Bitplex * bitplex;
    3336        Lexer_Interface * lexer;
    34         XML_Buffer_Interface * xml_buf;
    3537        /* Parallel data streams for current buffer full of XML data. */
    3638        BytePack * x8data;
     
    4547class ParsingEngine : public Parser_Interface {
    4648public:
    47         ParsingEngine(XML_Buffer_Interface * b);
     49        ParsingEngine(Model_Info * m, Byteplex * b);
    4850        ~ParsingEngine();
    4951        void ParseContent();
    5052protected:
    5153
     54        XML_Decl_Parser<C> * decl_parser;
     55       
    5256        int text_or_markup_start;
    5357        /* Getters for current point/position information. */
     
    6367        void ScanTo(int lex_item);
    6468
    65         void AdvanceBuffer();
     69        void AdvanceBuffers(int preserve_pos);
    6670        /* Parsing routines. */
    6771
     
    125129                                int URI_start, int URI_end);
    126130       
    127         void FinalizeBuffer_action();
     131        /*Action routine for end of buffer events.
     132         The preserve_pos should be set to indicate the position
     133         of data that must be copied into the new buffer.*/
     134        void FinalizeBuffer_action(int& preserve_pos);
    128135
    129136};
Note: See TracChangeset for help on using the changeset viewer.