BRL-CAD
obj_rules.h
Go to the documentation of this file.
1 /* O B J _ R U L E S . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2011-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 /** @file obj_rules.h
21  *
22  * Necessary declarations to use re2c scanner.
23  *
24  */
25 
26 #ifndef LIBGCV_WFOBJ_OBJ_RULES_H
27 #define LIBGCV_WFOBJ_OBJ_RULES_H
28 
29 #include "common.h"
30 #include "obj_token_type.h"
31 
32 enum YYCONDTYPE {
37 };
38 #define CONDTYPE enum YYCONDTYPE
39 
41 
42 #define PERPLEX_LEXER obj_parser_lex
43 
44 #define PERPLEX_ON_ENTER \
45  using obj::objCombinedState; \
46  struct extra_t *extra = static_cast<struct extra_t*>(yyextra); \
47  YYSTYPE *yylval = &extra->tokenData; \
48  objCombinedState *combinedState = static_cast<objCombinedState*>(extra->state);
49 
50 #include "obj_scanner.h"
51 
52 typedef perplex_t yyscan_t;
53 
54 struct extra_t {
55  void *state;
57 };
58 
59 void obj_parser_lex_destroy(yyscan_t scanner);
60 void *obj_parser_get_state(yyscan_t scanner);
61 void *obj_parser_get_extra(yyscan_t scanner);
62 void obj_parser_set_extra(yyscan_t scanner, void *extra);
63 
65 
66 #endif /* LIBGCV_WFOBJ_OBJ_RULES_H */
67 
68 /*
69  * Local Variables:
70  * tab-width: 8
71  * mode: C
72  * indent-tabs-mode: t
73  * c-file-style: "stroustrup"
74  * End:
75  * ex: shiftwidth=4 tabstop=8
76  */
Header file for the BRL-CAD common definitions.
void obj_parser_set_extra(yyscan_t scanner, void *extra)
#define __BEGIN_DECLS
Definition: common.h:73
YYSTYPE tokenData
Definition: obj_rules.h:56
void * obj_parser_get_state(yyscan_t scanner)
void obj_parser_lex_destroy(yyscan_t scanner)
void * state
Definition: obj_rules.h:55
perplex_t yyscan_t
Definition: obj_rules.h:52
#define __END_DECLS
Definition: common.h:74
YYCONDTYPE
Definition: obj_rules.h:32
void * obj_parser_get_extra(yyscan_t scanner)