• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop AutoTools Parser
 

KDevelop AutoTools Parser

  • buildtools
  • lib
  • parsers
  • autotools
autotoolsast.h
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 #ifndef AUTOTOOLSAST_H
24 #define AUTOTOOLSAST_H
25 
26 #include <tqstringlist.h>
27 
33 namespace AutoTools
34 {
35 
46 class AST
47 {
48 public:
50  enum NodeType {
51  ProjectAST,
52  AssignmentAST,
53  TargetAST,
54  MakefileConditionalAST,
55  NewLineAST,
56  CommentAST
57  };
58 
60  AST(NodeType nodeType): m_nodeType(nodeType), m_depth(0) {}
61  virtual ~AST();
62 
67  virtual void addChildAST(AST *node);
68 
74  virtual void writeBack(TQString &buffer);
75 
77  virtual NodeType nodeType() const { return m_nodeType; }
78 
80  void setDepth(int depth) { m_depth = depth; }
81 
83  int depth() const { return m_depth; }
84 
86  virtual TQString indentation();
87 
89  bool hasChildren() const;
90 
95  TQValueList<AST*> children() const;
96 
97 
98 
99 protected:
100  NodeType m_nodeType;
101  TQValueList<AST*> m_children;
102 
103 private:
104  int m_depth;
105 
106 };
107 
108 
122 class ProjectAST: public AST
123 {
124 public:
126  enum Kind
127  {
128  Project,
129  Target,
130  ConditionalScope,
131  Rule,
132  Empty
133  };
134 
136  ProjectAST(Kind kind = Project): AST(AST::ProjectAST), m_kind(kind) {}
137 
138  virtual void writeBack(TQString &buffer);
139  virtual void addChildAST(AST *node);
140 
142  bool isProject() const { return m_kind == Project; }
143 
144  bool isRule() const { return m_kind == Rule; }
145 
147  bool isConditionalScope() const { return m_kind == ConditionalScope; }
148 
150  bool isEmpty() const { return m_kind == Empty; }
151 
153  TQString scopedID;
154 
156  TQString args;
157 
159  bool hasElse;
160 
162  TQValueList<AutoTools::AST*> statements;
163 
164 private:
165  Kind m_kind;
166 
167 };
168 
169 
190 class AssignmentAST: public AST
191 {
192 public:
193  AssignmentAST(): AST(AST::AssignmentAST) {}
194 
195  virtual void writeBack(TQString &buffer);
196 
198  TQString scopedID;
199 
201  TQString op;
202 
204  TQStringList values;
205 };
206 
207 class AutomakeTargetAST : public AST
208 {
209 public:
210  AutomakeTargetAST() : AST(AST::TargetAST) {}
211 
212  virtual void writeBack( TQString& buffer );
213 
215  TQString target;
216 
218  TQStringList deps;
219 };
220 
221 class ConditionAST : public AST
222 {
223 public:
224  ConditionAST() : AST( AST::MakefileConditionalAST ) {}
225 
226  virtual void writeBack( TQString& buffer );
227 
229  TQString type;
230 
232  TQString conditionName;
233 };
234 
239 class NewLineAST: public AST
240 {
241 public:
242  NewLineAST(): AST(AST::NewLineAST) {}
243 
244  virtual void writeBack(TQString &buffer);
245 
246 };
247 
248 
253 class CommentAST: public AST
254 {
255 public:
256  CommentAST(): AST(AST::CommentAST) {}
257 
258  virtual void writeBack(TQString &buffer);
259 
261  TQString comment;
262 
263 };
264 
265 }
266 
267 #endif
268 
269 // kate: indent-mode csands; space-indent off; tab-width 4; auto-insert-doxygen on;
AutoTools::AST::MakefileConditionalAST
Makefile.am conditional.
Definition: autotoolsast.h:54
AutoTools::AST::AssignmentAST
Variable assignment.
Definition: autotoolsast.h:52
AutoTools::AST::indentation
virtual TQString indentation()
Definition: autotoolsast.cpp:53
AutoTools::AST::ProjectAST
Project, scope or function scope.
Definition: autotoolsast.h:51
AutoTools::AST::writeBack
virtual void writeBack(TQString &buffer)
Writes information stored in the AST into the buffer.
Definition: autotoolsast.cpp:43
AutoTools::ProjectAST::scopedID
TQString scopedID
Scoped identifier (scope name or rule).
Definition: autotoolsast.h:153
AutoTools::ProjectAST::ConditionalScope
Automake Conditional.
Definition: autotoolsast.h:130
AutoTools::ProjectAST
Project AST node.
Definition: autotoolsast.h:122
AutoTools::ProjectAST::ProjectAST
ProjectAST(Kind kind=Project)
Constructs a project node of given kind.
Definition: autotoolsast.h:136
AutoTools::AST::AST
AST(NodeType nodeType)
Constructs AST with given node type.
Definition: autotoolsast.h:60
AutoTools::AssignmentAST::op
TQString op
Operator.
Definition: autotoolsast.h:201
AutoTools::ProjectAST::Rule
Automake Rule.
Definition: autotoolsast.h:131
AutoTools::AST::hasChildren
bool hasChildren() const
Definition: autotoolsast.cpp:61
AutoTools::AssignmentAST::values
TQStringList values
List of values.
Definition: autotoolsast.h:204
AutoTools::AssignmentAST::scopedID
TQString scopedID
Scoped name of the variable.
Definition: autotoolsast.h:198
AutoTools::AST::addChildAST
virtual void addChildAST(AST *node)
Adds child AST node to this node.
Definition: autotoolsast.cpp:38
AutoTools::AST::NodeType
NodeType
Type of AST node.
Definition: autotoolsast.h:50
AutoTools::ProjectAST::statements
TQValueList< AutoTools::AST * > statements
List of statements.
Definition: autotoolsast.h:162
AutoTools::ProjectAST::Project
Project.
Definition: autotoolsast.h:128
AutoTools::CommentAST::comment
TQString comment
Comment text.
Definition: autotoolsast.h:261
AutoTools::ProjectAST::isEmpty
bool isEmpty() const
Definition: autotoolsast.h:150
AutoTools::AST::NewLineAST
Line feed.
Definition: autotoolsast.h:55
AutoTools::ProjectAST::isConditionalScope
bool isConditionalScope() const
Definition: autotoolsast.h:147
AutoTools::ProjectAST::hasElse
bool hasElse
The automake conditional has an else attached.
Definition: autotoolsast.h:159
AutoTools::ProjectAST::Target
Custom Automake Target.
Definition: autotoolsast.h:129
AutoTools::AssignmentAST
Assignment AST node.
Definition: autotoolsast.h:190
AutoTools::AST::CommentAST
Comment.
Definition: autotoolsast.h:56
AutoTools::AST::nodeType
virtual NodeType nodeType() const
Definition: autotoolsast.h:77
AutoTools::AST
AST node.
Definition: autotoolsast.h:46
AutoTools::ProjectAST::Kind
Kind
The kind of a project node.
Definition: autotoolsast.h:126
AutoTools::AST::setDepth
void setDepth(int depth)
Sets the depth of the node in AST.
Definition: autotoolsast.h:80
AutoTools::ProjectAST::isProject
bool isProject() const
Definition: autotoolsast.h:142
AutoTools::ProjectAST::args
TQString args
Function arguments.
Definition: autotoolsast.h:156
AutoTools::NewLineAST
New line AST node.
Definition: autotoolsast.h:239
AutoTools::AST::children
TQValueList< AST * > children() const
Get the children of this ast.
Definition: autotoolsast.cpp:66
AutoTools::AST::TargetAST
Automake target.
Definition: autotoolsast.h:53
AutoTools
Definition: autotoolsast.cpp:25
AutoTools::AST::depth
int depth() const
Definition: autotoolsast.h:83
AutoTools::CommentAST
Comment AST node.
Definition: autotoolsast.h:253

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
Generated for KDevelop AutoTools Parser by doxygen 1.8.13
This website is maintained by Timothy Pearson.