1 /* dfa - DFA construction routines */
4 * Copyright (c) 1990 The Regents of the University of California.
7 * This code is derived from software contributed to Berkeley by
10 * The United States Government has rights in this work pursuant
11 * to contract no. DE-AC03-76SF00098 between the United States
12 * Department of Energy and the University of California.
14 * Redistribution and use in source and binary forms are permitted provided
15 * that: (1) source distributions retain this entire copyright notice and
16 * comment, and (2) distributions including binaries display the following
17 * acknowledgement: ``This product includes software developed by the
18 * University of California, Berkeley and its contributors'' in the
19 * documentation or other materials provided with the distribution and in
20 * all advertising materials mentioning features or use of this software.
21 * Neither the name of the University nor the names of its contributors may
22 * be used to endorse or promote products derived from this software without
23 * specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
25 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
26 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29 /* $Header: /home/daffy/u0/vern/flex/RCS/dfa.c,v 2.26 95/04/20 13:53:14 vern Exp $ */
30 /* $FreeBSD: src/usr.bin/lex/dfa.c,v 1.5 1999/10/27 07:56:43 obrien Exp $ */
31 /* $DragonFly: src/usr.bin/lex/dfa.c,v 1.3 2003/10/04 20:36:47 hmp Exp $ */
36 /* declare functions that have forward references */
38 void dump_associated_rules
PROTO((FILE*, int));
39 void dump_transitions
PROTO((FILE*, int[]));
40 void sympartition
PROTO((int[], int, int[], int[]));
41 int symfollowset
PROTO((int[], int, int, int[]));
44 /* check_for_backing_up - check a DFA state for backing up
47 * void check_for_backing_up( int ds, int state[numecs] );
49 * ds is the number of the state to check and state[] is its out-transitions,
50 * indexed by equivalence class.
53 void check_for_backing_up(int ds
, int *state
)
55 if ( (reject
&& ! dfaacc
[ds
].dfaacc_set
) ||
56 (! reject
&& ! dfaacc
[ds
].dfaacc_state
) )
57 { /* state is non-accepting */
60 if ( backing_up_report
)
62 fprintf( backing_up_file
,
63 _( "State #%d is non-accepting -\n" ), ds
);
65 /* identify the state */
66 dump_associated_rules( backing_up_file
, ds
);
68 /* Now identify it further using the out- and
71 dump_transitions( backing_up_file
, state
);
73 putc( '\n', backing_up_file
);
79 /* check_trailing_context - check to see if NFA state set constitutes
80 * "dangerous" trailing context
83 * void check_trailing_context( int nfa_states[num_states+1], int num_states,
84 * int accset[nacc+1], int nacc );
87 * Trailing context is "dangerous" if both the head and the trailing
88 * part are of variable size \and/ there's a DFA state which contains
89 * both an accepting state for the head part of the rule and NFA states
90 * which occur after the beginning of the trailing context.
92 * When such a rule is matched, it's impossible to tell if having been
93 * in the DFA state indicates the beginning of the trailing context or
94 * further-along scanning of the pattern. In these cases, a warning
97 * nfa_states[1 .. num_states] is the list of NFA states in the DFA.
98 * accset[1 .. nacc] is the list of accepting numbers for the DFA state.
101 void check_trailing_context(int *nfa_states
, int num_states
, int *accset
,
106 for ( i
= 1; i
<= num_states
; ++i
)
108 int ns
= nfa_states
[i
];
109 register int type
= state_type
[ns
];
110 register int ar
= assoc_rule
[ns
];
112 if ( type
== STATE_NORMAL
|| rule_type
[ar
] != RULE_VARIABLE
)
116 else if ( type
== STATE_TRAILING_CONTEXT
)
118 /* Potential trouble. Scan set of accepting numbers
119 * for the one marking the end of the "head". We
120 * assume that this looping will be fairly cheap
121 * since it's rare that an accepting number set
124 for ( j
= 1; j
<= nacc
; ++j
)
125 if ( accset
[j
] & YY_TRAILING_HEAD_MASK
)
128 _( "dangerous trailing context" ),
137 /* dump_associated_rules - list the rules associated with a DFA state
139 * Goes through the set of NFA states associated with the DFA and
140 * extracts the first MAX_ASSOC_RULES unique rules, sorts them,
141 * and writes a report to the given file.
144 void dump_associated_rules(FILE *file
, int ds
)
147 register int num_associated_rules
= 0;
148 int rule_set
[MAX_ASSOC_RULES
+ 1];
150 int size
= dfasiz
[ds
];
152 for ( i
= 1; i
<= size
; ++i
)
154 register int rule_num
= rule_linenum
[assoc_rule
[dset
[i
]]];
156 for ( j
= 1; j
<= num_associated_rules
; ++j
)
157 if ( rule_num
== rule_set
[j
] )
160 if ( j
> num_associated_rules
)
162 if ( num_associated_rules
< MAX_ASSOC_RULES
)
163 rule_set
[++num_associated_rules
] = rule_num
;
167 bubble( rule_set
, num_associated_rules
);
169 fprintf( file
, _( " associated rule line numbers:" ) );
171 for ( i
= 1; i
<= num_associated_rules
; ++i
)
176 fprintf( file
, "\t%d", rule_set
[i
] );
183 /* dump_transitions - list the transitions associated with a DFA state
186 * dump_transitions( FILE *file, int state[numecs] );
188 * Goes through the set of out-transitions and lists them in human-readable
189 * form (i.e., not as equivalence classes); also lists jam transitions
190 * (i.e., all those which are not out-transitions, plus EOF). The dump
191 * is done to the given file.
194 void dump_transitions(FILE *file
, int *state
)
197 int out_char_set
[CSIZE
];
199 for ( i
= 0; i
< csize
; ++i
)
201 ec
= ABS( ecgroup
[i
] );
202 out_char_set
[i
] = state
[ec
];
205 fprintf( file
, _( " out-transitions: " ) );
207 list_character_set( file
, out_char_set
);
209 /* now invert the members of the set to get the jam transitions */
210 for ( i
= 0; i
< csize
; ++i
)
211 out_char_set
[i
] = ! out_char_set
[i
];
213 fprintf( file
, _( "\n jam-transitions: EOF " ) );
215 list_character_set( file
, out_char_set
);
221 /* epsclosure - construct the epsilon closure of a set of ndfa states
224 * int *epsclosure( int t[num_states], int *numstates_addr,
225 * int accset[num_rules+1], int *nacc_addr,
226 * int *hashval_addr );
229 * The epsilon closure is the set of all states reachable by an arbitrary
230 * number of epsilon transitions, which themselves do not have epsilon
231 * transitions going out, unioned with the set of states which have non-null
232 * accepting numbers. t is an array of size numstates of nfa state numbers.
233 * Upon return, t holds the epsilon closure and *numstates_addr is updated.
234 * accset holds a list of the accepting numbers, and the size of accset is
235 * given by *nacc_addr. t may be subjected to reallocation if it is not
236 * large enough to hold the epsilon closure.
238 * hashval is the hash value for the dfa corresponding to the state set.
241 int *epsclosure(int *t
, int *ns_addr
, int *accset
, int *nacc_addr
, int *hv_addr
)
243 register int stkpos
, ns
, tsp
;
244 int numstates
= *ns_addr
, nacc
, hashval
, transsym
, nfaccnum
;
246 static int did_stk_init
= false, *stk
;
248 #define MARK_STATE(state) \
249 trans1[state] = trans1[state] - MARKER_DIFFERENCE;
251 #define IS_MARKED(state) (trans1[state] < 0)
253 #define UNMARK_STATE(state) \
254 trans1[state] = trans1[state] + MARKER_DIFFERENCE;
256 #define CHECK_ACCEPT(state) \
258 nfaccnum = accptnum[state]; \
259 if ( nfaccnum != NIL ) \
260 accset[++nacc] = nfaccnum; \
263 #define DO_REALLOCATION \
265 current_max_dfa_size += MAX_DFA_SIZE_INCREMENT; \
267 t = reallocate_integer_array( t, current_max_dfa_size ); \
268 stk = reallocate_integer_array( stk, current_max_dfa_size ); \
271 #define PUT_ON_STACK(state) \
273 if ( ++stkend >= current_max_dfa_size ) \
275 stk[stkend] = state; \
279 #define ADD_STATE(state) \
281 if ( ++numstates >= current_max_dfa_size ) \
283 t[numstates] = state; \
287 #define STACK_STATE(state) \
289 PUT_ON_STACK(state) \
290 CHECK_ACCEPT(state) \
291 if ( nfaccnum != NIL || transchar[state] != SYM_EPSILON ) \
296 if ( ! did_stk_init
)
298 stk
= allocate_integer_array( current_max_dfa_size
);
302 nacc
= stkend
= hashval
= 0;
304 for ( nstate
= 1; nstate
<= numstates
; ++nstate
)
308 /* The state could be marked if we've already pushed it onto
311 if ( ! IS_MARKED(ns
) )
319 for ( stkpos
= 1; stkpos
<= stkend
; ++stkpos
)
322 transsym
= transchar
[ns
];
324 if ( transsym
== SYM_EPSILON
)
326 tsp
= trans1
[ns
] + MARKER_DIFFERENCE
;
328 if ( tsp
!= NO_TRANSITION
)
330 if ( ! IS_MARKED(tsp
) )
335 if ( tsp
!= NO_TRANSITION
&& ! IS_MARKED(tsp
) )
341 /* Clear out "visit" markers. */
343 for ( stkpos
= 1; stkpos
<= stkend
; ++stkpos
)
345 if ( IS_MARKED(stk
[stkpos
]) )
346 UNMARK_STATE(stk
[stkpos
])
349 _( "consistency check failed in epsclosure()" ) );
352 *ns_addr
= numstates
;
360 /* increase_max_dfas - increase the maximum number of DFAs */
362 void increase_max_dfas(void)
364 current_max_dfas
+= MAX_DFAS_INCREMENT
;
368 base
= reallocate_integer_array( base
, current_max_dfas
);
369 def
= reallocate_integer_array( def
, current_max_dfas
);
370 dfasiz
= reallocate_integer_array( dfasiz
, current_max_dfas
);
371 accsiz
= reallocate_integer_array( accsiz
, current_max_dfas
);
372 dhash
= reallocate_integer_array( dhash
, current_max_dfas
);
373 dss
= reallocate_int_ptr_array( dss
, current_max_dfas
);
374 dfaacc
= reallocate_dfaacc_union( dfaacc
, current_max_dfas
);
378 reallocate_integer_array( nultrans
, current_max_dfas
);
382 /* ntod - convert an ndfa to a dfa
384 * Creates the dfa corresponding to the ndfa we've constructed. The
385 * dfa starts out in state #1.
390 int *accset
, ds
, nacc
, newds
;
391 int sym
, hashval
, numstates
, dsize
;
392 int num_full_table_rows
; /* used only for -f */
394 int targptr
, totaltrans
, i
, comstate
, comfreq
, targ
;
395 int symlist
[CSIZE
+ 1];
396 int num_start_states
;
397 int todo_head
, todo_next
;
399 /* Note that the following are indexed by *equivalence classes*
400 * and not by characters. Since equivalence classes are indexed
401 * beginning with 1, even if the scanner accepts NUL's, this
402 * means that (since every character is potentially in its own
403 * equivalence class) these arrays must have room for indices
404 * from 1 to CSIZE, so their size must be CSIZE + 1.
406 int duplist
[CSIZE
+ 1], state
[CSIZE
+ 1];
407 int targfreq
[CSIZE
+ 1], targstate
[CSIZE
+ 1];
409 accset
= allocate_integer_array( num_rules
+ 1 );
410 nset
= allocate_integer_array( current_max_dfa_size
);
412 /* The "todo" queue is represented by the head, which is the DFA
413 * state currently being processed, and the "next", which is the
414 * next DFA state number available (not in use). We depend on the
415 * fact that snstods() returns DFA's \in increasing order/, and thus
416 * need only know the bounds of the dfas to be processed.
418 todo_head
= todo_next
= 0;
420 for ( i
= 0; i
<= csize
; ++i
)
426 for ( i
= 0; i
<= num_rules
; ++i
)
432 fputs( _( "\n\nDFA Dump:\n\n" ), stderr
);
437 /* Check to see whether we should build a separate table for
438 * transitions on NUL characters. We don't do this for full-speed
439 * (-F) scanners, since for them we don't have a simple state
440 * number lying around with which to index the table. We also
441 * don't bother doing it for scanners unless (1) NUL is in its own
442 * equivalence class (indicated by a positive value of
443 * ecgroup[NUL]), (2) NUL's equivalence class is the last
444 * equivalence class, and (3) the number of equivalence classes is
445 * the same as the number of characters. This latter case comes
446 * about when useecs is false or when it's true but every character
447 * still manages to land in its own class (unlikely, but it's
448 * cheap to check for). If all these things are true then the
449 * character code needed to represent NUL's equivalence class for
450 * indexing the tables is going to take one more bit than the
451 * number of characters, and therefore we won't be assured of
452 * being able to fit it into a YY_CHAR variable. This rules out
453 * storing the transitions in a compressed table, since the code
454 * for interpreting them uses a YY_CHAR variable (perhaps it
455 * should just use an integer, though; this is worth pondering ...
458 * Finally, for full tables, we want the number of entries in the
459 * table to be a power of two so the array references go fast (it
460 * will just take a shift to compute the major index). If
461 * encoding NUL's transitions in the table will spoil this, we
462 * give it its own table (note that this will be the case if we're
463 * not using equivalence classes).
466 /* Note that the test for ecgroup[0] == numecs below accomplishes
467 * both (1) and (2) above
469 if ( ! fullspd
&& ecgroup
[0] == numecs
)
471 /* NUL is alone in its equivalence class, which is the
474 int use_NUL_table
= (numecs
== csize
);
476 if ( fulltbl
&& ! use_NUL_table
)
478 /* We still may want to use the table if numecs
483 for ( power_of_two
= 1; power_of_two
<= csize
;
485 if ( numecs
== power_of_two
)
487 use_NUL_table
= true;
493 nultrans
= allocate_integer_array( current_max_dfas
);
495 /* From now on, nultrans != nil indicates that we're
496 * saving null transitions for later, separate encoding.
503 for ( i
= 0; i
<= numecs
; ++i
)
506 place_state( state
, 0, 0 );
507 dfaacc
[0].dfaacc_state
= 0;
513 /* We won't be including NUL's transitions in the
514 * table, so build it for entries from 0 .. numecs - 1.
516 num_full_table_rows
= numecs
;
519 /* Take into account the fact that we'll be including
520 * the NUL entries in the transition table. Build it
523 num_full_table_rows
= numecs
+ 1;
525 /* Unless -Ca, declare it "short" because it's a real
526 * long-shot that that won't be large enough.
528 out_str_dec( "static yyconst %s yy_nxt[][%d] =\n {\n",
529 /* '}' so vi doesn't get too confused */
530 long_align
? "long" : "short", num_full_table_rows
);
534 /* Generate 0 entries for state #0. */
535 for ( i
= 0; i
< num_full_table_rows
; ++i
)
542 /* Create the first states. */
544 num_start_states
= lastsc
* 2;
546 for ( i
= 1; i
<= num_start_states
; ++i
)
550 /* For each start condition, make one state for the case when
551 * we're at the beginning of the line (the '^' operator) and
552 * one for the case when we're not.
555 nset
[numstates
] = scset
[(i
/ 2) + 1];
558 mkbranch( scbol
[i
/ 2], scset
[i
/ 2] );
560 nset
= epsclosure( nset
, &numstates
, accset
, &nacc
, &hashval
);
562 if ( snstods( nset
, numstates
, accset
, nacc
, hashval
, &ds
) )
568 if ( variable_trailing_context_rules
&& nacc
> 0 )
569 check_trailing_context( nset
, numstates
,
576 if ( ! snstods( nset
, 0, accset
, 0, 0, &end_of_buffer_state
) )
578 _( "could not create unique end-of-buffer state" ) );
585 while ( todo_head
< todo_next
)
590 for ( i
= 1; i
<= numecs
; ++i
)
599 fprintf( stderr
, _( "state # %d:\n" ), ds
);
601 sympartition( dset
, dsize
, symlist
, duplist
);
603 for ( sym
= 1; sym
<= numecs
; ++sym
)
609 if ( duplist
[sym
] == NIL
)
611 /* Symbol has unique out-transitions. */
612 numstates
= symfollowset( dset
, dsize
,
614 nset
= epsclosure( nset
, &numstates
,
615 accset
, &nacc
, &hashval
);
617 if ( snstods( nset
, numstates
, accset
,
618 nacc
, hashval
, &newds
) )
620 totnst
= totnst
+ numstates
;
625 variable_trailing_context_rules
&&
627 check_trailing_context(
635 fprintf( stderr
, "\t%d\t%d\n",
638 targfreq
[++targptr
] = 1;
639 targstate
[targptr
] = newds
;
645 /* sym's equivalence class has the same
646 * transitions as duplist(sym)'s
649 targ
= state
[duplist
[sym
]];
653 fprintf( stderr
, "\t%d\t%d\n",
656 /* Update frequency count for
661 while ( targstate
[++i
] != targ
)
673 if ( caseins
&& ! useecs
)
677 for ( i
= 'A', j
= 'a'; i
<= 'Z'; ++i
, ++j
)
679 if ( state
[i
] == 0 && state
[j
] != 0 )
680 /* We're adding a transition. */
683 else if ( state
[i
] != 0 && state
[j
] == 0 )
684 /* We're taking away a transition. */
691 numsnpairs
+= totaltrans
;
693 if ( ds
> num_start_states
)
694 check_for_backing_up( ds
, state
);
698 nultrans
[ds
] = state
[NUL_ec
];
699 state
[NUL_ec
] = 0; /* remove transition */
706 /* Supply array's 0-element. */
707 if ( ds
== end_of_buffer_state
)
708 mk2data( -end_of_buffer_state
);
710 mk2data( end_of_buffer_state
);
712 for ( i
= 1; i
< num_full_table_rows
; ++i
)
713 /* Jams are marked by negative of state
716 mk2data( state
[i
] ? state
[i
] : -ds
);
723 place_state( state
, ds
, totaltrans
);
725 else if ( ds
== end_of_buffer_state
)
726 /* Special case this state to make sure it does what
727 * it's supposed to, i.e., jam on end-of-buffer.
729 stack1( ds
, 0, 0, JAMSTATE
);
731 else /* normal, compressed state */
733 /* Determine which destination state is the most
734 * common, and how many transitions to it there are.
740 for ( i
= 1; i
<= targptr
; ++i
)
741 if ( targfreq
[i
] > comfreq
)
743 comfreq
= targfreq
[i
];
744 comstate
= targstate
[i
];
747 bldtbl( state
, ds
, totaltrans
, comstate
, comfreq
);
754 else if ( ! fullspd
)
756 cmptmps(); /* create compressed template entries */
758 /* Create tables for all the states with only one
763 mk1tbl( onestate
[onesp
], onesym
[onesp
], onenext
[onesp
],
771 flex_free( (void *) accset
);
772 flex_free( (void *) nset
);
776 /* snstods - converts a set of ndfa states into a dfa state
779 * is_new_state = snstods( int sns[numstates], int numstates,
780 * int accset[num_rules+1], int nacc,
781 * int hashval, int *newds_addr );
783 * On return, the dfa state number is in newds.
786 int snstods(int *sns
, int numstates
, int *accset
, int nacc
, int hashval
,
793 for ( i
= 1; i
<= lastdfa
; ++i
)
794 if ( hashval
== dhash
[i
] )
796 if ( numstates
== dfasiz
[i
] )
802 /* We sort the states in sns so we
803 * can compare it to oldsns quickly.
804 * We use bubble because there probably
805 * aren't very many states.
807 bubble( sns
, numstates
);
811 for ( j
= 1; j
<= numstates
; ++j
)
812 if ( sns
[j
] != oldsns
[j
] )
829 /* Make a new dfa. */
831 if ( ++lastdfa
>= current_max_dfas
)
836 dss
[newds
] = allocate_integer_array( numstates
+ 1 );
838 /* If we haven't already sorted the states in sns, we do so now,
839 * so that future comparisons with it can be made quickly.
843 bubble( sns
, numstates
);
845 for ( i
= 1; i
<= numstates
; ++i
)
846 dss
[newds
][i
] = sns
[i
];
848 dfasiz
[newds
] = numstates
;
849 dhash
[newds
] = hashval
;
854 dfaacc
[newds
].dfaacc_set
= (int *) 0;
856 dfaacc
[newds
].dfaacc_state
= 0;
863 /* We sort the accepting set in increasing order so the
864 * disambiguating rule that the first rule listed is considered
865 * match in the event of ties will work. We use a bubble
866 * sort since the list is probably quite small.
869 bubble( accset
, nacc
);
871 dfaacc
[newds
].dfaacc_set
= allocate_integer_array( nacc
+ 1 );
873 /* Save the accepting set for later */
874 for ( i
= 1; i
<= nacc
; ++i
)
876 dfaacc
[newds
].dfaacc_set
[i
] = accset
[i
];
878 if ( accset
[i
] <= num_rules
)
879 /* Who knows, perhaps a REJECT can yield
882 rule_useful
[accset
[i
]] = true;
885 accsiz
[newds
] = nacc
;
890 /* Find lowest numbered rule so the disambiguating rule
895 for ( i
= 1; i
<= nacc
; ++i
)
899 dfaacc
[newds
].dfaacc_state
= j
;
901 if ( j
<= num_rules
)
902 rule_useful
[j
] = true;
911 /* symfollowset - follow the symbol transitions one step
914 * numstates = symfollowset( int ds[current_max_dfa_size], int dsize,
915 * int transsym, int nset[current_max_dfa_size] );
918 int symfollowset(int *ds
, int dsize
, int transsym
, int *nset
)
920 int ns
, tsp
, sym
, i
, j
, lenccl
, ch
, numstates
, ccllist
;
924 for ( i
= 1; i
<= dsize
; ++i
)
925 { /* for each nfa state ns in the state set of ds */
931 { /* it's a character class */
933 ccllist
= cclmap
[sym
];
934 lenccl
= ccllen
[sym
];
938 for ( j
= 0; j
< lenccl
; ++j
)
940 /* Loop through negated character
943 ch
= ccltbl
[ccllist
+ j
];
949 /* Transsym isn't in negated
954 else if ( ch
== transsym
)
955 /* next 2 */ goto bottom
;
958 /* Didn't find transsym in ccl. */
959 nset
[++numstates
] = tsp
;
963 for ( j
= 0; j
< lenccl
; ++j
)
965 ch
= ccltbl
[ccllist
+ j
];
972 else if ( ch
== transsym
)
974 nset
[++numstates
] = tsp
;
980 else if ( sym
>= 'A' && sym
<= 'Z' && caseins
)
982 _( "consistency check failed in symfollowset" ) );
984 else if ( sym
== SYM_EPSILON
)
988 else if ( ABS( ecgroup
[sym
] ) == transsym
)
989 nset
[++numstates
] = tsp
;
998 /* sympartition - partition characters with same out-transitions
1001 * sympartition( int ds[current_max_dfa_size], int numstates,
1002 * int symlist[numecs], int duplist[numecs] );
1005 void sympartition(int *ds
, int numstates
, int *symlist
, int *duplist
)
1007 int tch
, i
, j
, k
, ns
, dupfwd
[CSIZE
+ 1], lenccl
, cclp
, ich
;
1009 /* Partitioning is done by creating equivalence classes for those
1010 * characters which have out-transitions from the given state. Thus
1011 * we are really creating equivalence classes of equivalence classes.
1014 for ( i
= 1; i
<= numecs
; ++i
)
1015 { /* initialize equivalence class list */
1021 dupfwd
[numecs
] = NIL
;
1023 for ( i
= 1; i
<= numstates
; ++i
)
1026 tch
= transchar
[ns
];
1028 if ( tch
!= SYM_EPSILON
)
1030 if ( tch
< -lastccl
|| tch
>= csize
)
1033 _( "bad transition character detected in sympartition()" ) );
1037 { /* character transition */
1038 int ec
= ecgroup
[tch
];
1040 mkechar( ec
, dupfwd
, duplist
);
1045 { /* character class */
1048 lenccl
= ccllen
[tch
];
1050 mkeccl( ccltbl
+ cclp
, lenccl
, dupfwd
,
1051 duplist
, numecs
, NUL_ec
);
1057 for ( k
= 0; k
< lenccl
; ++k
)
1059 ich
= ccltbl
[cclp
+ k
];
1064 for ( ++j
; j
< ich
; ++j
)
1068 for ( ++j
; j
<= numecs
; ++j
)
1073 for ( k
= 0; k
< lenccl
; ++k
)
1075 ich
= ccltbl
[cclp
+ k
];