added non-working 'SEMAPHORE'
[k8jam.git] / scan.h
blob82729b30a5dba556e253e31f412c4cc0a088488d
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
29 * YYSTYPE - value of a lexical token
32 # define YYSTYPE YYSYMBOL
34 typedef struct _YYSTYPE {
35 int type;
36 const char *string;
37 PARSE *parse;
38 LIST *list;
39 int number;
40 } YYSTYPE;
42 extern YYSTYPE yylval;
44 void yymode (int n);
45 void yyerror (const char *s);
46 int yyanyerrors (void);
47 void yyfparse (const char *s);
48 int yyline (void);
49 int yylex (void);
50 int yyparse (void);
52 # define SCAN_NORMAL 0 /* normal parsing */
53 # define SCAN_STRING 1 /* look only for matching } */
54 # define SCAN_PUNCT 2 /* only punctuation keywords */