The Android Open Source Project | c24a8e6 | 2009-03-03 19:28:42 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2007 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef AMEND_LEXER_H_ |
| 18 | #define AMEND_LEXER_H_ |
| 19 | |
| 20 | #define AMEND_LEXER_BUFFER_INPUT 1 |
| 21 | |
| 22 | void yyerror(const char *msg); |
| 23 | int yylex(void); |
| 24 | |
| 25 | #if AMEND_LEXER_BUFFER_INPUT |
| 26 | void setLexerInputBuffer(const char *buf, size_t buflen); |
| 27 | #else |
| 28 | #include <stdio.h> |
| 29 | void yyset_in(FILE *in_str); |
| 30 | #endif |
| 31 | |
| 32 | const char *tokenToString(int token); |
| 33 | |
| 34 | typedef enum { |
| 35 | AM_UNKNOWN_ARGS, |
| 36 | AM_WORD_ARGS, |
| 37 | AM_BOOLEAN_ARGS, |
| 38 | } AmArgumentType; |
| 39 | |
| 40 | void setLexerArgumentType(AmArgumentType type); |
| 41 | int getLexerLineNumber(void); |
| 42 | |
| 43 | #endif // AMEND_LEXER_H_ |