• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

TsConfigParseEvents.h

Go to the documentation of this file.
00001 # if ! defined(TS_CONFIG_PARSE_EVENTS_HEADER)
00002 # define TS_CONFIG_PARSE_EVENTS_HEADER
00003 
00004 /** @file
00005 
00006     Definition of parsing events and handlers.
00007 
00008     @section license License
00009 
00010     Licensed to the Apache Software Foundation (ASF) under one
00011     or more contributor license agreements.  See the NOTICE file
00012     distributed with this work for additional information
00013     regarding copyright ownership.  The ASF licenses this file
00014     to you under the Apache License, Version 2.0 (the
00015     "License"); you may not use this file except in compliance
00016     with the License.  You may obtain a copy of the License at
00017 
00018     http://www.apache.org/licenses/LICENSE-2.0
00019 
00020     Unless required by applicable law or agreed to in writing, software
00021     distributed under the License is distributed on an "AS IS" BASIS,
00022     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00023     See the License for the specific language governing permissions and
00024     limitations under the License.
00025  */
00026 
00027 # include "TsConfigTypes.h"
00028 
00029 typedef void (*TsConfigEventFunction)(void* data, YYSTYPE* token);
00030 struct TsConfigEventHandler {
00031     TsConfigEventFunction _f; ///< Callback function.
00032     void* _data; ///< Callback context data.
00033 };
00034 typedef int (*TsConfigErrorFunction)(void* data, char const* text);
00035 struct TsConfigErrorHandler {
00036     TsConfigErrorFunction _f; ///< Callback function.
00037     void* _data; ///< Callback context data.
00038 };
00039 
00040 enum TsConfigEventType {
00041     TsConfigEventGroupOpen,
00042     TsConfigEventGroupName,
00043     TsConfigEventGroupClose,
00044     TsConfigEventListOpen,
00045     TsConfigEventListClose,
00046     TsConfigEventPathOpen,
00047     TsConfigEventPathTag,
00048     TsConfigEventPathIndex,
00049     TsConfigEventPathClose,
00050     TsConfigEventLiteralValue,
00051     TsConfigEventInvalidToken
00052 };
00053 
00054 # if defined(__cplusplus)
00055 static const size_t TS_CONFIG_N_EVENT_TYPES = TsConfigEventInvalidToken + 1;
00056 # else
00057 # define TS_CONFIG_N_EVENT_TYPES (TsConfigEventInvalidToken + 1)
00058 # endif
00059 
00060 struct TsConfigHandlers {
00061     struct TsConfigErrorHandler error; ///< Syntax error.
00062     /// Parsing event handlers.
00063     /// Indexed by @c TsConfigEventType.
00064     struct TsConfigEventHandler handler[TS_CONFIG_N_EVENT_TYPES];
00065 };
00066 
00067 # endif // TS_CONFIG_PARSE_EVENTS_HEADER

Generated by  doxygen 1.7.1