| 1 | /* |
| 2 | * Copyright (c) 2013, 2014, 2015, 2016 The University of Utah |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * This file is distributed under the University of Illinois Open Source |
| 6 | * License. See the file COPYING for details. |
| 7 | */ |
| 8 | |
| 9 | #include <assert.h> |
| 10 | #include <stdio.h> |
| 11 | #include <stdlib.h> |
| 12 | |
| 13 | /* |
| 14 | * Stuff defined for us by the lex/flex-generated code. |
| 15 | */ |
| 16 | extern FILE *yyin; |
| 17 | extern int yylex(void); |
| 18 | extern char *yytext; |
| 19 | |
| 20 | /* |
| 21 | * Stuff that we define within the lex/flex-generated code. |
| 22 | */ |
| 23 | extern int count; |
| 24 | |
| 25 | enum tok_kind { |
| 26 | TOK_KEYWORD = 999, |
| 27 | TOK_OP, |
| 28 | TOK_IDENT, |
| 29 | TOK_OTHER, |
| 30 | TOK_NUMBER, |
| 31 | TOK_WS, |
| 32 | TOK_NEWLINE, |
| 33 | TOK_STRING, |
| 34 | TOK_UNKNOWN, |
| 35 | }; |
| 36 | |
| 37 | void process_token(enum tok_kind); |
| 38 | |
| 39 | #define OK 51 |
| 40 | #define STOP 71 |