DataWorks
Database Library/Client
Loading...
Searching...
No Matches
dw_parser.h
Go to the documentation of this file.
1/* $Id: dw_parser.h 98 2024-05-23 23:51:27Z nishi $ */
2/* --- START LICENSE --- */
3/* -------------------------------------------------------------------------- */
4/* Copyright (c) 2024 Crabware. */
5/* Redistribution and use in source and binary forms, with or without modific */
6/* ation, are permitted provided that the following conditions are met: */
7/* 1. Redistributions of source code must retain the above copyright noti */
8/* ce, this list of conditions and the following disclaimer. */
9/* 2. Redistributions in binary form must reproduce the above copyright n */
10/* otice, this list of conditions and the following disclaimer in the documen */
11/* tation and/or other materials provided with the distribution. */
12/* 3. Neither the name of the copyright holder nor the names of its contr */
13/* ibutors may be used to endorse or promote products derived from this softw */
14/* are without specific prior written permission. */
15/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS */
16/* " AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, TH */
17/* E IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPO */
18/* SE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS */
19/* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CON */
20/* SEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITU */
21/* TE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPT */
22/* ION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S */
23/* TRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN AN */
24/* Y WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY */
25/* OF SUCH DAMAGE. */
26/* -------------------------------------------------------------------------- */
27/* --- END LICENSE --- */
28
29#ifndef __DATAWORKS_DW_PARSER_H__
30#define __DATAWORKS_DW_PARSER_H__
31
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43#include <stdbool.h>
44
45enum __token { __DW_METHOD = 0, __DW_VALUE };
46
47struct __dw_token {
48 char* name;
49 int type;
50 bool error;
51 int errnum;
52 struct __dw_token** token;
53};
54
55struct __dw_token* __dw_parser_parse(const char* str, bool top);
56void __dw_parser_free(struct __dw_token* token);
57void __dw_parser_print(struct __dw_token* token, int depth);
58
59#ifdef __cplusplus
60}
61#endif
62
63#endif