option.c: fixed warnings
[k8jam.git] / src / scan.h
blobcb5bfb03c1d8ca622c6ff605e4aeee206562e8c5
1 /* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar)
2 * Understanding is not required. Only obedience.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, version 3 of the License ONLY.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 * scan.h - the jam yacc scanner
19 * The yymode() function is for the parser to adjust the lexicon of the
20 * scanner. Aside from normal keyword scanning, there is a mode to
21 * handle action strings (look only for the closing }) and a mode to
22 * ignore most keywords when looking for a punctuation keyword. This
23 * allows non-punctuation keywords to be used in lists without quoting.
25 #ifndef JAMH_SCAN_H
26 #define JAMH_SCAN_H
30 * token_t - value of a lexical token
32 typedef struct {
33 int type;
34 const char *string;
35 int strlit; /* !0: don't do variable expansion in string */
36 PARSE *parse;
37 LIST *list;
38 int number;
39 int line;
40 int pos;
41 const char *file; // newstr()
42 } token_t;
44 extern token_t yylval;
46 extern void yyerror (const token_t *tk, const char *s);
47 extern void yyfparse (const char *s);
48 extern int yylex (void);
51 enum {
52 SCAN_NORMAL, /* normal parsing */
53 SCAN_STRING, /* look only for matching '}' */
54 SCAN_PUNCT /* only punctuation keywords */
57 extern void yymode (int n);
60 #endif