示例#1
0
 private static int Txt_calc(
     Texvc_ctx ctx,
     Texvc_root root,
     byte[] src,
     int src_len,
     int bgn_pos,
     int txt_bgn,
     int txt_uid) {
   if (txt_uid == -1) // no existing txt_tkn; create new one
   txt_uid = root.Regy__add(Texvc_tkn_.Tid__text, Texvc_tkn_.Tid__text, txt_bgn, bgn_pos, null);
   else // existing txt_tkn; happens for false matches; EX: abc[[\nef[[a]]; see NOTE_1
   root.Regy__update_end(txt_uid, bgn_pos);
   return txt_uid;
 }
示例#2
0
 public void Parse(Texvc_ctx ctx, Texvc_root root, byte[] src) {
   int src_len = src.length;
   ctx.Clear();
   root.Init_as_root(ctx.Tkn_mkr(), src, 0, src.length);
   Parse(root, ctx, ctx.Lxr_trie(), src, src_len, 0, src_len);
 }