1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <inttypes.h>
4 # define U(x) x
5 # define NLSTATE yyprevious=YYNEWLINE
6 # define BEGIN yybgin = yysvec + 1 +
7 # define INITIAL 0
8 # define YYLERR yysvec
9 # define YYSTATE (yyestate-yysvec-1)
10 # define YYOPTIM 1
11 # ifndef YYLMAX
12 # define YYLMAX BUFSIZ
13 # endif
14 #ifndef __cplusplus
15 # define output(c) (void)putc(c,yyout)
16 #else
17 # define lex_output(c) (void)putc(c,yyout)
18 #endif
19 
20 #if defined(__cplusplus) || defined(__STDC__)
21 
22 #if defined(__cplusplus) && defined(__EXTERN_C__)
23 extern "C" {
24 #endif
25 	int yyback(int *, int);
26 	int yyinput(void);
27 	int yylook(void);
28 	void yyoutput(int);
29 	int yyracc(int);
30 	int yyreject(void);
31 	void yyunput(int);
32 	int yylex(void);
33 #ifdef YYLEX_E
34 	void yywoutput(wchar_t);
35 	wchar_t yywinput(void);
36 	void yywunput(wchar_t);
37 #endif
38 #ifndef yyless
39 	int yyless(int);
40 #endif
41 #ifndef yywrap
42 	int yywrap(void);
43 #endif
44 #ifdef LEXDEBUG
45 	void allprint(char);
46 	void sprint(char *);
47 #endif
48 #if defined(__cplusplus) && defined(__EXTERN_C__)
49 }
50 #endif
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 	void exit(int);
56 #ifdef __cplusplus
57 }
58 #endif
59 
60 #endif
61 # define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}
62 # define yymore() (yymorfg=1)
63 #ifndef __cplusplus
64 # define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
65 #else
66 # define lex_input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
67 #endif
68 #define ECHO fprintf(yyout, "%s",yytext)
69 # define REJECT { nstr = yyreject(); goto yyfussy;}
70 int yyleng;
71 #define YYISARRAY
72 char yytext[YYLMAX];
73 int yymorfg;
74 extern char *yysptr, yysbuf[];
75 int yytchar;
76 FILE *yyin = {stdin}, *yyout = {stdout};
77 extern int yylineno;
78 struct yysvf {
79 	struct yywork *yystoff;
80 	struct yysvf *yyother;
81 	int *yystops;};
82 struct yysvf *yyestate;
83 extern struct yysvf yysvec[], *yybgin;
84 
85 # line 3 "genmsg.l"
86 /*
87  * CDDL HEADER START
88  *
89  * The contents of this file are subject to the terms of the
90  * Common Development and Distribution License (the "License").
91  * You may not use this file except in compliance with the License.
92  *
93  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
94  * or http://www.opensolaris.org/os/licensing.
95  * See the License for the specific language governing permissions
96  * and limitations under the License.
97  *
98  * When distributing Covered Code, include this CDDL HEADER in each
99  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
100  * If applicable, add the following below this CDDL HEADER, with the
101  * fields enclosed by brackets "[]" replaced with your own identifying
102  * information: Portions Copyright [yyyy] [name of copyright owner]
103  *
104  * CDDL HEADER END
105  */
106 
107 # line 23 "genmsg.l"
108 /*
109  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
110  * Use is subject to license terms.
111  */
112 
113 #include <stdio.h>
114 #include <stdlib.h>
115 #include <limits.h>
116 #include <string.h>
117 #include <libintl.h>
118 #include <locale.h>
119 #include "genmsg.h"
120 #include "y.tab.h"
121 
122 extern int is_cat_found;	/* from main.c */
123 extern void add_comment(Mode, char *);	/* from util.c */
124 
125 int lineno = 1;
126 
127 
128 # line 42 "genmsg.l"
129 /*
130  * msg_line stores the line number where a msgid is to be replaced.
131  */
132 int msg_line = 0;
133 
134 int end_of_cat = TRUE;
135 
136 
137 # line 49 "genmsg.l"
138 /*
139  * In preprocessor mode, genmsg has to parse both the original
140  * soruce code and the code which a preprocessor generates.
141  * While genmsg is parsing the original source code,  'pound_is_mine'
142  * is set to TRUE.
143  */
144 int pound_is_mine = FALSE;
145 
146 void warning(char *);
147 
148 #define	NOLINEMSG	-2
149 
150 void set_linemsgid(int, int);
151 int get_linemsgid(int);
152 
153 
154 # line 64 "genmsg.l"
155 /*
156  * cat_field indicates which token is currently parsed by lex.
157  */
158 #define	CatdField	0
159 #define	SetidField	1
160 #define	MsgidField	2
161 #define	StrField	3
162 
163 static int cat_field;
164 
165 
166 # line 74 "genmsg.l"
167 /*
168  * This will be turned on when '-' is found in the catgets message
169  * number field.
170  */
171 static int save_minus = FALSE;
172 
173 static char *skip_quoted(int skip_ch);
174 static char *skip_comment(void);
175 static void parse_cppline(char *);
176 # define CAT 2
177 # define YYNEWLINE 10
178 int yylex(){
179 int nstr; extern int yyprevious;
180 #ifdef __cplusplus
181 /* to avoid CC and lint complaining yyfussy not being used ...*/
182 static int __lex_hack = 0;
183 if (__lex_hack) goto yyfussy;
184 #endif
185 while((nstr = yylook()) >= 0)
186 yyfussy: switch(nstr){
187 case 0:
188 if(yywrap()) return(0); break;
189 case 1:
190 
191 # line 86 "genmsg.l"
192 {
193 			if (IsActiveMode(ReplaceMode)) {
194 				(void) fprintf(newfp, "%s", yytext);
195 			}
196 		}
197 break;
198 case 2:
199 
200 # line 92 "genmsg.l"
201 {
202 			if (IsActiveMode(ReplaceMode)) {
203 				(void) fprintf(newfp, "%s", yytext);
204 			}
205 		}
206 break;
207 case 3:
208 
209 # line 98 "genmsg.l"
210 	{
211 			if (end_of_cat) {
212 				/*
213 				 * If the previous catgets
214 				 * state is on, turn it off
215 				 * first.
216 				 */
217 				BEGIN 0;
218 			}
219 			if (IsActiveMode(ReplaceMode)) {
220 				(void) fprintf(newfp, "%s", yytext);
221 			}
222 			if (!IsActiveMode(ReplaceMode) ||
223 			    !IsActiveMode(PreProcessMode)) {
224 				BEGIN CAT;
225 				end_of_cat = FALSE;
226 				cat_field = CatdField;
227 				return (CATGETS);
228 			}
229 		}
230 break;
231 case 4:
232 
233 # line 119 "genmsg.l"
234 	{	/* punctuation */
235 			cat_field++;
236 			if (IsActiveMode(ReplaceMode)) {
237 				(void) fprintf(newfp, "%c", yytext[0]);
238 			}
239 			if (end_of_cat) {
240 				BEGIN 0;
241 			} else {
242 				return (yytext[0]);
243 			}
244 		}
245 break;
246 case 5:
247 
248 # line 131 "genmsg.l"
249 {	/* punctuation */
250 			if (IsActiveMode(ReplaceMode)) {
251 				(void) fprintf(newfp, "%c", yytext[0]);
252 			}
253 			if (end_of_cat) {
254 				BEGIN 0;
255 			} else {
256 				return (yytext[0]);
257 			}
258 		}
259 break;
260 case 6:
261 
262 # line 142 "genmsg.l"
263 {
264 			if (IsActiveMode(ReplaceMode)) {
265 				(void) fprintf(newfp, "%s", yytext);
266 			}
267 			if (end_of_cat) {
268 				BEGIN 0;
269 			} else {
270 				return (CONST);
271 			}
272 		}
273 break;
274 case 7:
275 
276 # line 153 "genmsg.l"
277 {
278 			if (IsActiveMode(ReplaceMode)) {
279 				(void) fprintf(newfp, "%s", yytext);
280 			}
281 			if (end_of_cat) {
282 				BEGIN 0;
283 			} else {
284 				return (CATD);
285 			}
286 		}
287 break;
288 case 8:
289 
290 # line 164 "genmsg.l"
291 {
292 			if (IsActiveMode(ReplaceMode)) {
293 				(void) fprintf(newfp, "%s", yytext);
294 			}
295 			if (end_of_cat) {
296 				BEGIN 0;
297 			} else {
298 				return (CHAR);
299 			}
300 		}
301 break;
302 case 9:
303 
304 # line 175 "genmsg.l"
305 {
306 			if (IsActiveMode(ReplaceMode)) {
307 				(void) fprintf(newfp, "%s", yytext);
308 			}
309 			if (end_of_cat) {
310 				BEGIN 0;
311 			} else {
312 				return (INT);
313 			}
314 		}
315 break;
316 case 10:
317 
318 # line 186 "genmsg.l"
319 {
320 			if (IsActiveMode(ReplaceMode)) {
321 				(void) fprintf(newfp, "%s", yytext);
322 			}
323 			if (end_of_cat) {
324 				BEGIN 0;
325 			} else {
326 				return (INC);
327 			}
328 		}
329 break;
330 case 11:
331 
332 # line 197 "genmsg.l"
333 {
334 			if (IsActiveMode(ReplaceMode)) {
335 				(void) fprintf(newfp, "%s", yytext);
336 			}
337 			if (end_of_cat) {
338 				BEGIN 0;
339 			} else {
340 				return (INC);
341 			}
342 		}
343 break;
344 case 12:
345 
346 # line 208 "genmsg.l"
347 	{	/* extract quoted string */
348 			yylval.str = skip_quoted('"');
349 			if (IsActiveMode(ReplaceMode)) {
350 				(void) fprintf(newfp, "\"%s\"", yylval.str);
351 			}
352 			if (end_of_cat) { /* just in case */
353 				BEGIN 0;
354 				free(yylval.str);
355 			} else {
356 				return (QSTR);
357 			}
358 		}
359 break;
360 case 13:
361 
362 # line 221 "genmsg.l"
363 	{	/* punctuation */
364 			if (IsActiveMode(ReplaceMode)) {
365 				if (cat_field == MsgidField &&
366 					get_linemsgid(lineno) != NOLINEMSG) {
367 					save_minus = TRUE; /*  be replaced. */
368 				} else {
369 					(void) fprintf(newfp, "%c", yytext[0]);
370 				}
371 			}
372 			if (end_of_cat) { /* just in case */
373 				BEGIN 0;
374 			} else {
375 				return (yytext[0]);
376 			}
377 		}
378 break;
379 case 14:
380 
381 # line 237 "genmsg.l"
382 {	/* numbers */
383 			switch (cat_field) {
384 			case SetidField:
385 				yylval.id = atoi(yytext);
386 				if (IsActiveMode(ReplaceMode)) {
387 					(void) fprintf(newfp, "%s", yytext);
388 				}
389 				if (end_of_cat) {
390 					BEGIN 0;
391 				} else {
392 					return (SETID);
393 				}
394 				break;
395 			case MsgidField:
396 				yylval.id = atoi(yytext);
397 				if (IsActiveMode(ReplaceMode)) {
398 					int id = get_linemsgid(lineno);
399 					if (id == NOLINEMSG) {
400 						(void) fprintf(newfp, "%s",
401 						    yytext);
402 					} else if (id == NOMSGID &&
403 						IsActiveMode(ReverseMode)) {
404 						(void) fprintf(newfp, "%d",
405 						    NOMSGID);
406 					} else if (save_minus == TRUE &&
407 						yylval.id == 1) {
408 						(void) fprintf(newfp, "%d", id);
409 					} else { /* just in case */
410 						(void) fprintf(newfp, "%s",
411 						    yytext);
412 					}
413 					save_minus = FALSE;
414 				} else {
415 					msg_line = lineno;
416 				}
417 				if (end_of_cat) {
418 					BEGIN 0;
419 				} else {
420 					return (MSGID);
421 				}
422 				break;
423 			default:
424 				yylval.id = atoi(yytext);
425 				if (IsActiveMode(ReplaceMode)) {
426 					(void) fprintf(newfp, "%s", yytext);
427 				}
428 				if (end_of_cat) {
429 					BEGIN 0;
430 				} else {
431 					return (DIGIT);
432 				}
433 			}
434 		}
435 break;
436 case 15:
437 
438 # line 291 "genmsg.l"
439 {
440 			if (IsActiveMode(ReplaceMode)) {
441 				(void) fprintf(newfp, "%s", yytext);
442 			}
443 			if (end_of_cat) {
444 				BEGIN 0;
445 			} else {
446 				return (STR);
447 			}
448 		}
449 break;
450 case 16:
451 
452 # line 302 "genmsg.l"
453 	{
454 			lineno++;
455 			if (IsActiveMode(ReplaceMode)) {
456 				(void) fprintf(newfp, "\n");
457 			}
458 			if (end_of_cat) {
459 				BEGIN 0;
460 			}
461 		}
462 break;
463 case 17:
464 
465 # line 312 "genmsg.l"
466 	{	/* not interested */
467 			if (IsActiveMode(ReplaceMode)) {
468 				(void) fprintf(newfp, "%c", yytext[0]);
469 			}
470 			if (end_of_cat) {
471 				BEGIN 0;
472 			}
473 		}
474 break;
475 case 18:
476 
477 # line 321 "genmsg.l"
478 {	/* -1 */
479 			if (end_of_cat == FALSE) {
480 				REJECT
481 			} else if (IsActiveMode(ReplaceMode)) {
482 				if (IsActiveMode(PreProcessMode)) {
483 					int id = get_linemsgid(lineno);
484 					if (id == NOLINEMSG) {
485 						(void) fprintf(newfp, "%s",
486 						    yytext);
487 					} else { /* could be -1. */
488 						(void) fprintf(newfp, "%d", id);
489 					}
490 				} else {
491 					(void) fprintf(newfp, "%s", yytext);
492 				}
493 			}
494 		}
495 break;
496 case 19:
497 
498 # line 339 "genmsg.l"
499 	{
500 			if (IsActiveMode(ReplaceMode)) {
501 				if (IsActiveMode(PreProcessMode) &&
502 					IsActiveMode(ReverseMode)) {
503 					int id = get_linemsgid(lineno);
504 					if (id == NOLINEMSG) {
505 						(void) fprintf(newfp, "%s",
506 						    yytext);
507 					} else if (id == NOMSGID) {
508 						(void) fprintf(newfp, "%d", id);
509 					}
510 				} else {
511 					(void) fprintf(newfp, "%s", yytext);
512 				}
513 			}
514 		}
515 break;
516 case 20:
517 
518 # line 356 "genmsg.l"
519 {	/* pound for c-preprocessor */
520 			if (IsActiveMode(PreProcessMode)) {
521 				if (IsActiveMode(ReplaceMode)) {
522 					(void) fprintf(newfp, "%s", yytext);
523 				} else {
524 					parse_cppline(yytext);
525 				}
526 			} else if (IsActiveMode(ReplaceMode)) {
527 				(void) fprintf(newfp, "%s", yytext);
528 			}
529 			lineno++;
530 		}
531 break;
532 case 21:
533 
534 # line 369 "genmsg.l"
535 	{	/* skip a comment block */
536 			char *comment = skip_comment();
537 			if (IsActiveMode(ReplaceMode)) {
538 				(void) fprintf(newfp, "%s", comment);
539 			} else {
540 				if (IsActiveMode(MsgCommentMode)) {
541 					add_comment(MsgCommentMode, comment);
542 				}
543 				if (IsActiveMode(SetCommentMode)) {
544 					add_comment(SetCommentMode, comment);
545 				}
546 			}
547 			free(comment);
548 		}
549 break;
550 case 22:
551 
552 # line 384 "genmsg.l"
553 {	/* skip a c++ comment */
554 			if (IsActiveMode(ReplaceMode)) {
555 				(void) fprintf(newfp, "%s", yytext);
556 			} else {
557 				if (IsActiveMode(MsgCommentMode)) {
558 					add_comment(MsgCommentMode, yytext);
559 				}
560 				if (IsActiveMode(SetCommentMode)) {
561 					add_comment(SetCommentMode, yytext);
562 				}
563 			}
564 			lineno++;
565 		}
566 break;
567 case 23:
568 
569 # line 398 "genmsg.l"
570 	{	/* skip quoted string */
571 			char *qstr = skip_quoted('"');
572 			if (IsActiveMode(ReplaceMode)) {
573 				(void) fprintf(newfp, "\"%s\"", qstr);
574 			}
575 			free(qstr);
576 		}
577 break;
578 case 24:
579 
580 # line 406 "genmsg.l"
581 	{	/* skip single-quoted character */
582 			char *qchr = skip_quoted('\'');
583 			if (IsActiveMode(ReplaceMode)) {
584 				(void) fprintf(newfp, "\'%s\'", qchr);
585 			}
586 			free(qchr);
587 		}
588 break;
589 case 25:
590 
591 # line 414 "genmsg.l"
592 	{
593 			if (IsActiveMode(ReplaceMode)) {
594 				(void) fprintf(newfp, "\n");
595 			}
596 			lineno++;
597 		}
598 break;
599 case 26:
600 
601 # line 421 "genmsg.l"
602 	{
603 			if (IsActiveMode(ReplaceMode)) {
604 				(void) fprintf(newfp, "%c", yytext[0]);
605 			}
606 		}
607 break;
608 case -1:
609 break;
610 default:
611 (void)fprintf(yyout,"bad switch yylook %d",nstr);
612 } return(0); }
613 /* end of yylex */
614 
615 # line 428 "genmsg.l"
616 
617 static char *
618 skip_quoted(int skip_ch)
619 {
620 	char *buf, *ptr;	/* saved buffer and its pointer */
621 	int bsize = BUFSIZ;	/* growing buffer size */
622 	int i = 0;		/* counter */
623 	int c, old = 0;		/* input character */
624 
625 	if ((buf = ptr = malloc(bsize)) == NULL) {
626 		prg_err(gettext("fatal: out of memory"));
627 		exit(EXIT_FAILURE);
628 	}
629 	for (; ; i++) {
630 		if (i == bsize) {
631 			bsize += BUFSIZ;
632 			if ((buf = realloc(buf, bsize)) == NULL) {
633 				prg_err(gettext("fatal: out of memory"));
634 				exit(EXIT_FAILURE);
635 			}
636 			ptr = buf + i;
637 		}
638 		c = input();
639 		if (c == skip_ch && old != '\\') {
640 			break;
641 		} else if (c == '\n') {
642 			lineno++;
643 		} else if (c == 0) {
644 			if (skip_ch == '"') {
645 				warning(gettext("warning: unmatched \""));
646 			} else if (skip_ch == '\'') {
647 				warning(gettext("warning: unmatched '"));
648 			} else {
649 				/* Should not happen */
650 				warning(gettext(
651 				    "warning: unmatched character"));
652 			}
653 			break;
654 		}
655 		*ptr++ = c;
656 		if (old == '\\') {
657 			old = '\0';
658 		} else {
659 			old = c;
660 		}
661 	}
662 	*ptr = '\0';
663 	return (buf);
664 }
665 
666 static char *
667 skip_comment(void)
668 {
669 	char *buf, *ptr;	/* saved buffer and its pointer */
670 	int bsize = BUFSIZ;	/* growing buffer size */
671 	int i = 0;		/* counter */
672 	int c, old = 0;		/* input character */
673 
674 	if ((buf = ptr = malloc(bsize)) == NULL) {
675 		prg_err(gettext("fatal: out of memory"));
676 		exit(EXIT_FAILURE);
677 	}
678 	*ptr++ = '/';	i++;
679 	*ptr++ = '*';	i++;
680 	for (; ; i++) {
681 		if (i == bsize) {
682 			bsize += BUFSIZ;
683 			if ((buf = realloc(buf, bsize)) == NULL) {
684 				prg_err(gettext("fatal: out of memory"));
685 				exit(EXIT_FAILURE);
686 			}
687 			ptr = buf + i;
688 		}
689 		c = input();
690 		if (c == '/' && old == '*') {
691 			*ptr++ = c;
692 			break;
693 		} else if (c == '\n') {
694 			lineno++;
695 		} else if (c == 0) {
696 			warning(gettext("warning: unmatched /*"));
697 			break;
698 		}
699 		*ptr++ = old = c;
700 	}
701 	*ptr = '\0';
702 	return (buf);
703 }
704 
705 /*
706  * parse_cppline() parses the line control information that a C
707  * preprocessor generates to indicate the location in the original
708  * file.  See the cpp man in the details.
709  */
710 static void
711 parse_cppline(char *str)
712 {
713 	int n, line, len;
714 	char ch;
715 	char file[BUFSIZ];
716 	char *altfile = NULL;
717 	char *pfile;
718 
719 	len = strlen(str);
720 	if (len >= sizeof (file)) {
721 		if ((altfile = malloc(len + 1)) == NULL) {
722 			prg_err(gettext("fatal: out of memory"));
723 			exit(EXIT_FAILURE);
724 		}
725 		pfile = altfile;
726 	} else {
727 		pfile = file;
728 	}
729 	/* LINTED: E_SEC_SCANF_UNBOUNDED_COPY */
730 	n = sscanf(str, "%c%d%s", &ch, &line, pfile);
731 
732 	/* 'file' is a quoted string but 'srcfile' is not. */
733 	len = strlen(pfile) - 2;
734 
735 	pfile++;
736 	if (n == 3 && (strncmp(pfile, srcfile, len) == 0)) {
737 		pound_is_mine = TRUE;
738 		lineno = line - 1;
739 	} else if (n == 2 && (pound_is_mine == TRUE)) {
740 		lineno = line - 1;
741 	} else {
742 		pound_is_mine = FALSE;
743 	}
744 	if (altfile)
745 		free(altfile);
746 }
747 
748 typedef struct {
749 	int line;
750 	int msgid;
751 } LineMsgID;
752 
753 static LineMsgID line_msgid[NL_MSGMAX];
754 static int line_msgcnt;
755 
756 void
757 init_lex(void)
758 {
759 	lineno = 1;
760 	end_of_cat = TRUE;
761 	pound_is_mine = FALSE;
762 }
763 
764 void
765 init_linemsgid(void)
766 {
767 	line_msgcnt = 0;
768 	(void) memset(line_msgid, 0, sizeof (LineMsgID) * NL_MSGMAX);
769 }
770 
771 void
772 set_linemsgid(int line, int msgid)
773 {
774 	if (line_msgcnt >= NL_MSGMAX) {
775 		return; /* oops */
776 	}
777 	line_msgid[line_msgcnt].line = line;
778 	line_msgid[line_msgcnt].msgid = msgid;
779 	line_msgcnt++;
780 }
781 
782 int
783 get_linemsgid(int line)
784 {
785 	int i, left, right;
786 	left = 0;
787 	right = line_msgcnt - 1;
788 	while (left <= right) {
789 		i = (left + right) >> 1;
790 		if (line < line_msgid[i].line) {
791 			right = i - 1;
792 		} else if (line > line_msgid[i].line) {
793 			left = i + 1;
794 		} else {
795 			return (line_msgid[i].msgid);
796 		}
797 	}
798 	return (NOLINEMSG);
799 }
800 
801 void
802 yyerror(char *s)
803 {
804 	if ((IsActiveMode(PreProcessMode) && pound_is_mine == FALSE) ||
805 	    IsActiveMode(ReplaceMode)) {
806 		return;
807 	}
808 	src_err(srcfile, lineno, gettext("%s before or at: %s"), s, yytext);
809 }
810 
811 void
812 warning(char *s)
813 {
814 	if ((IsActiveMode(PreProcessMode) && pound_is_mine == FALSE) ||
815 	    IsActiveMode(ReplaceMode)) {
816 		return;
817 	}
818 	src_err(srcfile, lineno, "%s", s);
819 }
820 int yyvstop[] = {
821 0,
822 
823 26,
824 0,
825 
826 25,
827 0,
828 
829 23,
830 26,
831 0,
832 
833 24,
834 26,
835 0,
836 
837 26,
838 0,
839 
840 26,
841 0,
842 
843 26,
844 0,
845 
846 19,
847 26,
848 0,
849 
850 26,
851 0,
852 
853 26,
854 0,
855 
856 17,
857 26,
858 0,
859 
860 16,
861 25,
862 0,
863 
864 12,
865 17,
866 23,
867 26,
868 0,
869 
870 15,
871 17,
872 26,
873 0,
874 
875 17,
876 24,
877 26,
878 0,
879 
880 5,
881 17,
882 26,
883 0,
884 
885 5,
886 17,
887 26,
888 0,
889 
890 4,
891 17,
892 26,
893 0,
894 
895 13,
896 17,
897 26,
898 0,
899 
900 17,
901 26,
902 0,
903 
904 5,
905 17,
906 26,
907 0,
908 
909 14,
910 15,
911 17,
912 19,
913 26,
914 0,
915 
916 15,
917 17,
918 26,
919 0,
920 
921 15,
922 17,
923 26,
924 0,
925 
926 15,
927 17,
928 26,
929 0,
930 
931 15,
932 17,
933 26,
934 0,
935 
936 17,
937 26,
938 0,
939 
940 18,
941 0,
942 
943 21,
944 0,
945 
946 19,
947 0,
948 
949 15,
950 0,
951 
952 10,
953 0,
954 
955 11,
956 0,
957 
958 14,
959 15,
960 19,
961 0,
962 
963 15,
964 0,
965 
966 15,
967 0,
968 
969 15,
970 0,
971 
972 15,
973 0,
974 
975 15,
976 0,
977 
978 15,
979 0,
980 
981 22,
982 0,
983 
984 20,
985 0,
986 
987 15,
988 0,
989 
990 15,
991 0,
992 
993 15,
994 0,
995 
996 15,
997 0,
998 
999 9,
1000 15,
1001 0,
1002 
1003 15,
1004 0,
1005 
1006 15,
1007 0,
1008 
1009 15,
1010 0,
1011 
1012 8,
1013 15,
1014 0,
1015 
1016 15,
1017 0,
1018 
1019 15,
1020 0,
1021 
1022 15,
1023 0,
1024 
1025 15,
1026 0,
1027 
1028 6,
1029 15,
1030 0,
1031 
1032 15,
1033 0,
1034 
1035 15,
1036 0,
1037 
1038 15,
1039 0,
1040 
1041 15,
1042 0,
1043 
1044 3,
1045 0,
1046 
1047 15,
1048 0,
1049 
1050 3,
1051 15,
1052 0,
1053 
1054 7,
1055 15,
1056 0,
1057 
1058 1,
1059 0,
1060 
1061 2,
1062 0,
1063 
1064 1,
1065 15,
1066 0,
1067 
1068 2,
1069 15,
1070 0,
1071 0};
1072 # define YYTYPE unsigned char
1073 struct yywork { YYTYPE verify, advance; } yycrank[] = {
1074 0,0,	0,0,	1,5,	0,0,
1075 0,0,	0,0,	0,0,	0,0,
1076 0,0,	0,0,	1,5,	1,6,
1077 0,0,	9,32,	0,0,	0,0,
1078 0,0,	0,0,	0,0,	0,0,
1079 0,0,	0,0,	0,0,	0,0,
1080 0,0,	0,0,	0,0,	0,0,
1081 0,0,	0,0,	0,0,	0,0,
1082 0,0,	0,0,	3,15,	1,7,
1083 9,32,	0,0,	0,0,	1,5,
1084 1,8,	1,5,	3,15,	3,16,
1085 21,42,	11,35,	1,9,	1,10,
1086 1,11,	1,12,	11,36,	2,7,
1087 2,14,	9,33,	23,43,	54,54,
1088 2,8,	0,0,	0,0,	0,0,
1089 0,0,	0,0,	2,9,	1,5,
1090 2,11,	0,0,	1,10,	3,17,
1091 0,0,	0,0,	0,0,	3,18,
1092 3,19,	3,20,	0,0,	0,0,
1093 3,21,	3,22,	3,23,	3,24,
1094 3,25,	3,26,	0,0,	4,17,
1095 4,31,	0,0,	0,0,	0,0,
1096 4,19,	0,0,	0,0,	0,0,
1097 4,21,	4,22,	4,23,	3,20,
1098 4,25,	50,61,	3,27,	34,51,
1099 1,13,	10,34,	12,37,	12,37,
1100 12,37,	12,37,	12,37,	12,37,
1101 12,37,	12,37,	12,37,	12,37,
1102 13,38,	27,45,	13,34,	45,56,
1103 2,13,	38,53,	46,57,	47,58,
1104 48,59,	14,39,	26,44,	26,44,
1105 26,44,	26,44,	26,44,	26,44,
1106 26,44,	26,44,	26,44,	26,44,
1107 3,28,	28,46,	29,45,	28,45,
1108 49,60,	30,45,	3,29,	51,62,
1109 28,47,	53,63,	56,64,	3,30,
1110 14,39,	29,49,	30,50,	28,48,
1111 4,28,	57,65,	58,66,	59,67,
1112 61,68,	12,34,	4,29,	62,69,
1113 63,70,	64,71,	65,72,	4,30,
1114 14,40,	14,40,	14,40,	14,40,
1115 14,40,	14,40,	14,40,	14,40,
1116 14,40,	14,40,	18,41,	67,73,
1117 68,74,	26,45,	69,75,	70,76,
1118 71,77,	72,78,	18,41,	74,79,
1119 18,41,	18,41,	18,41,	18,41,
1120 18,41,	18,41,	18,41,	18,41,
1121 18,41,	18,41,	75,80,	76,81,
1122 77,82,	78,83,	18,41,	79,84,
1123 80,85,	18,41,	18,41,	18,41,
1124 18,41,	18,41,	18,41,	18,41,
1125 18,41,	18,41,	18,41,	18,41,
1126 18,41,	18,41,	18,41,	18,41,
1127 18,41,	18,41,	18,41,	18,41,
1128 18,41,	18,41,	18,41,	18,41,
1129 18,41,	18,41,	18,41,	82,87,
1130 0,0,	0,0,	0,0,	18,41,
1131 0,0,	18,41,	18,41,	18,41,
1132 18,41,	18,41,	18,41,	18,41,
1133 18,41,	18,41,	18,41,	18,41,
1134 18,41,	18,41,	18,41,	18,41,
1135 18,41,	18,41,	18,41,	18,41,
1136 18,41,	18,41,	18,41,	18,41,
1137 18,41,	18,41,	18,41,	36,36,
1138 0,0,	0,0,	0,0,	0,0,
1139 0,0,	0,0,	0,0,	36,36,
1140 36,52,	37,37,	37,37,	37,37,
1141 37,37,	37,37,	37,37,	37,37,
1142 37,37,	37,37,	37,37,	40,54,
1143 0,0,	0,0,	0,0,	0,0,
1144 0,0,	0,0,	0,0,	40,54,
1145 40,55,	0,0,	0,0,	0,0,
1146 0,0,	0,0,	0,0,	0,0,
1147 36,36,	0,0,	36,36,	0,0,
1148 0,0,	0,0,	0,0,	0,0,
1149 36,36,	0,0,	36,36,	0,0,
1150 0,0,	0,0,	0,0,	0,0,
1151 0,0,	0,0,	0,0,	0,0,
1152 40,54,	0,0,	40,54,	0,0,
1153 36,36,	0,0,	0,0,	36,36,
1154 40,54,	0,0,	40,40,	44,44,
1155 44,44,	44,44,	44,44,	44,44,
1156 44,44,	44,44,	44,44,	44,44,
1157 44,44,	0,0,	0,0,	0,0,
1158 40,54,	0,0,	81,86,	40,54,
1159 81,86,	81,86,	81,86,	81,86,
1160 81,86,	81,86,	81,86,	81,86,
1161 81,86,	81,86,	0,0,	0,0,
1162 0,0,	0,0,	0,0,	0,0,
1163 0,0,	81,86,	81,86,	81,86,
1164 81,86,	81,86,	81,86,	81,86,
1165 81,86,	81,86,	81,86,	81,86,
1166 81,86,	81,86,	81,86,	81,86,
1167 81,86,	81,86,	81,86,	81,86,
1168 81,86,	81,86,	81,86,	81,86,
1169 81,86,	81,86,	81,86,	0,0,
1170 0,0,	0,0,	0,0,	81,86,
1171 0,0,	81,86,	81,86,	81,86,
1172 81,86,	81,86,	81,86,	81,86,
1173 81,86,	81,86,	81,86,	81,86,
1174 81,86,	81,86,	81,86,	81,86,
1175 81,86,	81,86,	81,86,	81,86,
1176 81,86,	81,86,	81,86,	81,86,
1177 81,86,	81,86,	81,86,	83,88,
1178 0,0,	83,88,	83,88,	83,88,
1179 83,88,	83,88,	83,88,	83,88,
1180 83,88,	83,88,	83,88,	0,0,
1181 0,0,	0,0,	0,0,	0,0,
1182 0,0,	0,0,	83,88,	83,88,
1183 83,88,	83,88,	83,88,	83,88,
1184 83,88,	83,88,	83,88,	83,88,
1185 83,88,	83,88,	83,88,	83,88,
1186 83,88,	83,88,	83,88,	83,88,
1187 83,88,	83,88,	83,88,	83,88,
1188 83,88,	83,88,	83,88,	83,88,
1189 0,0,	0,0,	0,0,	0,0,
1190 83,88,	0,0,	83,88,	83,88,
1191 83,88,	83,88,	83,88,	83,88,
1192 83,88,	83,88,	83,88,	83,88,
1193 83,88,	83,88,	83,88,	83,88,
1194 83,88,	83,88,	83,88,	83,88,
1195 83,88,	83,88,	83,88,	83,88,
1196 83,88,	83,88,	83,88,	83,88,
1197 0,0};
1198 struct yysvf yysvec[] = {
1199 0,	0,	0,
1200 yycrank+-1,	0,		0,
1201 yycrank+-17,	yysvec+1,	0,
1202 yycrank+-33,	0,		0,
1203 yycrank+-49,	yysvec+3,	0,
1204 yycrank+0,	0,		yyvstop+1,
1205 yycrank+0,	0,		yyvstop+3,
1206 yycrank+0,	0,		yyvstop+5,
1207 yycrank+0,	0,		yyvstop+8,
1208 yycrank+4,	0,		yyvstop+11,
1209 yycrank+2,	0,		yyvstop+13,
1210 yycrank+3,	0,		yyvstop+15,
1211 yycrank+54,	0,		yyvstop+17,
1212 yycrank+15,	0,		yyvstop+20,
1213 yycrank+112,	0,		yyvstop+22,
1214 yycrank+0,	0,		yyvstop+24,
1215 yycrank+0,	0,		yyvstop+27,
1216 yycrank+0,	0,		yyvstop+30,
1217 yycrank+132,	0,		yyvstop+35,
1218 yycrank+0,	0,		yyvstop+39,
1219 yycrank+0,	0,		yyvstop+43,
1220 yycrank+1,	0,		yyvstop+47,
1221 yycrank+0,	0,		yyvstop+51,
1222 yycrank+9,	yysvec+9,	yyvstop+55,
1223 yycrank+0,	yysvec+10,	yyvstop+59,
1224 yycrank+0,	yysvec+11,	yyvstop+62,
1225 yycrank+74,	yysvec+18,	yyvstop+66,
1226 yycrank+14,	yysvec+18,	yyvstop+72,
1227 yycrank+36,	yysvec+18,	yyvstop+76,
1228 yycrank+35,	yysvec+18,	yyvstop+80,
1229 yycrank+38,	yysvec+18,	yyvstop+84,
1230 yycrank+0,	yysvec+14,	yyvstop+88,
1231 yycrank+0,	yysvec+9,	0,
1232 yycrank+0,	0,		yyvstop+91,
1233 yycrank+2,	0,		0,
1234 yycrank+0,	0,		yyvstop+93,
1235 yycrank+-254,	0,		0,
1236 yycrank+217,	0,		yyvstop+95,
1237 yycrank+1,	0,		0,
1238 yycrank+0,	yysvec+14,	0,
1239 yycrank+-274,	0,		0,
1240 yycrank+0,	yysvec+18,	yyvstop+97,
1241 yycrank+0,	0,		yyvstop+99,
1242 yycrank+0,	0,		yyvstop+101,
1243 yycrank+275,	yysvec+18,	yyvstop+103,
1244 yycrank+18,	yysvec+18,	yyvstop+107,
1245 yycrank+2,	yysvec+18,	yyvstop+109,
1246 yycrank+22,	yysvec+18,	yyvstop+111,
1247 yycrank+10,	yysvec+18,	yyvstop+113,
1248 yycrank+20,	yysvec+18,	yyvstop+115,
1249 yycrank+2,	yysvec+18,	yyvstop+117,
1250 yycrank+23,	0,		0,
1251 yycrank+0,	0,		yyvstop+119,
1252 yycrank+38,	0,		0,
1253 yycrank+-7,	yysvec+40,	0,
1254 yycrank+0,	0,		yyvstop+121,
1255 yycrank+26,	yysvec+18,	yyvstop+123,
1256 yycrank+46,	yysvec+18,	yyvstop+125,
1257 yycrank+36,	yysvec+18,	yyvstop+127,
1258 yycrank+36,	yysvec+18,	yyvstop+129,
1259 yycrank+0,	yysvec+18,	yyvstop+131,
1260 yycrank+53,	yysvec+18,	yyvstop+134,
1261 yycrank+52,	0,		0,
1262 yycrank+55,	0,		0,
1263 yycrank+54,	yysvec+18,	yyvstop+136,
1264 yycrank+57,	yysvec+18,	yyvstop+138,
1265 yycrank+0,	yysvec+18,	yyvstop+140,
1266 yycrank+55,	yysvec+18,	yyvstop+143,
1267 yycrank+75,	yysvec+18,	yyvstop+145,
1268 yycrank+73,	0,		0,
1269 yycrank+59,	0,		0,
1270 yycrank+75,	yysvec+18,	yyvstop+147,
1271 yycrank+61,	yysvec+18,	yyvstop+149,
1272 yycrank+0,	yysvec+18,	yyvstop+151,
1273 yycrank+63,	yysvec+18,	yyvstop+154,
1274 yycrank+74,	0,		0,
1275 yycrank+76,	0,		0,
1276 yycrank+76,	yysvec+18,	yyvstop+156,
1277 yycrank+78,	yysvec+18,	yyvstop+158,
1278 yycrank+95,	yysvec+18,	yyvstop+160,
1279 yycrank+81,	0,		0,
1280 yycrank+292,	0,		yyvstop+162,
1281 yycrank+108,	yysvec+18,	yyvstop+164,
1282 yycrank+369,	yysvec+18,	yyvstop+166,
1283 yycrank+0,	yysvec+18,	yyvstop+169,
1284 yycrank+0,	0,		yyvstop+172,
1285 yycrank+0,	0,		yyvstop+174,
1286 yycrank+0,	yysvec+18,	yyvstop+176,
1287 yycrank+0,	yysvec+18,	yyvstop+179,
1288 0,	0,	0};
1289 struct yywork *yytop = yycrank+491;
1290 struct yysvf *yybgin = yysvec+1;
1291 char yymatch[] = {
1292   0,   1,   1,   1,   1,   1,   1,   1,
1293   1,   9,  10,   1,   1,   1,   1,   1,
1294   1,   1,   1,   1,   1,   1,   1,   1,
1295   1,   1,   1,   1,   1,   1,   1,   1,
1296   9,   1,   1,   1,   1,   1,  38,   1,
1297  40,  40,  40,  40,   1,   1,  46,  40,
1298  48,  48,  48,  48,  48,  48,  48,  48,
1299  48,  48,   1,  40,   1,   1,  62,   1,
1300   1,  65,  65,  65,  65,  65,  65,  65,
1301  65,  65,  65,  65,  65,  65,  65,  65,
1302  65,  65,  65,  65,  65,  65,  65,  65,
1303  65,  65,  65,   1,   1,   1,   1,  65,
1304   1,  65,  65,  65,  65,  65,  65,  65,
1305  65,  65,  65,  65,  65,  65,  65,  65,
1306  65,  65,  65,  65,  65,  65,  65,  65,
1307  65,  65,  65,   1,   1,   1,   1,   1,
1308   1,   1,   1,   1,   1,   1,   1,   1,
1309   1,   1,   1,   1,   1,   1,   1,   1,
1310   1,   1,   1,   1,   1,   1,   1,   1,
1311   1,   1,   1,   1,   1,   1,   1,   1,
1312   1,   1,   1,   1,   1,   1,   1,   1,
1313   1,   1,   1,   1,   1,   1,   1,   1,
1314   1,   1,   1,   1,   1,   1,   1,   1,
1315   1,   1,   1,   1,   1,   1,   1,   1,
1316   1,   1,   1,   1,   1,   1,   1,   1,
1317   1,   1,   1,   1,   1,   1,   1,   1,
1318   1,   1,   1,   1,   1,   1,   1,   1,
1319   1,   1,   1,   1,   1,   1,   1,   1,
1320   1,   1,   1,   1,   1,   1,   1,   1,
1321   1,   1,   1,   1,   1,   1,   1,   1,
1322   1,   1,   1,   1,   1,   1,   1,   1,
1323   1,   1,   1,   1,   1,   1,   1,   1,
1324 0};
1325 char yyextra[] = {
1326 0,0,0,0,0,0,0,0,
1327 0,0,0,0,0,0,0,0,
1328 0,0,0,0,0,0,0,0,
1329 0,0,0,0,0,0,0,0,
1330 0};
1331 /*
1332  * CDDL HEADER START
1333  *
1334  * The contents of this file are subject to the terms of the
1335  * Common Development and Distribution License, Version 1.0 only
1336  * (the "License").  You may not use this file except in compliance
1337  * with the License.
1338  *
1339  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1340  * or http://www.opensolaris.org/os/licensing.
1341  * See the License for the specific language governing permissions
1342  * and limitations under the License.
1343  *
1344  * When distributing Covered Code, include this CDDL HEADER in each
1345  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1346  * If applicable, add the following below this CDDL HEADER, with the
1347  * fields enclosed by brackets "[]" replaced with your own identifying
1348  * information: Portions Copyright [yyyy] [name of copyright owner]
1349  *
1350  * CDDL HEADER END
1351  */
1352 
1353 /*	Copyright (c) 1989 AT&T	*/
1354 /*	  All Rights Reserved  	*/
1355 
1356 #pragma ident	"%Z%%M%	%I%	%E% SMI"
1357 
1358 int yylineno =1;
1359 # define YYU(x) x
1360 # define NLSTATE yyprevious=YYNEWLINE
1361 struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;
1362 char yysbuf[YYLMAX];
1363 char *yysptr = yysbuf;
1364 int *yyfnd;
1365 extern struct yysvf *yyestate;
1366 int yyprevious = YYNEWLINE;
1367 #if defined(__cplusplus) || defined(__STDC__)
1368 int yylook(void)
1369 #else
1370 yylook()
1371 #endif
1372 {
1373 	register struct yysvf *yystate, **lsp;
1374 	register struct yywork *yyt;
1375 	struct yysvf *yyz;
1376 	int yych, yyfirst;
1377 	struct yywork *yyr;
1378 # ifdef LEXDEBUG
1379 	int debug;
1380 # endif
1381 	char *yylastch;
1382 	/* start off machines */
1383 # ifdef LEXDEBUG
1384 	debug = 0;
1385 # endif
1386 	yyfirst=1;
1387 	if (!yymorfg)
1388 		yylastch = yytext;
1389 	else {
1390 		yymorfg=0;
1391 		yylastch = yytext+yyleng;
1392 		}
1393 	for(;;){
1394 		lsp = yylstate;
1395 		yyestate = yystate = yybgin;
1396 		if (yyprevious==YYNEWLINE) yystate++;
1397 		for (;;){
1398 # ifdef LEXDEBUG
1399 			if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
1400 # endif
1401 			yyt = yystate->yystoff;
1402 			if(yyt == yycrank && !yyfirst){  /* may not be any transitions */
1403 				yyz = yystate->yyother;
1404 				if(yyz == 0)break;
1405 				if(yyz->yystoff == yycrank)break;
1406 				}
1407 #ifndef __cplusplus
1408 			*yylastch++ = yych = input();
1409 #else
1410 			*yylastch++ = yych = lex_input();
1411 #endif
1412 #ifdef YYISARRAY
1413 			if(yylastch > &yytext[YYLMAX]) {
1414 				fprintf(yyout,"Input string too long, limit %d\n",YYLMAX);
1415 				exit(1);
1416 			}
1417 #else
1418 			if (yylastch >= &yytext[ yytextsz ]) {
1419 				int	x = yylastch - yytext;
1420 
1421 				yytextsz += YYTEXTSZINC;
1422 				if (yytext == yy_tbuf) {
1423 				    yytext = (char *) malloc(yytextsz);
1424 				    memcpy(yytext, yy_tbuf, sizeof (yy_tbuf));
1425 				}
1426 				else
1427 				    yytext = (char *) realloc(yytext, yytextsz);
1428 				if (!yytext) {
1429 				    fprintf(yyout,
1430 					"Cannot realloc yytext\n");
1431 				    exit(1);
1432 				}
1433 				yylastch = yytext + x;
1434 			}
1435 #endif
1436 			yyfirst=0;
1437 		tryagain:
1438 # ifdef LEXDEBUG
1439 			if(debug){
1440 				fprintf(yyout,"char ");
1441 				allprint(yych);
1442 				putchar('\n');
1443 				}
1444 # endif
1445 			yyr = yyt;
1446 			if ( (uintptr_t)yyt > (uintptr_t)yycrank){
1447 				yyt = yyr + yych;
1448 				if (yyt <= yytop && yyt->verify+yysvec == yystate){
1449 					if(yyt->advance+yysvec == YYLERR)	/* error transitions */
1450 						{unput(*--yylastch);break;}
1451 					*lsp++ = yystate = yyt->advance+yysvec;
1452 					if(lsp > &yylstate[YYLMAX]) {
1453 						fprintf(yyout,"Input string too long, limit %d\n",YYLMAX);
1454 						exit(1);
1455 					}
1456 					goto contin;
1457 					}
1458 				}
1459 # ifdef YYOPTIM
1460 			else if((uintptr_t)yyt < (uintptr_t)yycrank) {	/* r < yycrank */
1461 				yyt = yyr = yycrank+(yycrank-yyt);
1462 # ifdef LEXDEBUG
1463 				if(debug)fprintf(yyout,"compressed state\n");
1464 # endif
1465 				yyt = yyt + yych;
1466 				if(yyt <= yytop && yyt->verify+yysvec == yystate){
1467 					if(yyt->advance+yysvec == YYLERR)	/* error transitions */
1468 						{unput(*--yylastch);break;}
1469 					*lsp++ = yystate = yyt->advance+yysvec;
1470 					if(lsp > &yylstate[YYLMAX]) {
1471 						fprintf(yyout,"Input string too long, limit %d\n",YYLMAX);
1472 						exit(1);
1473 					}
1474 					goto contin;
1475 					}
1476 				yyt = yyr + YYU(yymatch[yych]);
1477 # ifdef LEXDEBUG
1478 				if(debug){
1479 					fprintf(yyout,"try fall back character ");
1480 					allprint(YYU(yymatch[yych]));
1481 					putchar('\n');
1482 					}
1483 # endif
1484 				if(yyt <= yytop && yyt->verify+yysvec == yystate){
1485 					if(yyt->advance+yysvec == YYLERR)	/* error transition */
1486 						{unput(*--yylastch);break;}
1487 					*lsp++ = yystate = yyt->advance+yysvec;
1488 					if(lsp > &yylstate[YYLMAX]) {
1489 						fprintf(yyout,"Input string too long, limit %d\n",YYLMAX);
1490 						exit(1);
1491 					}
1492 					goto contin;
1493 					}
1494 				}
1495 			if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
1496 # ifdef LEXDEBUG
1497 				if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
1498 # endif
1499 				goto tryagain;
1500 				}
1501 # endif
1502 			else
1503 				{unput(*--yylastch);break;}
1504 		contin:
1505 # ifdef LEXDEBUG
1506 			if(debug){
1507 				fprintf(yyout,"state %d char ",yystate-yysvec-1);
1508 				allprint(yych);
1509 				putchar('\n');
1510 				}
1511 # endif
1512 			;
1513 			}
1514 # ifdef LEXDEBUG
1515 		if(debug){
1516 			fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
1517 			allprint(yych);
1518 			putchar('\n');
1519 			}
1520 # endif
1521 		while (lsp-- > yylstate){
1522 			*yylastch-- = 0;
1523 			if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
1524 				yyolsp = lsp;
1525 				if(yyextra[*yyfnd]){		/* must backup */
1526 					while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
1527 						lsp--;
1528 						unput(*yylastch--);
1529 						}
1530 					}
1531 				yyprevious = YYU(*yylastch);
1532 				yylsp = lsp;
1533 				yyleng = yylastch-yytext+1;
1534 				yytext[yyleng] = 0;
1535 # ifdef LEXDEBUG
1536 				if(debug){
1537 					fprintf(yyout,"\nmatch ");
1538 					sprint(yytext);
1539 					fprintf(yyout," action %d\n",*yyfnd);
1540 					}
1541 # endif
1542 				return(*yyfnd++);
1543 				}
1544 			unput(*yylastch);
1545 			}
1546 		if (yytext[0] == 0  /* && feof(yyin) */)
1547 			{
1548 			yysptr=yysbuf;
1549 			return(0);
1550 			}
1551 #ifndef __cplusplus
1552 		yyprevious = yytext[0] = input();
1553 		if (yyprevious>0)
1554 			output(yyprevious);
1555 #else
1556 		yyprevious = yytext[0] = lex_input();
1557 		if (yyprevious>0)
1558 			lex_output(yyprevious);
1559 #endif
1560 		yylastch=yytext;
1561 # ifdef LEXDEBUG
1562 		if(debug)putchar('\n');
1563 # endif
1564 		}
1565 	}
1566 #if defined(__cplusplus) || defined(__STDC__)
1567 int yyback(int *p, int m)
1568 #else
1569 yyback(p, m)
1570 	int *p;
1571 #endif
1572 {
1573 	if (p==0) return(0);
1574 	while (*p) {
1575 		if (*p++ == m)
1576 			return(1);
1577 	}
1578 	return(0);
1579 }
1580 	/* the following are only used in the lex library */
1581 #if defined(__cplusplus) || defined(__STDC__)
1582 int yyinput(void)
1583 #else
1584 yyinput()
1585 #endif
1586 {
1587 #ifndef __cplusplus
1588 	return(input());
1589 #else
1590 	return(lex_input());
1591 #endif
1592 	}
1593 #if defined(__cplusplus) || defined(__STDC__)
1594 void yyoutput(int c)
1595 #else
1596 yyoutput(c)
1597   int c;
1598 #endif
1599 {
1600 #ifndef __cplusplus
1601 	output(c);
1602 #else
1603 	lex_output(c);
1604 #endif
1605 	}
1606 #if defined(__cplusplus) || defined(__STDC__)
1607 void yyunput(int c)
1608 #else
1609 yyunput(c)
1610    int c;
1611 #endif
1612 {
1613 	unput(c);
1614 	}
1615