summaryrefslogtreecommitdiff
path: root/jam-files/engine/scan.h
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2012-05-12 14:01:52 -0400
committerKenneth Heafield <github@kheafield.com>2012-05-12 14:01:52 -0400
commit1a3cb9d9b0ab24d21d7e4edb70bb4a939f621082 (patch)
tree96f5cbfad3cbb0b8e89c26d6fa2e1a72a9039439 /jam-files/engine/scan.h
parentdba1128114d68ed46cdea98ecb887c7657a78474 (diff)
Give in and copy bjam into cdec source code
Diffstat (limited to 'jam-files/engine/scan.h')
-rw-r--r--jam-files/engine/scan.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/jam-files/engine/scan.h b/jam-files/engine/scan.h
new file mode 100644
index 00000000..3fad1c24
--- /dev/null
+++ b/jam-files/engine/scan.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright 1993, 1995 Christopher Seiwald.
+ *
+ * This file is part of Jam - see jam.c for Copyright information.
+ */
+
+/*
+ * scan.h - the jam yacc scanner
+ *
+ * External functions:
+ *
+ * yyerror( char *s ) - print a parsing error message.
+ * yyfparse( char *s ) - scan include file s.
+ * yylex() - parse the next token, returning its type.
+ * yymode() - adjust lexicon of scanner.
+ * yyparse() - declaration for yacc parser.
+ * yyanyerrors() - indicate if any parsing errors occured.
+ *
+ * The yymode() function is for the parser to adjust the lexicon of the scanner.
+ * Aside from normal keyword scanning, there is a mode to handle action strings
+ * (look only for the closing }) and a mode to ignore most keywords when looking
+ * for a punctuation keyword. This allows non-punctuation keywords to be used in
+ * lists without quoting.
+ */
+
+/*
+ * YYSTYPE - value of a lexical token
+ */
+
+#define YYSTYPE YYSYMBOL
+
+typedef struct _YYSTYPE
+{
+ int type;
+ char * string;
+ PARSE * parse;
+ LIST * list;
+ int number;
+ char * file;
+ int line;
+} YYSTYPE;
+
+extern YYSTYPE yylval;
+
+void yymode( int n );
+void yyerror( char * s );
+int yyanyerrors();
+void yyfparse( char * s );
+int yyline();
+int yylex();
+int yyparse();
+void yyinput_stream( char * * name, int * line );
+
+# define SCAN_NORMAL 0 /* normal parsing */
+# define SCAN_STRING 1 /* look only for matching } */
+# define SCAN_PUNCT 2 /* only punctuation keywords */