Skip to content
Skip to link menu
Trinity API Reference
Trinity API Reference
KDevelop AutoTools Parser
KDevelop AutoTools Parser
buildtools
lib
parsers
autotools
autotoolsdriver.cpp
1
/***************************************************************************
2
* Copyright (C) 2005 by Alexander Dymo *
3
* adymo@kdevelop.org *
4
* *
5
* Copyright (c) 2005 by Matt Rogers *
6
* mattr@kde.org *
7
* *
8
* This program is free software; you can redistribute it and/or modify *
9
* it under the terms of the GNU Library General Public License as *
10
* published by the Free Software Foundation; either version 2 of the *
11
* License, or (at your option) any later version. *
12
* *
13
* This program is distributed in the hope that it will be useful, *
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16
* GNU General Public License for more details. *
17
* *
18
* You should have received a copy of the GNU Library General Public *
19
* License along with this program; if not, write to the *
20
* Free Software Foundation, Inc., *
21
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
22
***************************************************************************/
23
#include "
autotoolsdriver.h
"
24
#include "autotoolsast.h"
25
26
#include <stdio.h>
27
#include <tqvaluestack.h>
28
#include <tdeio/netaccess.h>
29
30
extern
FILE *yyin, *yyout;
31
extern
int
yyparse();
32
//extern int yydebug;
33
extern
TQValueStack<AutoTools::ProjectAST *> projects;
34
35
namespace
AutoTools {
36
37
int
Driver::parseFile
(
const
char
*fileName,
ProjectAST
**ast)
38
{
39
//yydebug = 1;
40
yyin = fopen(fileName,
"r"
);
41
if
(yyin == 0)
42
{
43
ast = 0;
44
return
1;
45
}
46
int
ret = yyparse();
47
*ast = projects.top();
48
fclose(yyin);
49
return
ret;
50
}
51
52
int
Driver::parseFile
(TQString fileName,
ProjectAST
**ast)
53
{
54
return
parseFile
(fileName.ascii(), ast);
55
}
56
57
int
Driver::parseFile
(KURL fileName, ProjectAST **ast)
58
{
59
TQString tmpFile;
60
int
ret = 0;
61
if
(TDEIO::NetAccess::download(fileName, tmpFile, 0))
62
ret =
parseFile
(tmpFile, ast);
63
TDEIO::NetAccess::removeTempFile(tmpFile);
64
return
ret;
65
}
66
67
}
autotoolsdriver.h
Driver for a qmake parser.
AutoTools::Driver::parseFile
static int parseFile(const char *fileName, ProjectAST **ast)
Parses the file fileName and stores the resulting ProjectAST root into ast.
Definition
autotoolsdriver.cpp:37
AutoTools::ProjectAST
Project AST node.
Definition
autotoolsast.h:123
KDevelop AutoTools Parser
Skip menu "KDevelop AutoTools Parser"
Main Page
Class Hierarchy
Alphabetical List
Class List
File List
Class Members
KDevelop AutoTools Parser
Skip menu "KDevelop AutoTools Parser"
buildtools
lib
base
parsers
autotools
qmake
widgets
api
languages
lib
debugger
designer_integration
interfaces
lib
catalog
interfaces
extensions
external
extras
util
widgets
propeditor
parts
documentation
interfaces
src
profileengine
lib