1 /* Copyright (c) 1992, Free Software Foundation, Inc.  All rights reserved.
2 
3    Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents
4    of the University of California. Copyright (c) 1976 Board of Trustees of
5    the University of Illinois. All rights reserved.
6 
7    Redistribution and use in source and binary forms are permitted
8    provided that
9    the above copyright notice and this paragraph are duplicated in all such
10    forms and that any documentation, advertising materials, and other
11    materials related to such distribution and use acknowledge that the
12    software was developed by the University of California, Berkeley, the
13    University of Illinois, Urbana, and Sun Microsystems, Inc.  The name of
14    either University or Sun Microsystems may not be used to endorse or
15    promote products derived from this software without specific prior written
16    permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
17    IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES
18    OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
19 
20 
21 
22 #define label_offset 2		/* number of levels a label is placed to left
23 				   of code */
24 
25 int c;				/* And here is another comment which
26                                  occupies more than two lines. */
27 
28 /* profile types */
29 enum profile
30 {
31   PRO_BOOL,			/* boolean */
32   PRO_INT,			/* integer */
33   PRO_FONT,			/* troff font */
34   PRO_IGN,			/* ignore it */
35   PRO_KEY,			/* -T switch */
36   PRO_SETTINGS,			/* bundled set of settings */
37   PRO_PRSTRING			/* Print string and exit */
38 };
39 
40 /* profile specials for booleans */
41 enum on_or_off
42 {
43   ONOFF_NA,			/* Not applicable.  Used in table for
44 				   non-booleans.  */
45   OFF,				/* This option turns on the boolean variable
46 				   in question.  */
47   ON				/* it turns it off */
48 };
49 
50 
51 
52 void
parse(tk)53 parse (tk)
54      enum codes tk;		/* the code for the construct scanned */
55 {
56   int i;
57 
58   while (parser_state_tos->p_stack[parser_state_tos->tos] == ifhead
59 	 && tk != elselit)
60     {
61       /* true if we have an if without an else */
62 
63       /* apply the if(..) stmt ::= stmt reduction */
64       parser_state_tos->p_stack[parser_state_tos->tos] = stmt;
65       reduce ();		/* see if this allows any reduction */
66     }
67 
68 
69   switch (tk)
70     {				/* go on and figure out what to do with the
71 				   input */
72 
73     case decl:			/* scanned a declaration word */
74       parser_state_tos->search_brace = btype_2;
75       /* indicate that following brace should be on same line */
76       if (parser_state_tos->p_stack[parser_state_tos->tos] != decl)
77 	{			/* only put one declaration onto stack */
78 	  break_comma = true;	/* while in declaration, newline should be
79 				   forced after comma */
80 	  inc_pstack ();
81 	}
82 
83     default:
84       break;
85     }
86 }
87