1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 * Copyright (C) Sébastien Granjoux 2009 <seb.sfo@free.fr>
6 * main.c is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * main.c 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.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _AC_SCANNER_H_
21 #define _AC_SCANNER_H_
23 #include "am-project.h"
30 /* Token location is found directly from token value. We don't maintain a
31 * independent position. */
32 #define YYLTYPE AnjutaToken*
33 #define YYSTYPE AnjutaToken*
35 typedef struct _AmpAcScanner AmpAcScanner
;
37 AmpAcScanner
*amp_ac_scanner_new (AmpProject
*project
);
38 void amp_ac_scanner_free (AmpAcScanner
*scanner
);
40 gboolean
amp_ac_scanner_parse (AmpAcScanner
*scanner
, AnjutaTokenFile
*file
, GError
**error
);
41 AnjutaToken
* amp_ac_scanner_parse_token (AmpAcScanner
*scanner
, AnjutaToken
*root
, AnjutaToken
*content
, gint start
, GFile
*filename
, GError
**error
);
43 void amp_ac_scanner_load_module (AmpAcScanner
*scanner
, AnjutaToken
*module
);
44 void amp_ac_scanner_load_config (AmpAcScanner
*scanner
, AnjutaToken
*list
);
45 void amp_ac_scanner_load_properties (AmpAcScanner
*scanner
, AnjutaToken
*macro
, AnjutaToken
*args
);
46 void amp_ac_scanner_include (AmpAcScanner
*scanner
, AnjutaToken
*list
);
47 void amp_ac_scanner_update_variable (AmpAcScanner
*scanner
, AnjutaToken
*variable
);
48 void amp_ac_scanner_subst_variable (AmpAcScanner
*scanner
, AnjutaToken
*list
);
50 void amp_ac_yyerror (YYLTYPE
*loc
, AmpAcScanner
*scanner
, char const *s
);
54 /* Order is important as the backend will try to follow it */
55 AC_TOKEN_FIRST_ORDERED_MACRO
= ANJUTA_TOKEN_USER
,
56 /* requirements & informations */
59 AC_TOKEN_AC_CONFIG_HEADERS
,
60 AC_TOKEN_AC_CONFIG_SRCDIR
,
61 AC_TOKEN_AC_CONFIG_MACRO_DIR
,
62 AC_TOKEN_AM_INIT_AUTOMAKE
,
65 AC_TOKEN_AM_MAINTAINER_MODE
,
66 AC_TOKEN_AC_ARG_ENABLE
,
68 /* Check for programs */
73 AC_TOKEN_AC_PROG_YACC
,
74 AC_TOKEN_AC_PROG_RANLIB
,
75 AC_TOKEN_IT_PROG_INTLTOOL
,
78 AC_TOKEN_AM_PROG_LIBTOOL
,
79 AC_TOKEN_AC_PROG_LIBTOOL
,
80 AC_TOKEN_PKG_PROG_PKG_CONFIG
,
81 AC_TOKEN_AC_CHECK_PROG
,
82 AC_TOKEN_AM_GLIB_GNU_GETTEXT
,
84 /* Check for libraries */
85 AC_TOKEN_PKG_CHECK_MODULES
,
86 AC_TOKEN_AC_CHECK_LIB
,
88 /* Check for headers */
89 AC_TOKEN_AC_HEADER_STDC
,
90 AC_TOKEN_AC_CHECK_HEADERS
,
91 AC_TOKEN_AC_EGREP_HEADER
,
93 /* Check for types & structures */
97 AC_TOKEN_AC_TYPE_SIZE_T
,
98 AC_TOKEN_AC_TYPE_OFF_T
,
100 /* Check for functions */
101 AC_TOKEN_AC_CHECK_FUNCS
,
104 AC_TOKEN_AC_CONFIG_FILES
,
105 AC_TOKEN_OBSOLETE_AC_OUTPUT
,
107 AC_TOKEN_LAST_ORDERED_MACRO
,
112 AC_TOKEN_OPEN_STRING
,
113 AC_TOKEN_CLOSE_STRING
118 AC_SPACE_LIST_STATE
= 1