• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

KHolidays Library

  • sources
  • kde-4.12
  • kdepimlibs
  • kholidays
  • parsers
  • plan2
holidayparserplan.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 KHolidays
45 {
46  class position;
47  class location;
48 }
49 
50 /* First part of user declarations. */
51 #line 30 "holidayparserplan.ypp"
52  /*** C/C++ Declarations ***/
53 
54 #include <stdio.h>
55 #include <stdlib.h>
56 #include <pwd.h>
57 #include <sys/types.h>
58 #include <sys/stat.h>
59 #include <limits.h>
60 #include <string>
61 
62 #include <QString>
63 
64 #include <KCalendarSystem>
65 
66 
67 
68 /* Line 35 of lalr1.cc. */
69 #line 70 "holidayparserplan.hpp"
70 
71 #include "location.hh"
72 
73 /* Enabling traces. */
74 #ifndef YYDEBUG
75 # define YYDEBUG 1
76 #endif
77 
78 /* Enabling verbose error messages. */
79 #ifdef YYERROR_VERBOSE
80 # undef YYERROR_VERBOSE
81 # define YYERROR_VERBOSE 1
82 #else
83 # define YYERROR_VERBOSE 1
84 #endif
85 
86 /* Enabling the token table. */
87 #ifndef YYTOKEN_TABLE
88 # define YYTOKEN_TABLE 0
89 #endif
90 
91 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
92  If N is 0, then set CURRENT to the empty location which ends
93  the previous symbol: RHS[0] (always defined). */
94 
95 #ifndef YYLLOC_DEFAULT
96 # define YYLLOC_DEFAULT(Current, Rhs, N) \
97 do { \
98  if (N) \
99  { \
100  (Current).begin = (Rhs)[1].begin; \
101  (Current).end = (Rhs)[N].end; \
102  } \
103  else \
104  { \
105  (Current).begin = (Current).end = (Rhs)[0].end; \
106  } \
107 } while (false)
108 #endif
109 
110 namespace KHolidays
111 {
112 
114  class HolidayParserPlan
115  {
116  public:
118 #ifndef YYSTYPE
119  union semantic_type
120 #line 86 "holidayparserplan.ypp"
121 { int ival; char *sval; }
122 /* Line 35 of lalr1.cc. */
123 #line 124 "holidayparserplan.hpp"
124  ;
125 #else
126  typedef YYSTYPE semantic_type;
127 #endif
128  typedef location location_type;
131  struct token
132  {
133  /* Tokens. */
134  enum yytokentype {
135  END = 0,
136  NUMBER = 258,
137  MONTH = 259,
138  WDAY = 260,
139  COLOR = 261,
140  STRING = 262,
141  CALENDAR = 263,
142  INOP = 264,
143  PLUS = 265,
144  MINUS = 266,
145  SMALL = 267,
146  YEAR = 268,
147  LEAPYEAR = 269,
148  SHIFT = 270,
149  IF = 271,
150  LENGTH = 272,
151  EASTER = 273,
152  EQ = 274,
153  NE = 275,
154  LE = 276,
155  GE = 277,
156  LT = 278,
157  GT = 279,
158  PASCHA = 280,
159  COUNTRY = 281,
160  LANGUAGE = 282,
161  NAME = 283,
162  DESCRIPTION = 284,
163  OR = 285,
164  AND = 286,
165  UMINUS = 287
166  };
167 
168  };
170  typedef token::yytokentype token_type;
171 
173  HolidayParserPlan (class HolidayParserDriverPlan& driver_yyarg);
174  virtual ~HolidayParserPlan ();
175 
178  virtual int parse ();
179 
181  std::ostream& debug_stream () const;
183  void set_debug_stream (std::ostream &);
184 
186  typedef int debug_level_type;
188  debug_level_type debug_level () const;
190  void set_debug_level (debug_level_type l);
191 
192  private:
196  virtual void error (const location_type& loc, const std::string& msg);
197 
201  virtual std::string yysyntax_error_ (int yystate, int tok);
202 
203 #if YYDEBUG
204  virtual void yy_symbol_value_print_ (int yytype,
209  const semantic_type* yyvaluep,
210  const location_type* yylocationp);
215  virtual void yy_symbol_print_ (int yytype,
216  const semantic_type* yyvaluep,
217  const location_type* yylocationp);
218 #endif /* ! YYDEBUG */
219 
220 
222  typedef int state_type;
224  typedef stack<state_type> state_stack_type;
226  typedef stack<semantic_type> semantic_stack_type;
228  typedef stack<location_type> location_stack_type;
229 
231  state_stack_type yystate_stack_;
233  semantic_stack_type yysemantic_stack_;
235  location_stack_type yylocation_stack_;
236 
238  typedef unsigned char token_number_type;
239  /* Tables. */
241  static const short int yypact_[];
242  static const short int yypact_ninf_;
243 
247  static const unsigned char yydefact_[];
248 
249  static const short int yypgoto_[];
250  static const signed char yydefgoto_[];
251 
257  static const short int yytable_[];
258  static const signed char yytable_ninf_;
259 
260  static const short int yycheck_[];
261 
263  static const unsigned char yystos_[];
264 
266  static const unsigned char yyr1_[];
268  static const unsigned char yyr2_[];
269 
270 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
271  static const char* const yytname_[];
273 #endif
274 
275 #if YYERROR_VERBOSE
276  virtual std::string yytnamerr_ (const char *n);
278 #endif
279 
280 #if YYDEBUG
281  typedef signed char rhs_number_type;
284  static const rhs_number_type yyrhs_[];
286  static const unsigned short int yyprhs_[];
288  static const unsigned char yyrline_[];
290  static const unsigned short int yytoken_number_[];
292  virtual void yy_reduce_print_ (int r);
294  virtual void yystack_print_ ();
295 #endif
296 
298  token_number_type yytranslate_ (int t);
299 
305  inline void yydestruct_ (const char* yymsg,
306  int yytype,
307  semantic_type* yyvaluep,
308  location_type* yylocationp);
309 
311  inline void yypop_ (unsigned int n = 1);
312 
313  /* Constants. */
314  static const int yyeof_;
315  /* LAST_ -- Last index in TABLE_. */
316  static const int yylast_;
317  static const int yynnts_;
318  static const int yyempty_;
319  static const int yyfinal_;
320  static const int yyterror_;
321  static const int yyerrcode_;
322  static const int yyntokens_;
323  static const unsigned int yyuser_token_number_max_;
324  static const token_number_type yyundef_token_;
325 
326  /* Debugging. */
327  int yydebug_;
328  std::ostream* yycdebug_;
329 
330 
331  /* User arguments. */
332  class HolidayParserDriverPlan& driver;
333  };
334 }
335 
336 
337 #endif /* ! defined PARSER_HEADER_H */
KHolidays::HolidayParserPlan::token_type
token::yytokentype token_type
Token type.
Definition: holidayparserplan.hpp:170
KHolidays::HolidayParserPlan::set_debug_stream
void set_debug_stream(std::ostream &)
Set the current debugging stream.
Definition: holidayparserplan.cpp:236
KHolidays::HolidayParserPlan::debug_level_type
int debug_level_type
Type for debugging levels.
Definition: holidayparserplan.hpp:186
KHolidays::HolidayParserPlan::set_debug_level
void set_debug_level(debug_level_type l)
Set the current debugging level.
Definition: holidayparserplan.cpp:249
KHolidays::HolidayParserPlan::semantic_type
Symbol semantic values.
Definition: holidayparserplan.hpp:119
KHolidays::HolidayParserPlan::debug_level
debug_level_type debug_level() const
The current debugging level.
Definition: holidayparserplan.cpp:243
location.hh
Define the KHolidays::location class.
KHolidays::HolidayParserPlan
A Bison parser.
Definition: holidayparserplan.hpp:114
KHolidays::HolidayParserPlan::location_type
location location_type
Symbol locations.
Definition: holidayparserplan.hpp:129
KHolidays::HolidayParserPlan::parse
virtual int parse()
Parse.
Definition: holidayparserplan.cpp:256
KHolidays::HolidayParserPlan::token
Tokens.
Definition: holidayparserplan.hpp:131
KHolidays::HolidayParserPlan::HolidayParserPlan
HolidayParserPlan(class HolidayParserDriverPlan &driver_yyarg)
Build a parser object.
Definition: holidayparserplan.cpp:159
KHolidays::location
Abstract a location.
Definition: location.hh:51
KHolidays::HolidayParserPlan::debug_stream
std::ostream & debug_stream() const
The current debugging stream.
Definition: holidayparserplan.cpp:230
KHolidays::HolidayParserDriverPlan
HolidayParserDriverPlan implementation class.
Definition: holidayparserdriverplan_p.h:53
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHolidays Library

Skip menu "KHolidays Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal