Changeset 17 for trunk/src/engine.c


Ignore:
Timestamp:
Jan 13, 2008, 8:50:53 PM (11 years ago)
Author:
cameron
Message:

Initiating ASCII/EBCDIC selection using templates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/engine.c

    r16 r17  
    198198}
    199199
     200
    200201#include "multiliteral.h"
     202
    201203/* Now the XML recognizers. */
    202204
    203205inline bool ParsingEngine::at_EndTag_Start() const {
    204   return s2int16(x8dataPtr(0)) == c2int16('<', '/');
     206  return s2int16(x8dataPtr(0)) == c2int16<ASCII, '<', '/'>::value;
    205207}
    206208
    207209inline bool ParsingEngine::at_Comment_Start() const {
    208   return s4int32(x8dataPtr(0)) == c4int32('<', '!', '-', '-');
     210  return s4int32(x8dataPtr(0)) == c4int32<ASCII, '<', '!', '-', '-'>::value;
    209211}
    210212
    211213inline bool ParsingEngine::at_DoubleHyphen() const {
    212   return s2int16(x8dataPtr(0)) == c2int16('-', '-');
     214  return s2int16(x8dataPtr(0)) == c2int16<ASCII, '-', '-'>::value;
    213215}
    214216
    215217inline bool ParsingEngine::at_Comment_End() const {
    216   return s3int32(x8dataPtr(0)) == c3int32('-', '-', '>');
     218  return s3int32(x8dataPtr(0)) == c3int32<ASCII, '-', '-', '>'>::value;
    217219}
    218220
    219221inline bool ParsingEngine::at_CDATA_Start() const {
    220222  return s8int64(x8dataPtr(0)) ==
    221          c8int64('<', '!', '[', 'C', 'D', 'A', 'T', 'A');
     223         c8int64<ASCII, '<', '!', '[', 'C', 'D', 'A', 'T', 'A'>::value;
    222224}
    223225
    224226inline bool ParsingEngine::at_CDATA_End() const {
    225   return s3int32(x8dataPtr(0)) == c3int32(']', ']', '>');
     227  return s3int32(x8dataPtr(0)) == c3int32<ASCII, ']', ']', '>'>::value;
    226228}
    227229
    228230inline bool ParsingEngine::at_PI_Start() const {
    229   return s2int16(x8dataPtr(0)) == c2int16('<', '?');
     231  return s2int16(x8dataPtr(0)) == c2int16<ASCII, '<', '?'>::value;
    230232}
    231233
    232234inline bool ParsingEngine::at_PI_End() const {
    233   return s2int16(x8dataPtr(0)) == c2int16('?', '>');
     235  return s2int16(x8dataPtr(0)) == c2int16<ASCII, '?', '>'>::value;
    234236}
    235237
    236238inline bool ParsingEngine::at_EqualsDQuote() const {
    237   return s2int16(x8dataPtr(0)) == c2int16('=', '"');
     239  return s2int16(x8dataPtr(0)) == c2int16<ASCII, '=', '"'>::value;
    238240}
    239241
    240242inline bool ParsingEngine::at_EqualsSQuote() const {
    241   return s2int16(x8dataPtr(0)) == c2int16('=', '\'');
     243  return s2int16(x8dataPtr(0)) == c2int16<ASCII, '=', '\''>::value;
    242244}
    243245
    244246inline bool ParsingEngine::at_xmlns() const {
    245   return s5int64(x8dataPtr(0)) == c5int64('x', 'm', 'l', 'n', 's');
     247  return s5int64(x8dataPtr(0)) == c5int64<ASCII, 'x', 'm', 'l', 'n', 's'>::value;
    246248}
    247249
    248250inline bool ParsingEngine::at_EmptyElementDelim() const {
    249   return s2int16(x8dataPtr(0)) == c2int16('/', '>');
     251  return s2int16(x8dataPtr(0)) == c2int16<ASCII, '/', '>'>::value;
    250252}
    251253
    252254inline bool ParsingEngine::at_XmlDecl_start() const {
    253   return (s5int64(x8dataPtr(0)) == c5int64('<', '?', 'x', 'm', 'l')) &&
     255  return (s5int64(x8dataPtr(0)) == c5int64<ASCII, '<', '?', 'x', 'm', 'l'>::value) &&
    254256         ASCII_WS_at(5);
    255257}
    256258
    257259inline bool ParsingEngine::at_version() const {
    258   return s7int64(x8dataPtr(0)) == c7int64('v', 'e', 'r', 's', 'i', 'o', 'n');
     260  return s7int64(x8dataPtr(0)) == c7int64<ASCII, 'v', 'e', 'r', 's', 'i', 'o', 'n'>::value;
    259261}
    260262
    261263inline bool ParsingEngine::at_1_0() const {
    262   return (s5int64(x8dataPtr(0)) == c5int64('"', '1', '.', '0', '"')) ||
    263          (s5int64(x8dataPtr(0)) == c5int64('\'', '1', '.', '0', '\''));
     264  return (s5int64(x8dataPtr(0)) == c5int64<ASCII, '"', '1', '.', '0', '"'>::value) ||
     265         (s5int64(x8dataPtr(0)) == c5int64<ASCII, '\'', '1', '.', '0', '\''>::value);
    264266}
    265267
    266268inline bool ParsingEngine::at_1_1() const {
    267   return (s5int64(x8dataPtr(0)) == c5int64('"', '1', '.', '1', '"')) ||
    268          (s5int64(x8dataPtr(0)) == c5int64('\'', '1', '.', '1', '\''));
     269  return (s5int64(x8dataPtr(0)) == c5int64<ASCII, '"', '1', '.', '1', '"'>::value) ||
     270         (s5int64(x8dataPtr(0)) == c5int64<ASCII, '\'', '1', '.', '1', '\''>::value);
    269271}
    270272
    271273inline bool ParsingEngine::at_encoding() const {
    272   return s8int64(x8dataPtr(0)) == c8int64('e', 'n', 'c', 'o', 'd', 'i', 'n', 'g');
     274  return s8int64(x8dataPtr(0)) == c8int64<ASCII, 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g'>::value;
    273275}
    274276
    275277inline bool ParsingEngine::at_standalone() const {
    276   return (s8int64(x8dataPtr(0)) == c8int64('s', 't', 'a', 'n', 'd', 'a', 'l', 'o')) &
    277          (s2int16(x8dataPtr(8)) == c2int16('n', 'e'));
     278  return (s8int64(x8dataPtr(0)) == c8int64<ASCII, 's', 't', 'a', 'n', 'd', 'a', 'l', 'o'>::value) &
     279         (s2int16(x8dataPtr(8)) == c2int16<ASCII, 'n', 'e'>::value);
    278280}
    279281
    280282inline bool ParsingEngine::at_yes() const {
    281   return (s5int64(x8dataPtr(0)) == c5int64('"', 'y', 'e', 's', '"')) |
    282          (s5int64(x8dataPtr(0)) == c5int64('\'', 'y', 'e', 's', '\''));
     283  return (s5int64(x8dataPtr(0)) == c5int64<ASCII, '"', 'y', 'e', 's', '"'>::value) |
     284         (s5int64(x8dataPtr(0)) == c5int64<ASCII, '\'', 'y', 'e', 's', '\''>::value);
    283285}
    284286
    285287inline bool ParsingEngine::at_no() const {
    286   return (s4int32(x8dataPtr(0)) == c4int32('"', 'n', 'o', '"')) |
    287          (s4int32(x8dataPtr(0)) == c4int32('\'', 'n', 'o', '\''));
     288  return (s4int32(x8dataPtr(0)) == c4int32<ASCII, '"', 'n', 'o', '"'>::value) |
     289         (s4int32(x8dataPtr(0)) == c4int32<ASCII, '\'', 'n', 'o', '\''>::value);
    288290}
    289291
     
    403405        // Check for illegal [Xx][Mm][Ll] target.
    404406        if ((AbsPos() - markup_start == 5) &&
    405             ((s3int32(x8dataPtr(-3)) | c3int32(0x20, 0x20, 0x20)) == c3int32('x', 'm', 'l'))) {
     407            ((s3int32(x8dataPtr(-3)) | c3int32<ASCII, 0x20, 0x20, 0x20>::value)
     408                == c3int32<ASCII, 'x', 'm', 'l'>::value)) {
    406409                Error_action(markup_start, AbsPos());
    407410                return;
Note: See TracChangeset for help on using the changeset viewer.