Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/gfx/harfbuzz/src/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 11 kB image not shown  

Quelle  hb-ot-shaper-khmer-machine.hh

  Sprache: C
 


#line 1 "hb-ot-shaper-khmer-machine.rl"
/*
 * Copyright © 2011,2012  Google, Inc.
 *
 *  This is part of HarfBuzz, a text shaping library.
 *
 * Permission is hereby granted, without written agreement and without
 * license or royalty fees, to use, copy, modify, and distribute this
 * software and its documentation for any purpose, provided that the
 * above copyright notice and the following two paragraphs appear in
 * all copies of this software.
 *
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Google Author(s): Behdad Esfahbod
 */


#ifndef HB_OT_SHAPER_KHMER_MACHINE_HH
#define HB_OT_SHAPER_KHMER_MACHINE_HH

#include "hb.hh"

#include "hb-ot-layout.hh"
#include "hb-ot-shaper-indic.hh"

/* buffer var allocations */
#define khmer_category() ot_shaper_var_u8_category() /* khmer_category_t */

using khmer_category_t = unsigned;

#define K_Cat(Cat) khmer_syllable_machine_ex_##Cat

enum khmer_syllable_type_t {
  khmer_consonant_syllable,
  khmer_broken_cluster,
  khmer_non_khmer_cluster,
};


#line 52 "hb-ot-shaper-khmer-machine.hh"
#define khmer_syllable_machine_ex_C 1u
#define khmer_syllable_machine_ex_DOTTEDCIRCLE 11u
#define khmer_syllable_machine_ex_H 4u
#define khmer_syllable_machine_ex_PLACEHOLDER 10u
#define khmer_syllable_machine_ex_Ra 15u
#define khmer_syllable_machine_ex_Robatic 25u
#define khmer_syllable_machine_ex_V 2u
#define khmer_syllable_machine_ex_VAbv 20u
#define khmer_syllable_machine_ex_VBlw 21u
#define khmer_syllable_machine_ex_VPre 22u
#define khmer_syllable_machine_ex_VPst 23u
#define khmer_syllable_machine_ex_Xgroup 26u
#define khmer_syllable_machine_ex_Ygroup 27u
#define khmer_syllable_machine_ex_ZWJ 6u
#define khmer_syllable_machine_ex_ZWNJ 5u


#line 70 "hb-ot-shaper-khmer-machine.hh"
static const unsigned char _khmer_syllable_machine_trans_keys[] = {
 5u, 26u, 5u, 26u, 1u, 15u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 
 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 1u, 15u, 5u, 26u, 5u, 26u, 
 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 1u, 27u, 4u, 27u, 1u, 15u, 
 4u, 27u, 4u, 27u, 27u, 27u, 4u, 27u, 4u, 27u, 4u, 27u, 4u, 27u, 4u, 27u, 
 4u, 27u, 1u, 15u, 4u, 27u, 4u, 27u, 27u, 27u, 4u, 27u, 4u, 27u, 4u, 27u, 
 4u, 27u, 4u, 27u, 5u, 26u, 0
};

static const char _khmer_syllable_machine_key_spans[] = {
 2222152222222222
 2222222222152222
 2222222222272415
 242412424242424
 241524241242424
 242422
};

static const short _khmer_syllable_machine_index_offsets[] = {
 023466285108131154
 177200223246269292308331
 354377400423446469497522
 538563588590615640665690
 715740756781806808833858
 883908933
};

static const char _khmer_syllable_machine_indicies[] = {
 11000000
 00000002
 00003401
 10000000
 00000000
 00004055
 00000000
 00005011
 00000000
 00000200
 00040660
 00000000
 00000000
 00207700
 00000000
 00000000
 08099000
 00000000
 00200000
 100990000
 00000000
 000000010
 0111100000
 00000000
 200000120
 1111000000
 00000000
 000001201
 10000000
 00000020
 00013401515
 1414141414141414
 1414141414161414
 1414171814151519
 1919191919191919
 1919191919191919
 1919181920201414
 1414141414141414
 1414201415151414
 1414141414141414
 1414141614141414
 1418142121141414
 1414141414141414
 1414141414141414
 1614222214141414
 1414141414141414
 1414141414141423
 1424241414141414
 1414141414141414
 1614141414142514
 2424141414141414
 1414141414141414
 1414141414251426
 2614141414141414
 1414141414141614
 1414141427142626
 1414141414141414
 1414141414141414
 1414142714292928
 3031312828281313
 2828282928282828
 1625272328171820
 2833343432323232
 3232323232323232
 3221012832134
 532353532323232
 3232323232323232
 3532333636323232
 3232323232323232
 3232210128323
 45323738383232
 3232323232323232
 32323221012832
 324532532376
 632323232323232
 3232323232323232
 3283232253237
 77323232323232
 3232323232323232
 32323232328532
 3739393232323232
 3232323232323232
 2323283232105
 3237404032323232
 3232323232323232
 32210328323212
 532333838323232
 3232323232323232
 32322101283232
 45323338383232
 3232323232323232
 32323221012832
 3453242424141
 4141414141414141
 4141424130434341
 4141414141414141
 4141414116252723
 4117182041444545
 4141414141414141
 4141414141162527
 2341411820412041
 4421214141414141
 4141414141414141
 4141412341411620
 4144222241414141
 4141414141414141
 4141414141414123
 2041444646414141
 4141414141414141
 4141164141234141
 2520414447474141
 4141414141414141
 4141411625412341
 4127204130454541
 4141414141414141
 4141414116252723
 4141182041151548
 4848484848484848
 4848484816484848
 484818480
};

static const char _khmer_syllable_machine_trans_targs[] = {
 2112731252645
 28729930322112
 3741352136151638
 1839204021223342
 212310240236
 821341113141719
 21
};

static const char _khmer_syllable_machine_trans_actions[] = {
 10222000
 20202230
 24450002
 02028209
 100020000
 011400000
 12
};

static const char _khmer_syllable_machine_to_state_actions[] = {
 00000000
 00000000
 00000600
 00000000
 00000000
 000
};

static const char _khmer_syllable_machine_from_state_actions[] = {
 00000000
 00000000
 00000700
 00000000
 00000000
 000
};

static const short _khmer_syllable_machine_eof_trans[] = {
 11111111
 1111520151515
 151515151503333
 3333333333333333
 3342424242424242
 424249
};

static const int khmer_syllable_machine_start = 21;
static const int khmer_syllable_machine_first_final = 21;
static const int khmer_syllable_machine_error = -1;

static const int khmer_syllable_machine_en_main = 21;


#line 53 "hb-ot-shaper-khmer-machine.rl"



#line 102 "hb-ot-shaper-khmer-machine.rl"


#define found_syllable(syllable_type) \
  HB_STMT_START { \
    if (0) fprintf (stderr, "syllable %u..%u %s\n", ts, te, #syllable_type); \
    for (unsigned int i = ts; i < te; i++) \
      info[i].syllable() = (syllable_serial << 4) | syllable_type; \
    syllable_serial++; \
    if (syllable_serial == 16) syllable_serial = 1; \
  } HB_STMT_END

inline void
find_syllables_khmer (hb_buffer_t *buffer)
{
  unsigned int p, pe, eof, ts, te, act HB_UNUSED;
  int cs;
  hb_glyph_info_t *info = buffer->info;
  
#line 298 "hb-ot-shaper-khmer-machine.hh"
 {
 cs = khmer_syllable_machine_start;
 ts = 0;
 te = 0;
 act = 0;
 }

#line 122 "hb-ot-shaper-khmer-machine.rl"


  p = 0;
  pe = eof = buffer->len;

  unsigned int syllable_serial = 1;
  
#line 314 "hb-ot-shaper-khmer-machine.hh"
 {
 int _slen;
 int _trans;
 const unsigned char *_keys;
 const char *_inds;
 if ( p == pe )
  goto _test_eof;
_resume:
 switch ( _khmer_syllable_machine_from_state_actions[cs] ) {
 case 7:
#line 1 "NONE"
 {ts = p;}
 break;
#line 328 "hb-ot-shaper-khmer-machine.hh"
 }

 _keys = _khmer_syllable_machine_trans_keys + (cs<<1);
 _inds = _khmer_syllable_machine_indicies + _khmer_syllable_machine_index_offsets[cs];

 _slen = _khmer_syllable_machine_key_spans[cs];
 _trans = _inds[ _slen > 0 && _keys[0] <=( info[p].khmer_category()) &&
  ( info[p].khmer_category()) <= _keys[1] ?
  ( info[p].khmer_category()) - _keys[0] : _slen ];

_eof_trans:
 cs = _khmer_syllable_machine_trans_targs[_trans];

 if ( _khmer_syllable_machine_trans_actions[_trans] == 0 )
  goto _again;

 switch ( _khmer_syllable_machine_trans_actions[_trans] ) {
 case 2:
#line 1 "NONE"
 {te = p+1;}
 break;
 case 8:
#line 98 "hb-ot-shaper-khmer-machine.rl"
 {te = p+1;{ found_syllable (khmer_non_khmer_cluster); }}
 break;
 case 10:
#line 96 "hb-ot-shaper-khmer-machine.rl"
 {te = p;p--;{ found_syllable (khmer_consonant_syllable); }}
 break;
 case 11:
#line 97 "hb-ot-shaper-khmer-machine.rl"
 {te = p;p--;{ found_syllable (khmer_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; }}
 break;
 case 12:
#line 98 "hb-ot-shaper-khmer-machine.rl"
 {te = p;p--;{ found_syllable (khmer_non_khmer_cluster); }}
 break;
 case 1:
#line 96 "hb-ot-shaper-khmer-machine.rl"
 {{p = ((te))-1;}{ found_syllable (khmer_consonant_syllable); }}
 break;
 case 3:
#line 97 "hb-ot-shaper-khmer-machine.rl"
 {{p = ((te))-1;}{ found_syllable (khmer_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; }}
 break;
 case 5:
#line 1 "NONE"
 { switch( act ) {
 case 2:
 {{p = ((te))-1;} found_syllable (khmer_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; }
 break;
 case 3:
 {{p = ((te))-1;} found_syllable (khmer_non_khmer_cluster); }
 break;
 }
 }
 break;
 case 4:
#line 1 "NONE"
 {te = p+1;}
#line 97 "hb-ot-shaper-khmer-machine.rl"
 {act = 2;}
 break;
 case 9:
#line 1 "NONE"
 {te = p+1;}
#line 98 "hb-ot-shaper-khmer-machine.rl"
 {act = 3;}
 break;
#line 398 "hb-ot-shaper-khmer-machine.hh"
 }

_again:
 switch ( _khmer_syllable_machine_to_state_actions[cs] ) {
 case 6:
#line 1 "NONE"
 {ts = 0;}
 break;
#line 407 "hb-ot-shaper-khmer-machine.hh"
 }

 if ( ++p != pe )
  goto _resume;
 _test_eof: {}
 if ( p == eof )
 {
 if ( _khmer_syllable_machine_eof_trans[cs] > 0 ) {
  _trans = _khmer_syllable_machine_eof_trans[cs] - 1;
  goto _eof_trans;
 }
 }

 }

#line 130 "hb-ot-shaper-khmer-machine.rl"

}

#undef found_syllable

#endif /* HB_OT_SHAPER_KHMER_MACHINE_HH */

Messung V0.5 in Prozent
C=94 H=96 G=94

¤ Dauer der Verarbeitung: 0.20 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.