/* Copyright 2005-2006 Garrett Rooney. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef DDL_LEXER_H #define DDL_LEXER_H #include "etl_stream.h" #include "parser.h" /* A lexer for the ETL Data Definition Language. */ typedef struct etl_ddl_lexer_t etl_ddl_lexer_t; #define ETL_DDL_TOK_EOI 47 /* sufficiently big... */ typedef struct { int type; char *data; int line; } etl_token_t; /* Return a lexer that will scan the contents of BB, allocated in POOL. */ etl_ddl_lexer_t *etl_ddl_lexer_create(etl_stream_t *stream); void etl_ddl_lexer_destroy(etl_ddl_lexer_t *l); /* Scan forward to find the next token in LEXER, returning it in *TOK, using * POOL for temporary allocations. */ etl_error_t * etl_ddl_lexer_scan(etl_token_t **tok, etl_ddl_lexer_t *lexer); void etl_ddl_token_destroy(etl_token_t *tok); #endif /* DDL_LEXER_H */