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

KDevelop QMake parser

  • buildtools
  • lib
  • parsers
  • qmake
qmake_yacc.hpp
1 /* A Bison parser, made by GNU Bison 2.3. */
2 
3 /* Skeleton interface for Bison LALR(1) parsers in C++
4 
5  Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2, or (at your option)
10  any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA. */
21 
22 /* As a special exception, you may create a larger work that contains
23  part or all of the Bison parser skeleton and distribute that work
24  under terms of your choice, so long as that work isn't itself a
25  parser generator using the skeleton or a modified version thereof
26  as a parser skeleton. Alternatively, if you modify or redistribute
27  the parser skeleton itself, you may (at your option) remove this
28  special exception, which will cause the skeleton and the resulting
29  Bison output files to be licensed under the GNU General Public
30  License without this special exception.
31 
32  This special exception was added by the Free Software Foundation in
33  version 2.2 of Bison. */
34 
35 /* C++ LALR(1) parser skeleton written by Akim Demaille. */
36 
37 #ifndef PARSER_HEADER_H
38 # define PARSER_HEADER_H
39 
40 #include <string>
41 #include <iostream>
42 #include "stack.hh"
43 
44 namespace TQMake
45 {
46  class position;
47  class location;
48 }
49 
50 /* First part of user declarations. */
51 #line 1 "qmake.yy"
52 
53 /***************************************************************************
54  * Copyright (C) 2005 by Alexander Dymo *
55  * adymo@kdevelop.org *
56  * Copyright (C) 2006 by Andreas Pakulat *
57  * apaku@gmx.de *
58  * *
59  * This program is free software; you can redistribute it and/or modify *
60  * it under the terms of the GNU Library General Public License as *
61  * published by the Free Software Foundation; either version 2 of the *
62  * License, or (at your option) any later version. *
63  * *
64  * This program is distributed in the hope that it will be useful, *
65  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
66  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
67  * GNU General Public License for more details. *
68  * *
69  * You should have received a copy of the GNU Library General Public *
70  * License along with this program; if not, write to the *
71  * Free Software Foundation, Inc., *
72  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
73  ***************************************************************************/
74 
88 #include <tqvaluestack.h>
89 #include "qmakeast.h"
90 #include <tqregexp.h>
91 
92 #define YYSTYPE_IS_DECLARED
93 
94 namespace TQMake
95 {
96  class Lexer;
97 
101 struct Result {
102  Result(): node(0) {}
103 
105  TQString value;
107  AST *node;
124  TQStringList values;
125  TQString indent;
126 };
127 
128 #define YYSTYPE Result
129 typedef Result YYSTYPE;
130 }
131 
132 extern int TQMakelex( TQMake::Result* yylval, TQMake::Lexer* lexer );
133 
146 //TQValueStack<ProjectAST*> projects;
147 
154 // int depth = 0;
155 
156 /*
157 To debug this parser, put the line below into the next bison file section.
158 Don't forget to uncomment "yydebug = 1" line in qmakedriver.cpp.
159 %debug
160 */
161 
162 
163 /* Line 35 of lalr1.cc. */
164 #line 165 "qmake_yacc.hpp"
165 
166 #include "location.hh"
167 
168 /* Enabling traces. */
169 #ifndef YYDEBUG
170 # define YYDEBUG 1
171 #endif
172 
173 /* Enabling verbose error messages. */
174 #ifdef YYERROR_VERBOSE
175 # undef YYERROR_VERBOSE
176 # define YYERROR_VERBOSE 1
177 #else
178 # define YYERROR_VERBOSE 0
179 #endif
180 
181 /* Enabling the token table. */
182 #ifndef YYTOKEN_TABLE
183 # define YYTOKEN_TABLE 1
184 #endif
185 
186 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
187  If N is 0, then set CURRENT to the empty location which ends
188  the previous symbol: RHS[0] (always defined). */
189 
190 #ifndef YYLLOC_DEFAULT
191 # define YYLLOC_DEFAULT(Current, Rhs, N) \
192 do { \
193  if (N) \
194  { \
195  (Current).begin = (Rhs)[1].begin; \
196  (Current).end = (Rhs)[N].end; \
197  } \
198  else \
199  { \
200  (Current).begin = (Current).end = (Rhs)[0].end; \
201  } \
202 } while (false)
203 #endif
204 
205 namespace TQMake
206 {
207 
209  class Parser
210  {
211  public:
213 #ifndef YYSTYPE
214  typedef int semantic_type;
215 #else
216  typedef YYSTYPE semantic_type;
217 #endif
218  typedef location location_type;
221  struct token
222  {
223  /* Tokens. */
224  enum yytokentype {
225  ID_SIMPLE = 258,
226  EQ = 259,
227  PLUSEQ = 260,
228  MINUSEQ = 261,
229  STAREQ = 262,
230  TILDEEQ = 263,
231  LBRACE = 264,
232  RBRACE = 265,
233  COLON = 266,
234  NEWLINE = 267,
235  COMMENT = 268,
236  CONT = 269,
237  COMMENT_CONT = 270,
238  RCURLY = 271,
239  LCURLY = 272,
240  ID_ARGS = 273,
241  QUOTED_VARIABLE_VALUE = 274,
242  VARIABLE_VALUE = 275,
243  LIST_WS = 276,
244  ENDOFFILE = 277
245  };
246 
247  };
249  typedef token::yytokentype token_type;
250 
252  Parser (TQMake::Lexer* lexer_yyarg, TQValueStack<ProjectAST*>& projects_yyarg, int depth_yyarg);
253  virtual ~Parser ();
254 
257  virtual int parse ();
258 
260  std::ostream& debug_stream () const;
262  void set_debug_stream (std::ostream &);
263 
265  typedef int debug_level_type;
267  debug_level_type debug_level () const;
269  void set_debug_level (debug_level_type l);
270 
271  private:
275  virtual void error (const location_type& loc, const std::string& msg);
276 
280  virtual std::string yysyntax_error_ (int yystate);
281 
282 #if YYDEBUG
283  virtual void yy_symbol_value_print_ (int yytype,
288  const semantic_type* yyvaluep,
289  const location_type* yylocationp);
294  virtual void yy_symbol_print_ (int yytype,
295  const semantic_type* yyvaluep,
296  const location_type* yylocationp);
297 #endif /* ! YYDEBUG */
298 
299 
301  typedef int state_type;
303  typedef stack<state_type> state_stack_type;
305  typedef stack<semantic_type> semantic_stack_type;
307  typedef stack<location_type> location_stack_type;
308 
310  state_stack_type yystate_stack_;
312  semantic_stack_type yysemantic_stack_;
314  location_stack_type yylocation_stack_;
315 
317  typedef unsigned char token_number_type;
318  /* Tables. */
320  static const signed char yypact_[];
321  static const signed char yypact_ninf_;
322 
326  static const unsigned char yydefact_[];
327 
328  static const signed char yypgoto_[];
329  static const signed char yydefgoto_[];
330 
336  static const signed char yytable_[];
337  static const signed char yytable_ninf_;
338 
339  static const unsigned char yycheck_[];
340 
342  static const unsigned char yystos_[];
343 
345  static const unsigned char yyr1_[];
347  static const unsigned char yyr2_[];
348 
349 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
350  static const char* const yytname_[];
352 #endif
353 
354 #if YYERROR_VERBOSE
355  virtual std::string yytnamerr_ (const char *n);
357 #endif
358 
359 #if YYDEBUG
360  typedef signed char rhs_number_type;
363  static const rhs_number_type yyrhs_[];
365  static const unsigned char yyprhs_[];
367  static const unsigned short int yyrline_[];
369  static const unsigned short int yytoken_number_[];
371  virtual void yy_reduce_print_ (int r);
373  virtual void yystack_print_ ();
374 #endif
375 
377  token_number_type yytranslate_ (int t);
378 
384  inline void yydestruct_ (const char* yymsg,
385  int yytype,
386  semantic_type* yyvaluep,
387  location_type* yylocationp);
388 
390  inline void yypop_ (unsigned int n = 1);
391 
392  /* Constants. */
393  static const int yyeof_;
394  /* LAST_ -- Last index in TABLE_. */
395  static const int yylast_;
396  static const int yynnts_;
397  static const int yyempty_;
398  static const int yyfinal_;
399  static const int yyterror_;
400  static const int yyerrcode_;
401  static const int yyntokens_;
402  static const unsigned int yyuser_token_number_max_;
403  static const token_number_type yyundef_token_;
404 
405  /* Debugging. */
406  int yydebug_;
407  std::ostream* yycdebug_;
408 
409 
410  /* User arguments. */
411  TQMake::Lexer* lexer;
412  TQValueStack<ProjectAST*>& projects;
413  int depth;
414  };
415 }
416 
417 
418 #endif /* ! defined PARSER_HEADER_H */
TQMake::Parser::token
Tokens.
Definition: qmake_yacc.hpp:221
TQMake::location
Abstract a location.
Definition: location.hh:51
TQMake
Definition: location.hh:47
TQMake::Result
The yylval type.
Definition: qmake_yacc.hpp:101
TQMake::Parser::debug_level_type
int debug_level_type
Type for debugging levels.
Definition: qmake_yacc.hpp:265
location.hh
Define the TQMake::location class.
TQMake::Result::values
TQStringList values
Type of semantic value for "multiline_values" grammar rule.
Definition: qmake_yacc.hpp:124
qmakeast.h
Abstract Syntax Tree (AST) class declarations.
TQMake::AST
AST node.
Definition: qmakeast.h:42
TQMake::Parser::token_type
token::yytokentype token_type
Token type.
Definition: qmake_yacc.hpp:249
TQMake::Result::value
TQString value
Type of semantic value for simple grammar rules.
Definition: qmake_yacc.hpp:105
TQMake::Parser::semantic_type
YYSTYPE semantic_type
Symbol semantic values.
Definition: qmake_yacc.hpp:216
TQMake::Parser
A Bison parser.
Definition: qmake_yacc.hpp:209
TQMake::Result::node
AST * node
Type of semantic value for grammar rules which are parts of AST.
Definition: qmake_yacc.hpp:107

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.8.13
This website is maintained by Timothy Pearson.