]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /* |
2 | * Copyright 1993, 1995 Christopher Seiwald. | |
3 | * | |
4 | * This file is part of Jam - see jam.c for Copyright information. | |
5 | */ | |
6 | ||
7 | /* | |
8 | * scan.h - the jam yacc scanner | |
9 | * | |
10 | * External functions: | |
11 | * yyerror( char *s ) - print a parsing error message. | |
12 | * yyfparse( char *s ) - scan include file s. | |
13 | * yylex() - parse the next token, returning its type. | |
14 | * yymode() - adjust lexicon of scanner. | |
15 | * yyparse() - declaration for yacc parser. | |
16 | * yyanyerrors() - indicate if any parsing errors occured. | |
17 | * | |
18 | * The yymode() function is for the parser to adjust the lexicon of the scanner. | |
19 | * Aside from normal keyword scanning, there is a mode to handle action strings | |
20 | * (look only for the closing }) and a mode to ignore most keywords when looking | |
21 | * for a punctuation keyword. This allows non-punctuation keywords to be used in | |
22 | * lists without quoting. | |
23 | */ | |
24 | ||
25 | #include "lists.h" | |
26 | #include "object.h" | |
27 | #include "parse.h" | |
28 | ||
29 | ||
30 | /* | |
31 | * YYSTYPE - value of a lexical token | |
32 | */ | |
33 | ||
34 | #define YYSTYPE YYSYMBOL | |
35 | ||
36 | typedef struct _YYSTYPE | |
37 | { | |
38 | int type; | |
39 | OBJECT * string; | |
40 | PARSE * parse; | |
41 | LIST * list; | |
42 | int number; | |
43 | OBJECT * file; | |
44 | int line; | |
45 | char const * keyword; | |
46 | } YYSTYPE; | |
47 | ||
48 | extern YYSTYPE yylval; | |
49 | ||
50 | void yymode( int n ); | |
51 | void yyerror( char const * s ); | |
52 | int yyanyerrors(); | |
53 | void yyfparse( OBJECT * s ); | |
54 | void yyfdone( void ); | |
55 | int yyline(); | |
56 | int yylex(); | |
57 | int yyparse(); | |
58 | void yyinput_last_read_token( OBJECT * * name, int * line ); | |
59 | ||
60 | #define SCAN_NORMAL 0 /* normal parsing */ | |
61 | #define SCAN_STRING 1 /* look only for matching } */ | |
62 | #define SCAN_PUNCT 2 /* only punctuation keywords */ |