Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 1 | /* |
| 2 | *------------------------------------------------------------------ |
| 3 | * lex.h - definitions for the api generator's lexical |
| 4 | * analyzer. |
| 5 | * |
| 6 | * Copyright (c) 1996-2009 Cisco and/or its affiliates. |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | * you may not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at: |
| 10 | * |
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | * |
| 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
| 18 | *------------------------------------------------------------------ |
| 19 | */ |
| 20 | |
| 21 | #ifndef _LEX_H_ |
| 22 | #define _LEX_H_ 1 |
| 23 | |
| 24 | extern int yylex (void); |
| 25 | extern void yyerror (char *); |
| 26 | extern int yyparse (void); |
| 27 | |
| 28 | #ifndef YYSTYPE |
| 29 | #define YYSTYPE void * |
| 30 | #endif |
| 31 | |
| 32 | #include "tools/vppapigen/gram.h" |
| 33 | |
| 34 | enum lex_state { |
| 35 | START_STATE = 1, |
| 36 | NAME_STATE, |
| 37 | NUMBER_STATE, |
| 38 | C_COMMENT_STATE, |
| 39 | CPP_COMMENT_STATE, |
| 40 | STRING_STATE, |
| 41 | HELPER_STATE, |
| 42 | LINE_PRAGMA_STATE, |
| 43 | }; |
| 44 | |
| 45 | #define MAXNAME 64000 |
| 46 | |
| 47 | extern unsigned long input_crc; |
| 48 | extern unsigned long message_crc; |
| 49 | |
| 50 | #endif /* _LEX_H_ */ |