• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop QMake parser
 

KDevelop QMake parser

  • buildtools
  • lib
  • parsers
  • qmake
qmakeast.h
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (C) 2005 by Alexander Dymo *
3 * adymo@kdevelop.org *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU Library General Public License as *
7 * published by the Free Software Foundation; either version 2 of the *
8 * License, or (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU Library General Public *
16 * License along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
20#ifndef TQMAKETQMAKEAST_H
21#define TQMAKETQMAKEAST_H
22
23#include <tqstringlist.h>
24
29
30namespace TQMake {
31
42class AST {
43public:
45 enum NodeType {
46 ProjectAST ,
47 AssignmentAST ,
48 NewLineAST ,
49 CommentAST ,
50 IncludeAST ,
51 OrOperatorAST /* | */
52 };
53
55 AST(NodeType nodeType): m_nodeType(nodeType), m_depth(0) {}
56 virtual ~AST();
57
61 virtual void addChildAST(AST *node);
65 virtual void removeChildAST(AST *node);
69 virtual void writeBack(TQString &buffer);
70
72 virtual NodeType nodeType() const { return m_nodeType; }
73
75 void setDepth(int depth) { m_depth = depth; }
77 int depth() const { return m_depth; }
79 virtual TQString indentation();
80
82 TQValueList<AST*> m_children;
83
84protected:
85 NodeType m_nodeType;
86
87private:
88 int m_depth;
89
90};
91
92
106class ProjectAST: public AST {
107public:
109 enum Kind {
110 Project ,
111 Scope ,
112 FunctionScope ,
113 Empty
114 };
115
116 enum LineEnding {
117 Unix,
118 MacOS,
119 Windows
120 };
121
123 ProjectAST(Kind kind = Project): AST(AST::ProjectAST), m_kind(kind) {}
124
125 virtual void writeBack(TQString &buffer);
126
128 bool isProject() const { return m_kind == Project; }
130 bool isScope() const { return m_kind == Scope; }
132 bool isFunctionScope() const { return m_kind == FunctionScope; }
134 bool isEmpty() const { return m_kind == Empty; }
135
136 void setFileName(const TQString& fileName) { m_fileName = fileName; }
137 TQString fileName() const { return m_fileName; }
138
139 void setLineEnding( LineEnding );
140 LineEnding lineEnding();
141
143 TQString scopedID;
145 TQString args;
146
147private:
148 Kind m_kind;
149 TQString m_fileName;
150 LineEnding m_lineEnding;
151};
152
153
174class AssignmentAST: public AST {
175public:
176 AssignmentAST(): AST(AST::AssignmentAST){}
177 ~AssignmentAST();
178
179 virtual void writeBack(TQString &buffer);
180
182 TQString scopedID;
184 TQString op;
186 TQStringList values;
188 TQString indent;
189};
190
191
196class NewLineAST: public AST {
197public:
198 NewLineAST(): AST(AST::NewLineAST) {}
199
200 virtual void writeBack(TQString &buffer);
201
202};
203
204
209class CommentAST: public AST {
210public:
211 CommentAST(): AST(AST::CommentAST) {}
212
213 virtual void writeBack(TQString &buffer);
214
216 TQString comment;
217
218};
219
220
225class IncludeAST: public AST {
226public:
227 IncludeAST(): AST(AST::IncludeAST) {}
228
229 virtual void writeBack(TQString &buffer);
230
231 TQString projectName;
232};
233
234}
235
236#endif
TQMake::AST
AST node.
Definition qmakeast.h:42
TQMake::AST::writeBack
virtual void writeBack(TQString &buffer)
Writes information stored in the AST into the buffer.
Definition qmakeast.cpp:48
TQMake::AST::indentation
virtual TQString indentation()
Definition qmakeast.cpp:60
TQMake::AST::setDepth
void setDepth(int depth)
Sets the depth of the node in AST.
Definition qmakeast.h:75
TQMake::AST::m_children
TQValueList< AST * > m_children
The list of child AST nodes.
Definition qmakeast.h:82
TQMake::AST::addChildAST
virtual void addChildAST(AST *node)
Adds child AST node to this node.
Definition qmakeast.cpp:38
TQMake::AST::depth
int depth() const
Definition qmakeast.h:77
TQMake::AST::removeChildAST
virtual void removeChildAST(AST *node)
Removes child AST node from this node.
Definition qmakeast.cpp:43
TQMake::AST::NodeType
NodeType
Type of AST node.
Definition qmakeast.h:45
TQMake::AST::ProjectAST
@ ProjectAST
Project, scope or function scope.
Definition qmakeast.h:46
TQMake::AST::IncludeAST
@ IncludeAST
.pri include.
Definition qmakeast.h:50
TQMake::AST::NewLineAST
@ NewLineAST
Line feed.
Definition qmakeast.h:48
TQMake::AST::AssignmentAST
@ AssignmentAST
Variable assignment.
Definition qmakeast.h:47
TQMake::AST::CommentAST
@ CommentAST
Comment.
Definition qmakeast.h:49
TQMake::AST::AST
AST(NodeType nodeType)
Constructs AST with given node type.
Definition qmakeast.h:55
TQMake::AST::nodeType
virtual NodeType nodeType() const
Definition qmakeast.h:72
TQMake::AssignmentAST::indent
TQString indent
Indentation of multiline values.
Definition qmakeast.h:188
TQMake::AssignmentAST::op
TQString op
Operator.
Definition qmakeast.h:184
TQMake::AssignmentAST::scopedID
TQString scopedID
Scoped name of the variable.
Definition qmakeast.h:182
TQMake::AssignmentAST::writeBack
virtual void writeBack(TQString &buffer)
Writes information stored in the AST into the buffer.
Definition qmakeast.cpp:131
TQMake::AssignmentAST::values
TQStringList values
List of values.
Definition qmakeast.h:186
TQMake::CommentAST::writeBack
virtual void writeBack(TQString &buffer)
Writes information stored in the AST into the buffer.
Definition qmakeast.cpp:152
TQMake::CommentAST::comment
TQString comment
Comment text.
Definition qmakeast.h:216
TQMake::IncludeAST::writeBack
virtual void writeBack(TQString &buffer)
Writes information stored in the AST into the buffer.
Definition qmakeast.cpp:162
TQMake::NewLineAST::writeBack
virtual void writeBack(TQString &buffer)
Writes information stored in the AST into the buffer.
Definition qmakeast.cpp:144
TQMake::ProjectAST::ProjectAST
ProjectAST(Kind kind=Project)
Constructs a project node of given kind.
Definition qmakeast.h:123
TQMake::ProjectAST::isProject
bool isProject() const
Definition qmakeast.h:128
TQMake::ProjectAST::isFunctionScope
bool isFunctionScope() const
Definition qmakeast.h:132
TQMake::ProjectAST::writeBack
virtual void writeBack(TQString &buffer)
Writes information stored in the AST into the buffer.
Definition qmakeast.cpp:70
TQMake::ProjectAST::isScope
bool isScope() const
Definition qmakeast.h:130
TQMake::ProjectAST::Kind
Kind
The kind of a project node.
Definition qmakeast.h:109
TQMake::ProjectAST::FunctionScope
@ FunctionScope
FunctionScope.
Definition qmakeast.h:112
TQMake::ProjectAST::Scope
@ Scope
Scope.
Definition qmakeast.h:111
TQMake::ProjectAST::Empty
@ Empty
Project does not exist, the AST is empty.
Definition qmakeast.h:113
TQMake::ProjectAST::Project
@ Project
Project.
Definition qmakeast.h:110
TQMake::ProjectAST::scopedID
TQString scopedID
Scoped identifier (scope name or function name).
Definition qmakeast.h:143
TQMake::ProjectAST::args
TQString args
Function arguments.
Definition qmakeast.h:145
TQMake::ProjectAST::isEmpty
bool isEmpty() const
Definition qmakeast.h:134

KDevelop QMake parser

Skip menu "KDevelop QMake parser"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

KDevelop QMake parser

Skip menu "KDevelop QMake 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
Generated for KDevelop QMake parser by doxygen 1.15.0
This website is maintained by Timothy Pearson.