summaryrefslogtreecommitdiff
path: root/Source/cmDependsFortranParser.h
blob: 399c3c8d96e837369055f5c74a41b4de13296f62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*============================================================================
  CMake - Cross Platform Makefile Generator
  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium

  Distributed under the OSI-approved BSD License (the "License");
  see accompanying file Copyright.txt for details.

  This software is distributed WITHOUT ANY WARRANTY; without even the
  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the License for more information.
============================================================================*/
#ifndef cmDependsFortranParser_h
#define cmDependsFortranParser_h

#include <stddef.h> /* size_t */

/* Forward declare parser object type.  */
typedef struct cmDependsFortranParser_s cmDependsFortranParser;

/* Functions to enter/exit #include'd files in order.  */
bool cmDependsFortranParser_FilePush(cmDependsFortranParser* parser,
                                    const char* fname);
bool cmDependsFortranParser_FilePop(cmDependsFortranParser* parser);

/* Callbacks for lexer.  */
int cmDependsFortranParser_Input(cmDependsFortranParser* parser,
                                 char* buffer, size_t bufferSize);


void cmDependsFortranParser_StringStart(cmDependsFortranParser* parser);
const char* cmDependsFortranParser_StringEnd(cmDependsFortranParser* parser);
void cmDependsFortranParser_StringAppend(cmDependsFortranParser* parser,
                                         char c);

void cmDependsFortranParser_SetInInterface(cmDependsFortranParser* parser,
                                           bool is_in);
bool cmDependsFortranParser_GetInInterface(cmDependsFortranParser* parser);


void cmDependsFortranParser_SetInPPFalseBranch(cmDependsFortranParser* parser,
                                               bool is_in);
bool cmDependsFortranParser_GetInPPFalseBranch(cmDependsFortranParser* parser);


void cmDependsFortranParser_SetOldStartcond(cmDependsFortranParser* parser,
                                            int arg);
int cmDependsFortranParser_GetOldStartcond(cmDependsFortranParser* parser);

/* Callbacks for parser.  */
void cmDependsFortranParser_Error(cmDependsFortranParser* parser,
                                  const char* message);
void cmDependsFortranParser_RuleUse(cmDependsFortranParser* parser,
                                    const char* name);
void cmDependsFortranParser_RuleInclude(cmDependsFortranParser* parser,
                                        const char* name);
void cmDependsFortranParser_RuleModule(cmDependsFortranParser* parser,
                                       const char* name);
void cmDependsFortranParser_RuleDefine(cmDependsFortranParser* parser,
                                       const char* name);
void cmDependsFortranParser_RuleUndef(cmDependsFortranParser* parser,
                                      const char* name);
void cmDependsFortranParser_RuleIfdef(cmDependsFortranParser* parser,
                                      const char* name);
void cmDependsFortranParser_RuleIfndef(cmDependsFortranParser* parser,
                                       const char* name);
void cmDependsFortranParser_RuleIf(cmDependsFortranParser* parser);
void cmDependsFortranParser_RuleElif(cmDependsFortranParser* parser);
void cmDependsFortranParser_RuleElse(cmDependsFortranParser* parser);
void cmDependsFortranParser_RuleEndif(cmDependsFortranParser* parser);

/* Define the parser stack element type.  */
typedef union cmDependsFortran_yystype_u cmDependsFortran_yystype;
union cmDependsFortran_yystype_u
{
  char* string;
};

/* Setup the proper yylex interface.  */
#define YY_EXTRA_TYPE cmDependsFortranParser*
#define YY_DECL \
int cmDependsFortran_yylex(YYSTYPE* yylvalp, yyscan_t yyscanner)
#define YYSTYPE cmDependsFortran_yystype
#define YYSTYPE_IS_DECLARED 1
#if !defined(cmDependsFortranLexer_cxx)
# include "cmDependsFortranLexer.h"
#endif
#if !defined(cmDependsFortranLexer_cxx)
#if !defined(cmDependsFortranParser_cxx)
# undef YY_EXTRA_TYPE
# undef YY_DECL
# undef YYSTYPE
# undef YYSTYPE_IS_DECLARED
#endif
#endif

#endif