'kstrings' module reworked alot
[k8jam.git] / scan.h
blob9a2f8d676117be9f52ea2e63d6753b1821b74b2b
1 /*
2 * Copyright 1993, 1995 Christopher Seiwald.
4 * This file is part of Jam - see jam.c for Copyright information.
5 */
7 /*
8 * scan.h - the jam yacc scanner
10 * External functions:
12 * yyerror( char *s ) - print a parsing error message
13 * yyfparse( char *s ) - scan include file s
14 * yylex() - parse the next token, returning its type
15 * yymode() - adjust lexicon of scanner
16 * yyparse() - declaration for yacc parser
17 * yyanyerrors() - indicate if any parsing errors occured
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 * 11/04/02 (seiwald) - const-ing for string literals
27 #ifndef JAMH_SCAN_H
28 #define JAMH_SCAN_H
32 * YYSTYPE - value of a lexical token
35 # define YYSTYPE YYSYMBOL
37 typedef struct _YYSTYPE {
38 int type;
39 const char *string;
40 PARSE *parse;
41 LIST *list;
42 int number;
43 } YYSTYPE;
45 extern YYSTYPE yylval;
47 extern void yymode (int n);
48 extern void yyerror (const char *s);
49 extern int yyanyerrors (void);
50 extern void yyfparse (const char *s);
51 extern int yyline (void);
52 extern int yylex (void);
53 extern int yyparse (void);
56 enum {
57 SCAN_NORMAL, /* normal parsing */
58 SCAN_STRING, /* look only for matching } */
59 SCAN_PUNCT /* only punctuation keywords */
63 #endif