Changeset 267 for trunk/src/engine.h


Ignore:
Timestamp:
Mar 20, 2009, 12:18:53 PM (11 years ago)
Author:
ksherdy
Message:

Construct and pass string literals as read only (const char *) types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/engine.h

    r263 r267  
    99#define ENGINE_H
    1010
    11 /*  Parabix provides strings to the application using the WorkingCharacterSet. 
     11/*  Parabix provides strings to the application using the WorkingCharacterSet.
    1212    This parameter is set by template instantiation; normally only one
    1313    WorkingCharacterSet parameter is chosen.  However, it is possible
     
    3434public:
    3535        virtual ~Parser_Interface();
    36         static Parser_Interface * ParserFactory(char * filename);
    37         static Parser_Interface * ParserFactory(char * filename, Model_Info * m);
     36        static Parser_Interface * ParserFactory(const char * filename);
     37        static Parser_Interface * ParserFactory(const char * filename, Model_Info * m);
    3838        // Constructor for a subsidiary parser for internal entities.
    39         static Parser_Interface * ParserFactory(char * byte_buffer, int byte_count, Entity_Info * e, Model_Info * m);
     39        static Parser_Interface * ParserFactory(const char * byte_buffer, int byte_count, Entity_Info * e, Model_Info * m);
    4040        virtual void ParseContent() = 0;
    4141        virtual void Parse_DocumentContent() = 0;
     
    5757
    5858        /* Action routine for document start. */
    59         void DocumentStart_action();   
    60        
     59        void DocumentStart_action();
     60
    6161        /* Action routine for document end. */
    6262        void DocumentEnd_action();
    63        
     63
    6464        /* Action routine for an XML comment in "<!--"  "-->" brackets. */
    6565        void Comment_action(unsigned char * item, int lgth);
    66        
     66
    6767        /* Action routine called upon recognizing "<![CDATA[" to start a CDATA section. */
    6868        void CDATA_start_action(unsigned char * CDATA_ptr);
     
    7070        /* Action routine called upon recognizing "]]>" to end a CDATA section. */
    7171        void CDATA_end_action(unsigned char * CDATA_end_ptr);
    72        
     72
    7373        /* Action routine for an XML processing instruction enclosed in "<?" and "?>" brackets. */
    7474        void PI_action(unsigned char * item, int lgth);
    75        
     75
    7676        /* Action routine for an empty element enclosed in "<" and "/>" brackets. */
    7777        void EmptyElement_action(unsigned char * item, int lgth);
    78        
     78
    7979        /* Action routine for a start tag enclosed in "<" and ">" brackets. */
    8080        void StartTag_action(unsigned char * item, int lgth);
    81        
     81
    8282        /* Action routine for an end tag enclosed in "</" and ">" brackets. */
    8383        void EndTag_action(unsigned char * item, int lgth);
    84        
     84
    8585        /* Action routine for an error item */
    8686        void Error_action(unsigned char * item, int lgth);
    87        
     87
    8888        /* Action routine for a text item */
    8989        void Text_action(unsigned char * item, int lgth, bool more);
    90        
     90
    9191        /* Action routine for a character or entity reference.*/
    9292        void Reference_action(unsigned char * item, int lgth);
    93        
    94         /* Action routine for an element name occurring immediately after the 
     93
     94        /* Action routine for an element name occurring immediately after the
    9595        opening "<" of a start tag or empty element tag. */
    9696        void ElementName_action(unsigned char * item, int lgth);
    97        
    98         /* Action routine for a processing instruction target name occurring immediately 
     97
     98        /* Action routine for a processing instruction target name occurring immediately
    9999        after the opening "<?" of a processing instruction. */
    100100        void PI_Target_action(unsigned char * item, int lgth);
    101        
     101
    102102        /* Action routine for an individual attribute/value pair occurring in
    103103        a element start tag or an empty element tag. */
    104         void AttributeValue_action(unsigned char * name, int name_lgth, 
     104        void AttributeValue_action(unsigned char * name, int name_lgth,
    105105                                   unsigned char * val, int val_lgth);
    106        
     106
    107107        /* Action routine for an individual namespace binding occurring in
    108108        a element start tag or an empty element tag. */
    109         void Namespace_action(unsigned char * name, int name_end, 
     109        void Namespace_action(unsigned char * name, int name_end,
    110110                              unsigned char * URI, int URI_end);
    111        
     111
    112112        /*Action routine for end of buffer events. */
    113113        void FinalizeBuffer_action();
    114        
     114
    115115        /*Document Type actions.*/
    116116        void Doctype_action(unsigned char * item, int lgth);
    117117        void PEReference_action(unsigned char * item, int lgth);
    118        
     118
    119119        void Prolog_action(unsigned char * item, int lgth);
    120        
     120
    121121        void ExtSubsetDecl_action(unsigned char * item, int lgth);
    122        
     122
    123123};
    124124
     
    134134        vector<int> LastAttOccurrence;
    135135        XML_Decl_Parser<B::Base> * decl_parser;
    136        
     136
    137137        int text_or_markup_start;
    138138        /* Getters for current point/position information. */
     
    157157        void Validity_Error (XML_Constraint errCode);
    158158        void Syntax_Error (XML_NonTerminal errNT);
    159        
     159
    160160        void Parse_Comment ();
    161161        void Parse_StartTag ();
     
    163163        void Parse_CDATA ();
    164164        void Parse_PI ();
    165         void Parse_CharRef (); 
     165        void Parse_CharRef ();
    166166        void Parse_EntityRef ();
    167167        void Parse_EntityRef_inMixed(symbol_set_t elems);
    168168        void Parse_EntityRef_inAnyContent();
    169        
     169
    170170        /* Parsing routine for Document Type*/
    171171        void Parse_DocType ();
     
    193193        void Parse_Prolog();
    194194        void Parse_DocumentContent();
    195        
     195
    196196        void Parse_WF_Element();
    197197        void Parse_WF_Content();
     
    204204        void Parse_AnyContent();
    205205        void Parse_MixedContent(symbol_set_t elems);
    206        
     206
    207207        int Parse_ValidStartTag(bool& is_empty);
    208        
     208
    209209        int Parse_Nmtoken();
    210         int Parse_Name(); 
    211        
     210        int Parse_Name();
     211
    212212        /*Parsing routine for external entities*/
    213213        void Parse_ExtSubsetDecl ();
    214        
     214
    215215protected:
    216216        /* Co-classes */
    217217
    218         Byteplex * byteplex;   
     218        Byteplex * byteplex;
    219219        Bitplex * bitplex;
    220220        Lexer_Interface * lexer;
     
    222222        BytePack * x8data;
    223223        LexicalStreamSet * buf;
    224                
     224
    225225        int buffer_base_pos;
    226226        int buffer_rel_pos;
Note: See TracChangeset for help on using the changeset viewer.