breakout_parser 0.0.23 → 0.0.31

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2482 +0,0 @@
1
-
2
- /* A Bison parser, made by GNU Bison 2.4.1. */
3
-
4
- /* Skeleton implementation for Bison's Yacc-like parsers in C
5
-
6
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7
- Free Software Foundation, Inc.
8
-
9
- This program is free software: you can redistribute it and/or modify
10
- it under the terms of the GNU General Public License as published by
11
- the Free Software Foundation, either version 3 of the License, or
12
- (at your option) any later version.
13
-
14
- This program is distributed in the hope that it will be useful,
15
- but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- GNU General Public License for more details.
18
-
19
- You should have received a copy of the GNU General Public License
20
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
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 Richard Stallman, by
36
- simplifying the original so-called "semantic" parser. */
37
-
38
- /* All symbols defined below should begin with yy or YY, to avoid
39
- infringing on user name space. This should be done even for local
40
- variables, as they might otherwise be expanded by user macros.
41
- There are some unavoidable exceptions within include files to
42
- define necessary library symbols; they are noted "INFRINGES ON
43
- USER NAME SPACE" below. */
44
-
45
- /* Identify Bison output. */
46
- #define YYBISON 1
47
-
48
- /* Bison version. */
49
- #define YYBISON_VERSION "2.4.1"
50
-
51
- /* Skeleton name. */
52
- #define YYSKELETON_NAME "yacc.c"
53
-
54
- /* Pure parsers. */
55
- #define YYPURE 0
56
-
57
- /* Push parsers. */
58
- #define YYPUSH 0
59
-
60
- /* Pull parsers. */
61
- #define YYPULL 1
62
-
63
- /* Using locations. */
64
- #define YYLSP_NEEDED 0
65
-
66
-
67
-
68
- /* Copy the first part of user declarations. */
69
-
70
- /* Line 189 of yacc.c */
71
- #line 2 "parser.y"
72
-
73
- #include <stdio.h>
74
- #include <stdlib.h>
75
- #include <string.h>
76
-
77
- #ifdef RUBY_VERSION
78
- #include "ruby.h"
79
- #else
80
- #define REALLOC_N(ptr,type,n) ptr=realloc(ptr,sizeof(type)*n)
81
- #endif
82
-
83
- extern int yylex();
84
-
85
- char *in_buf = NULL, *in_pos = NULL;
86
- size_t in_buf_len = 0;
87
-
88
- char *buf = NULL, *bufptr = NULL;
89
- size_t bufsize = 0;
90
-
91
- const char *space_name = NULL;
92
- size_t space_name_len = 0;
93
-
94
- const char *site_url = NULL;
95
- size_t site_url_len = 0;
96
-
97
- extern VALUE vcs_url;
98
-
99
- int list_level = 1;
100
- int absolute_urls = 0;
101
-
102
- #define CHECK_BUF_SIZE(len) \
103
- if( (bufptr - buf + len + 1) >= bufsize ){ \
104
- /*printf("[.] REALLOC oldsz=%d, newsz=%d\n",bufsize, (bufsize+((len > 0x1000) ? (len+0x1000) : 0x1000)));*/ \
105
- char *oldbuf = buf; \
106
- bufsize += (len > 0x1000) ? (len+0x1000) : 0x1000; \
107
- REALLOC_N(buf, char, bufsize); \
108
- bufptr = buf + (bufptr-oldbuf); \
109
- }
110
-
111
- concat(const char*what, size_t len){
112
- // printf("[.] concat: w=\"%s\", l=%d\n",what,len);
113
- CHECK_BUF_SIZE(len);
114
- memcpy(bufptr, what, len);
115
- bufptr += len;
116
- // printf("[.] concat OK\n");
117
- }
118
-
119
- // it's better to use concat(), especially if "what"'s length is always predefined
120
- concat2(const char*what){
121
- size_t len = strlen(what);
122
- concat(what,len);
123
- }
124
-
125
- // better error reporting
126
- #define YYERROR_VERBOSE
127
-
128
- // more stacks
129
- #define YYMAXDEPTH 0x180000
130
-
131
- // bison requires that you supply this function
132
- void yyerror(const char *msg)
133
- {
134
- printf("ERROR(PARSER): %s\n", msg);
135
- }
136
-
137
-
138
-
139
-
140
- /* Line 189 of yacc.c */
141
- #line 142 "parser.tab.c"
142
-
143
- /* Enabling traces. */
144
- #ifndef YYDEBUG
145
- # define YYDEBUG 0
146
- #endif
147
-
148
- /* Enabling verbose error messages. */
149
- #ifdef YYERROR_VERBOSE
150
- # undef YYERROR_VERBOSE
151
- # define YYERROR_VERBOSE 1
152
- #else
153
- # define YYERROR_VERBOSE 0
154
- #endif
155
-
156
- /* Enabling the token table. */
157
- #ifndef YYTOKEN_TABLE
158
- # define YYTOKEN_TABLE 0
159
- #endif
160
-
161
-
162
- /* Tokens. */
163
- #ifndef YYTOKENTYPE
164
- # define YYTOKENTYPE
165
- /* Put the tokens into the symbol table, so that GDB and other debuggers
166
- know about them. */
167
- enum yytokentype {
168
- T_CHAR = 258,
169
- BOLD_START = 259,
170
- ITALIC_START = 260,
171
- BOLD_ITALIC_START = 261,
172
- ITALIC_BOLD_START = 262,
173
- ULI = 263,
174
- OLI = 264,
175
- T_WORD = 265,
176
- TICKET_LINK = 266,
177
- LINK = 267,
178
- SVN_REVISION_LINK = 268,
179
- GIT_REVISION_LINK = 269,
180
- WIKI_LINK = 270,
181
- ANCHOR_LINK = 271,
182
- SVN_N_REVISION_LINK = 272,
183
- GIT_N_REVISION_LINK = 273,
184
- URL_WITH_PROTO_LINK = 274,
185
- URL_WITHOUT_PROTO_LINK = 275,
186
- FILE_LINK = 276,
187
- IMAGE_LINK = 277,
188
- URL = 278,
189
- EMAIL = 279,
190
- UL = 280,
191
- H1 = 281,
192
- H2 = 282,
193
- H3 = 283,
194
- H4 = 284,
195
- H5 = 285,
196
- INLINE_CODE = 286,
197
- SPACE = 287,
198
- BR = 288,
199
- PRE_CODE_START = 289,
200
- PRE_CODE_END = 290,
201
- PRE_START = 291,
202
- PRE_END = 292,
203
- CODE_START = 293,
204
- CODE_END = 294,
205
- NOTEXTILE_START = 295,
206
- NOTEXTILE_END = 296,
207
- BOLD_END = 297,
208
- ITALIC_END = 298,
209
- REVERT_BOLD = 299,
210
- REVERT_ITALIC = 300
211
- };
212
- #endif
213
-
214
-
215
-
216
- #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
217
- typedef union YYSTYPE
218
- {
219
-
220
- /* Line 214 of yacc.c */
221
- #line 70 "parser.y"
222
-
223
- double dvalue;
224
- int ivalue;
225
- char const* svalue;
226
-
227
-
228
-
229
- /* Line 214 of yacc.c */
230
- #line 231 "parser.tab.c"
231
- } YYSTYPE;
232
- # define YYSTYPE_IS_TRIVIAL 1
233
- # define yystype YYSTYPE /* obsolescent; will be withdrawn */
234
- # define YYSTYPE_IS_DECLARED 1
235
- #endif
236
-
237
-
238
- /* Copy the second part of user declarations. */
239
-
240
-
241
- /* Line 264 of yacc.c */
242
- #line 243 "parser.tab.c"
243
-
244
- #ifdef short
245
- # undef short
246
- #endif
247
-
248
- #ifdef YYTYPE_UINT8
249
- typedef YYTYPE_UINT8 yytype_uint8;
250
- #else
251
- typedef unsigned char yytype_uint8;
252
- #endif
253
-
254
- #ifdef YYTYPE_INT8
255
- typedef YYTYPE_INT8 yytype_int8;
256
- #elif (defined __STDC__ || defined __C99__FUNC__ \
257
- || defined __cplusplus || defined _MSC_VER)
258
- typedef signed char yytype_int8;
259
- #else
260
- typedef short int yytype_int8;
261
- #endif
262
-
263
- #ifdef YYTYPE_UINT16
264
- typedef YYTYPE_UINT16 yytype_uint16;
265
- #else
266
- typedef unsigned short int yytype_uint16;
267
- #endif
268
-
269
- #ifdef YYTYPE_INT16
270
- typedef YYTYPE_INT16 yytype_int16;
271
- #else
272
- typedef short int yytype_int16;
273
- #endif
274
-
275
- #ifndef YYSIZE_T
276
- # ifdef __SIZE_TYPE__
277
- # define YYSIZE_T __SIZE_TYPE__
278
- # elif defined size_t
279
- # define YYSIZE_T size_t
280
- # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
281
- || defined __cplusplus || defined _MSC_VER)
282
- # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
283
- # define YYSIZE_T size_t
284
- # else
285
- # define YYSIZE_T unsigned int
286
- # endif
287
- #endif
288
-
289
- #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
290
-
291
- #ifndef YY_
292
- # if YYENABLE_NLS
293
- # if ENABLE_NLS
294
- # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
295
- # define YY_(msgid) dgettext ("bison-runtime", msgid)
296
- # endif
297
- # endif
298
- # ifndef YY_
299
- # define YY_(msgid) msgid
300
- # endif
301
- #endif
302
-
303
- /* Suppress unused-variable warnings by "using" E. */
304
- #if ! defined lint || defined __GNUC__
305
- # define YYUSE(e) ((void) (e))
306
- #else
307
- # define YYUSE(e) /* empty */
308
- #endif
309
-
310
- /* Identity function, used to suppress warnings about constant conditions. */
311
- #ifndef lint
312
- # define YYID(n) (n)
313
- #else
314
- #if (defined __STDC__ || defined __C99__FUNC__ \
315
- || defined __cplusplus || defined _MSC_VER)
316
- static int
317
- YYID (int yyi)
318
- #else
319
- static int
320
- YYID (yyi)
321
- int yyi;
322
- #endif
323
- {
324
- return yyi;
325
- }
326
- #endif
327
-
328
- #if ! defined yyoverflow || YYERROR_VERBOSE
329
-
330
- /* The parser invokes alloca or malloc; define the necessary symbols. */
331
-
332
- # ifdef YYSTACK_USE_ALLOCA
333
- # if YYSTACK_USE_ALLOCA
334
- # ifdef __GNUC__
335
- # define YYSTACK_ALLOC __builtin_alloca
336
- # elif defined __BUILTIN_VA_ARG_INCR
337
- # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
338
- # elif defined _AIX
339
- # define YYSTACK_ALLOC __alloca
340
- # elif defined _MSC_VER
341
- # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
342
- # define alloca _alloca
343
- # else
344
- # define YYSTACK_ALLOC alloca
345
- # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
346
- || defined __cplusplus || defined _MSC_VER)
347
- # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
348
- # ifndef _STDLIB_H
349
- # define _STDLIB_H 1
350
- # endif
351
- # endif
352
- # endif
353
- # endif
354
- # endif
355
-
356
- # ifdef YYSTACK_ALLOC
357
- /* Pacify GCC's `empty if-body' warning. */
358
- # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
359
- # ifndef YYSTACK_ALLOC_MAXIMUM
360
- /* The OS might guarantee only one guard page at the bottom of the stack,
361
- and a page size can be as small as 4096 bytes. So we cannot safely
362
- invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
363
- to allow for a few compiler-allocated temporary stack slots. */
364
- # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
365
- # endif
366
- # else
367
- # define YYSTACK_ALLOC YYMALLOC
368
- # define YYSTACK_FREE YYFREE
369
- # ifndef YYSTACK_ALLOC_MAXIMUM
370
- # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
371
- # endif
372
- # if (defined __cplusplus && ! defined _STDLIB_H \
373
- && ! ((defined YYMALLOC || defined malloc) \
374
- && (defined YYFREE || defined free)))
375
- # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
376
- # ifndef _STDLIB_H
377
- # define _STDLIB_H 1
378
- # endif
379
- # endif
380
- # ifndef YYMALLOC
381
- # define YYMALLOC malloc
382
- # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
383
- || defined __cplusplus || defined _MSC_VER)
384
- void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
385
- # endif
386
- # endif
387
- # ifndef YYFREE
388
- # define YYFREE free
389
- # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
390
- || defined __cplusplus || defined _MSC_VER)
391
- void free (void *); /* INFRINGES ON USER NAME SPACE */
392
- # endif
393
- # endif
394
- # endif
395
- #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
396
-
397
-
398
- #if (! defined yyoverflow \
399
- && (! defined __cplusplus \
400
- || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
401
-
402
- /* A type that is properly aligned for any stack member. */
403
- union yyalloc
404
- {
405
- yytype_int16 yyss_alloc;
406
- YYSTYPE yyvs_alloc;
407
- };
408
-
409
- /* The size of the maximum gap between one aligned stack and the next. */
410
- # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
411
-
412
- /* The size of an array large to enough to hold all stacks, each with
413
- N elements. */
414
- # define YYSTACK_BYTES(N) \
415
- ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
416
- + YYSTACK_GAP_MAXIMUM)
417
-
418
- /* Copy COUNT objects from FROM to TO. The source and destination do
419
- not overlap. */
420
- # ifndef YYCOPY
421
- # if defined __GNUC__ && 1 < __GNUC__
422
- # define YYCOPY(To, From, Count) \
423
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
424
- # else
425
- # define YYCOPY(To, From, Count) \
426
- do \
427
- { \
428
- YYSIZE_T yyi; \
429
- for (yyi = 0; yyi < (Count); yyi++) \
430
- (To)[yyi] = (From)[yyi]; \
431
- } \
432
- while (YYID (0))
433
- # endif
434
- # endif
435
-
436
- /* Relocate STACK from its old location to the new one. The
437
- local variables YYSIZE and YYSTACKSIZE give the old and new number of
438
- elements in the stack, and YYPTR gives the new location of the
439
- stack. Advance YYPTR to a properly aligned location for the next
440
- stack. */
441
- # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
442
- do \
443
- { \
444
- YYSIZE_T yynewbytes; \
445
- YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
446
- Stack = &yyptr->Stack_alloc; \
447
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
448
- yyptr += yynewbytes / sizeof (*yyptr); \
449
- } \
450
- while (YYID (0))
451
-
452
- #endif
453
-
454
- /* YYFINAL -- State number of the termination state. */
455
- #define YYFINAL 55
456
- /* YYLAST -- Last index in YYTABLE. */
457
- #define YYLAST 131
458
-
459
- /* YYNTOKENS -- Number of terminals. */
460
- #define YYNTOKENS 46
461
- /* YYNNTS -- Number of nonterminals. */
462
- #define YYNNTS 28
463
- /* YYNRULES -- Number of rules. */
464
- #define YYNRULES 70
465
- /* YYNRULES -- Number of states. */
466
- #define YYNSTATES 84
467
-
468
- /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
469
- #define YYUNDEFTOK 2
470
- #define YYMAXUTOK 300
471
-
472
- #define YYTRANSLATE(YYX) \
473
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
474
-
475
- /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
476
- static const yytype_uint8 yytranslate[] =
477
- {
478
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
480
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
481
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
482
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
483
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
484
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
485
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
486
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
487
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
488
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
489
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
490
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
491
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
492
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
493
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
494
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
495
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
496
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
497
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
498
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
499
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
500
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
501
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
502
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
503
- 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
504
- 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
505
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
506
- 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
507
- 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
508
- 45
509
- };
510
-
511
- #if YYDEBUG
512
- /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
513
- YYRHS. */
514
- static const yytype_uint8 yyprhs[] =
515
- {
516
- 0, 0, 3, 4, 7, 9, 11, 13, 15, 17,
517
- 19, 21, 22, 23, 28, 29, 30, 35, 37, 39,
518
- 42, 45, 49, 51, 54, 57, 61, 63, 66, 68,
519
- 70, 72, 74, 76, 78, 80, 82, 84, 86, 88,
520
- 90, 92, 94, 96, 98, 100, 102, 104, 106, 108,
521
- 110, 112, 114, 116, 117, 120, 122, 124, 126, 128,
522
- 130, 132, 134, 136, 138, 139, 144, 148, 149, 154,
523
- 155
524
- };
525
-
526
- /* YYRHS -- A `-1'-separated list of the rules' RHS. */
527
- static const yytype_int8 yyrhs[] =
528
- {
529
- 47, 0, -1, -1, 48, 47, -1, 69, -1, 57,
530
- -1, 62, -1, 63, -1, 64, -1, 65, -1, 66,
531
- -1, -1, -1, 49, 53, 50, 48, -1, -1, -1,
532
- 51, 55, 52, 48, -1, 70, -1, 54, -1, 53,
533
- 54, -1, 68, 57, -1, 68, 57, 33, -1, 56,
534
- -1, 55, 56, -1, 67, 57, -1, 67, 57, 33,
535
- -1, 58, -1, 58, 57, -1, 60, -1, 59, -1,
536
- 10, -1, 23, -1, 24, -1, 4, -1, 42, -1,
537
- 5, -1, 43, -1, 6, -1, 7, -1, 31, -1,
538
- 44, -1, 45, -1, 11, -1, 13, -1, 14, -1,
539
- 17, -1, 18, -1, 19, -1, 20, -1, 15, -1,
540
- 16, -1, 21, -1, 22, -1, -1, 61, 60, -1,
541
- 3, -1, 26, -1, 27, -1, 28, -1, 29, -1,
542
- 30, -1, 9, -1, 8, -1, 33, -1, -1, 34,
543
- 71, 60, 35, -1, 40, 60, 41, -1, -1, 36,
544
- 72, 60, 37, -1, -1, 38, 73, 60, 39, -1
545
- };
546
-
547
- /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
548
- static const yytype_uint8 yyrline[] =
549
- {
550
- 0, 98, 98, 99, 102, 103, 104, 105, 106, 107,
551
- 108, 109, 112, 109, 116, 119, 116, 123, 125, 126,
552
- 128, 129, 131, 132, 134, 135, 137, 138, 140, 141,
553
- 142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
554
- 152, 153, 155, 156, 157, 158, 159, 160, 161, 162,
555
- 163, 164, 165, 167, 168, 170, 177, 178, 179, 180,
556
- 181, 183, 184, 185, 188, 188, 189, 190, 190, 191,
557
- 191
558
- };
559
- #endif
560
-
561
- #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
562
- /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
563
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
564
- static const char *const yytname[] =
565
- {
566
- "$end", "error", "$undefined", "T_CHAR", "BOLD_START", "ITALIC_START",
567
- "BOLD_ITALIC_START", "ITALIC_BOLD_START", "ULI", "OLI", "T_WORD",
568
- "TICKET_LINK", "LINK", "SVN_REVISION_LINK", "GIT_REVISION_LINK",
569
- "WIKI_LINK", "ANCHOR_LINK", "SVN_N_REVISION_LINK", "GIT_N_REVISION_LINK",
570
- "URL_WITH_PROTO_LINK", "URL_WITHOUT_PROTO_LINK", "FILE_LINK",
571
- "IMAGE_LINK", "URL", "EMAIL", "UL", "H1", "H2", "H3", "H4", "H5",
572
- "INLINE_CODE", "SPACE", "BR", "PRE_CODE_START", "PRE_CODE_END",
573
- "PRE_START", "PRE_END", "CODE_START", "CODE_END", "NOTEXTILE_START",
574
- "NOTEXTILE_END", "BOLD_END", "ITALIC_END", "REVERT_BOLD",
575
- "REVERT_ITALIC", "$accept", "text", "textitem", "$@1", "$@2", "$@3",
576
- "$@4", "ulist", "ulitem", "olist", "olitem", "words", "word", "link",
577
- "chars", "char", "h1", "h2", "h3", "h4", "h5", "oli", "uli", "br",
578
- "code", "$@5", "$@6", "$@7", 0
579
- };
580
- #endif
581
-
582
- # ifdef YYPRINT
583
- /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
584
- token YYLEX-NUM. */
585
- static const yytype_uint16 yytoknum[] =
586
- {
587
- 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
588
- 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
589
- 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
590
- 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
591
- 295, 296, 297, 298, 299, 300
592
- };
593
- # endif
594
-
595
- /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
596
- static const yytype_uint8 yyr1[] =
597
- {
598
- 0, 46, 47, 47, 48, 48, 48, 48, 48, 48,
599
- 48, 49, 50, 48, 51, 52, 48, 48, 53, 53,
600
- 54, 54, 55, 55, 56, 56, 57, 57, 58, 58,
601
- 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
602
- 58, 58, 59, 59, 59, 59, 59, 59, 59, 59,
603
- 59, 59, 59, 60, 60, 61, 62, 63, 64, 65,
604
- 66, 67, 68, 69, 71, 70, 70, 72, 70, 73,
605
- 70
606
- };
607
-
608
- /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
609
- static const yytype_uint8 yyr2[] =
610
- {
611
- 0, 2, 0, 2, 1, 1, 1, 1, 1, 1,
612
- 1, 0, 0, 4, 0, 0, 4, 1, 1, 2,
613
- 2, 3, 1, 2, 2, 3, 1, 2, 1, 1,
614
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
615
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
616
- 1, 1, 1, 0, 2, 1, 1, 1, 1, 1,
617
- 1, 1, 1, 1, 0, 4, 3, 0, 4, 0,
618
- 4
619
- };
620
-
621
- /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
622
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
623
- means the default is an error. */
624
- static const yytype_uint8 yydefact[] =
625
- {
626
- 2, 55, 33, 35, 37, 38, 30, 42, 43, 44,
627
- 49, 50, 45, 46, 47, 48, 51, 52, 31, 32,
628
- 56, 57, 58, 59, 60, 39, 63, 64, 67, 69,
629
- 53, 34, 36, 40, 41, 0, 2, 0, 0, 5,
630
- 26, 29, 28, 53, 6, 7, 8, 9, 10, 4,
631
- 17, 53, 53, 53, 0, 1, 3, 62, 12, 18,
632
- 53, 61, 15, 22, 53, 27, 54, 0, 0, 0,
633
- 66, 11, 19, 20, 11, 23, 24, 65, 68, 70,
634
- 13, 21, 16, 25
635
- };
636
-
637
- /* YYDEFGOTO[NTERM-NUM]. */
638
- static const yytype_int8 yydefgoto[] =
639
- {
640
- -1, 35, 36, 37, 71, 38, 74, 58, 59, 62,
641
- 63, 39, 40, 41, 42, 43, 44, 45, 46, 47,
642
- 48, 64, 60, 49, 50, 51, 52, 53
643
- };
644
-
645
- /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
646
- STATE-NUM. */
647
- #define YYPACT_NINF -40
648
- static const yytype_int8 yypact[] =
649
- {
650
- 43, -40, -40, -40, -40, -40, -40, -40, -40, -40,
651
- -40, -40, -40, -40, -40, -40, -40, -40, -40, -40,
652
- -40, -40, -40, -40, -40, -40, -40, -40, -40, -40,
653
- -2, -40, -40, -40, -40, 2, 43, 4, -1, -40,
654
- 86, -40, -40, -2, -40, -40, -40, -40, -40, -40,
655
- -40, -2, -2, -2, -16, -40, -40, -40, 4, -40,
656
- 86, -40, -1, -40, 86, -40, -40, 6, 18, 29,
657
- -40, 0, -40, 42, 0, -40, 45, -40, -40, -40,
658
- -40, -40, -40, -40
659
- };
660
-
661
- /* YYPGOTO[NTERM-NUM]. */
662
- static const yytype_int8 yypgoto[] =
663
- {
664
- -40, 1, -39, -40, -40, -40, -40, -40, -19, -40,
665
- 20, 54, -40, -40, 68, -40, -40, -40, -40, -40,
666
- -40, -40, -40, -40, -40, -40, -40, -40
667
- };
668
-
669
- /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
670
- positive, shift that token. If negative, reduce the rule which
671
- number is the opposite. If zero, do what YYDEFACT says.
672
- If YYTABLE_NINF, syntax error. */
673
- #define YYTABLE_NINF -54
674
- static const yytype_int8 yytable[] =
675
- {
676
- -53, 1, 55, 1, 2, 3, 4, 5, 61, -14,
677
- 6, 7, 57, 8, 9, 10, 11, 12, 13, 14,
678
- 15, 16, 17, 18, 19, 70, 20, 21, 22, 23,
679
- 24, 25, 80, 26, 27, 82, 28, 56, 29, 72,
680
- 30, 77, 31, 32, 33, 34, 1, 2, 3, 4,
681
- 5, -11, -14, 6, 7, 78, 8, 9, 10, 11,
682
- 12, 13, 14, 15, 16, 17, 18, 19, 79, 20,
683
- 21, 22, 23, 24, 25, 81, 26, 27, 83, 28,
684
- 0, 29, 75, 30, 0, 31, 32, 33, 34, 1,
685
- 2, 3, 4, 5, 65, 0, 6, 7, 54, 8,
686
- 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
687
- 19, 66, 0, 0, 73, 0, 0, 25, 76, 67,
688
- 68, 69, 0, 0, 0, 0, 0, 0, 31, 32,
689
- 33, 34
690
- };
691
-
692
- static const yytype_int8 yycheck[] =
693
- {
694
- 0, 3, 0, 3, 4, 5, 6, 7, 9, 9,
695
- 10, 11, 8, 13, 14, 15, 16, 17, 18, 19,
696
- 20, 21, 22, 23, 24, 41, 26, 27, 28, 29,
697
- 30, 31, 71, 33, 34, 74, 36, 36, 38, 58,
698
- 40, 35, 42, 43, 44, 45, 3, 4, 5, 6,
699
- 7, 8, 9, 10, 11, 37, 13, 14, 15, 16,
700
- 17, 18, 19, 20, 21, 22, 23, 24, 39, 26,
701
- 27, 28, 29, 30, 31, 33, 33, 34, 33, 36,
702
- -1, 38, 62, 40, -1, 42, 43, 44, 45, 3,
703
- 4, 5, 6, 7, 40, -1, 10, 11, 30, 13,
704
- 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
705
- 24, 43, -1, -1, 60, -1, -1, 31, 64, 51,
706
- 52, 53, -1, -1, -1, -1, -1, -1, 42, 43,
707
- 44, 45
708
- };
709
-
710
- /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
711
- symbol of state STATE-NUM. */
712
- static const yytype_uint8 yystos[] =
713
- {
714
- 0, 3, 4, 5, 6, 7, 10, 11, 13, 14,
715
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
716
- 26, 27, 28, 29, 30, 31, 33, 34, 36, 38,
717
- 40, 42, 43, 44, 45, 47, 48, 49, 51, 57,
718
- 58, 59, 60, 61, 62, 63, 64, 65, 66, 69,
719
- 70, 71, 72, 73, 60, 0, 47, 8, 53, 54,
720
- 68, 9, 55, 56, 67, 57, 60, 60, 60, 60,
721
- 41, 50, 54, 57, 52, 56, 57, 35, 37, 39,
722
- 48, 33, 48, 33
723
- };
724
-
725
- #define yyerrok (yyerrstatus = 0)
726
- #define yyclearin (yychar = YYEMPTY)
727
- #define YYEMPTY (-2)
728
- #define YYEOF 0
729
-
730
- #define YYACCEPT goto yyacceptlab
731
- #define YYABORT goto yyabortlab
732
- #define YYERROR goto yyerrorlab
733
-
734
-
735
- /* Like YYERROR except do call yyerror. This remains here temporarily
736
- to ease the transition to the new meaning of YYERROR, for GCC.
737
- Once GCC version 2 has supplanted version 1, this can go. */
738
-
739
- #define YYFAIL goto yyerrlab
740
-
741
- #define YYRECOVERING() (!!yyerrstatus)
742
-
743
- #define YYBACKUP(Token, Value) \
744
- do \
745
- if (yychar == YYEMPTY && yylen == 1) \
746
- { \
747
- yychar = (Token); \
748
- yylval = (Value); \
749
- yytoken = YYTRANSLATE (yychar); \
750
- YYPOPSTACK (1); \
751
- goto yybackup; \
752
- } \
753
- else \
754
- { \
755
- yyerror (YY_("syntax error: cannot back up")); \
756
- YYERROR; \
757
- } \
758
- while (YYID (0))
759
-
760
-
761
- #define YYTERROR 1
762
- #define YYERRCODE 256
763
-
764
-
765
- /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
766
- If N is 0, then set CURRENT to the empty location which ends
767
- the previous symbol: RHS[0] (always defined). */
768
-
769
- #define YYRHSLOC(Rhs, K) ((Rhs)[K])
770
- #ifndef YYLLOC_DEFAULT
771
- # define YYLLOC_DEFAULT(Current, Rhs, N) \
772
- do \
773
- if (YYID (N)) \
774
- { \
775
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
776
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
777
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
778
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
779
- } \
780
- else \
781
- { \
782
- (Current).first_line = (Current).last_line = \
783
- YYRHSLOC (Rhs, 0).last_line; \
784
- (Current).first_column = (Current).last_column = \
785
- YYRHSLOC (Rhs, 0).last_column; \
786
- } \
787
- while (YYID (0))
788
- #endif
789
-
790
-
791
- /* YY_LOCATION_PRINT -- Print the location on the stream.
792
- This macro was not mandated originally: define only if we know
793
- we won't break user code: when these are the locations we know. */
794
-
795
- #ifndef YY_LOCATION_PRINT
796
- # if YYLTYPE_IS_TRIVIAL
797
- # define YY_LOCATION_PRINT(File, Loc) \
798
- fprintf (File, "%d.%d-%d.%d", \
799
- (Loc).first_line, (Loc).first_column, \
800
- (Loc).last_line, (Loc).last_column)
801
- # else
802
- # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
803
- # endif
804
- #endif
805
-
806
-
807
- /* YYLEX -- calling `yylex' with the right arguments. */
808
-
809
- #ifdef YYLEX_PARAM
810
- # define YYLEX yylex (YYLEX_PARAM)
811
- #else
812
- # define YYLEX yylex ()
813
- #endif
814
-
815
- /* Enable debugging if requested. */
816
- #if YYDEBUG
817
-
818
- # ifndef YYFPRINTF
819
- # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
820
- # define YYFPRINTF fprintf
821
- # endif
822
-
823
- # define YYDPRINTF(Args) \
824
- do { \
825
- if (yydebug) \
826
- YYFPRINTF Args; \
827
- } while (YYID (0))
828
-
829
- # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
830
- do { \
831
- if (yydebug) \
832
- { \
833
- YYFPRINTF (stderr, "%s ", Title); \
834
- yy_symbol_print (stderr, \
835
- Type, Value); \
836
- YYFPRINTF (stderr, "\n"); \
837
- } \
838
- } while (YYID (0))
839
-
840
-
841
- /*--------------------------------.
842
- | Print this symbol on YYOUTPUT. |
843
- `--------------------------------*/
844
-
845
- /*ARGSUSED*/
846
- #if (defined __STDC__ || defined __C99__FUNC__ \
847
- || defined __cplusplus || defined _MSC_VER)
848
- static void
849
- yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
850
- #else
851
- static void
852
- yy_symbol_value_print (yyoutput, yytype, yyvaluep)
853
- FILE *yyoutput;
854
- int yytype;
855
- YYSTYPE const * const yyvaluep;
856
- #endif
857
- {
858
- if (!yyvaluep)
859
- return;
860
- # ifdef YYPRINT
861
- if (yytype < YYNTOKENS)
862
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
863
- # else
864
- YYUSE (yyoutput);
865
- # endif
866
- switch (yytype)
867
- {
868
- default:
869
- break;
870
- }
871
- }
872
-
873
-
874
- /*--------------------------------.
875
- | Print this symbol on YYOUTPUT. |
876
- `--------------------------------*/
877
-
878
- #if (defined __STDC__ || defined __C99__FUNC__ \
879
- || defined __cplusplus || defined _MSC_VER)
880
- static void
881
- yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
882
- #else
883
- static void
884
- yy_symbol_print (yyoutput, yytype, yyvaluep)
885
- FILE *yyoutput;
886
- int yytype;
887
- YYSTYPE const * const yyvaluep;
888
- #endif
889
- {
890
- if (yytype < YYNTOKENS)
891
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
892
- else
893
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
894
-
895
- yy_symbol_value_print (yyoutput, yytype, yyvaluep);
896
- YYFPRINTF (yyoutput, ")");
897
- }
898
-
899
- /*------------------------------------------------------------------.
900
- | yy_stack_print -- Print the state stack from its BOTTOM up to its |
901
- | TOP (included). |
902
- `------------------------------------------------------------------*/
903
-
904
- #if (defined __STDC__ || defined __C99__FUNC__ \
905
- || defined __cplusplus || defined _MSC_VER)
906
- static void
907
- yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
908
- #else
909
- static void
910
- yy_stack_print (yybottom, yytop)
911
- yytype_int16 *yybottom;
912
- yytype_int16 *yytop;
913
- #endif
914
- {
915
- YYFPRINTF (stderr, "Stack now");
916
- for (; yybottom <= yytop; yybottom++)
917
- {
918
- int yybot = *yybottom;
919
- YYFPRINTF (stderr, " %d", yybot);
920
- }
921
- YYFPRINTF (stderr, "\n");
922
- }
923
-
924
- # define YY_STACK_PRINT(Bottom, Top) \
925
- do { \
926
- if (yydebug) \
927
- yy_stack_print ((Bottom), (Top)); \
928
- } while (YYID (0))
929
-
930
-
931
- /*------------------------------------------------.
932
- | Report that the YYRULE is going to be reduced. |
933
- `------------------------------------------------*/
934
-
935
- #if (defined __STDC__ || defined __C99__FUNC__ \
936
- || defined __cplusplus || defined _MSC_VER)
937
- static void
938
- yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
939
- #else
940
- static void
941
- yy_reduce_print (yyvsp, yyrule)
942
- YYSTYPE *yyvsp;
943
- int yyrule;
944
- #endif
945
- {
946
- int yynrhs = yyr2[yyrule];
947
- int yyi;
948
- unsigned long int yylno = yyrline[yyrule];
949
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
950
- yyrule - 1, yylno);
951
- /* The symbols being reduced. */
952
- for (yyi = 0; yyi < yynrhs; yyi++)
953
- {
954
- YYFPRINTF (stderr, " $%d = ", yyi + 1);
955
- yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
956
- &(yyvsp[(yyi + 1) - (yynrhs)])
957
- );
958
- YYFPRINTF (stderr, "\n");
959
- }
960
- }
961
-
962
- # define YY_REDUCE_PRINT(Rule) \
963
- do { \
964
- if (yydebug) \
965
- yy_reduce_print (yyvsp, Rule); \
966
- } while (YYID (0))
967
-
968
- /* Nonzero means print parse trace. It is left uninitialized so that
969
- multiple parsers can coexist. */
970
- int yydebug;
971
- #else /* !YYDEBUG */
972
- # define YYDPRINTF(Args)
973
- # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
974
- # define YY_STACK_PRINT(Bottom, Top)
975
- # define YY_REDUCE_PRINT(Rule)
976
- #endif /* !YYDEBUG */
977
-
978
-
979
- /* YYINITDEPTH -- initial size of the parser's stacks. */
980
- #ifndef YYINITDEPTH
981
- # define YYINITDEPTH 200
982
- #endif
983
-
984
- /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
985
- if the built-in stack extension method is used).
986
-
987
- Do not make this value too large; the results are undefined if
988
- YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
989
- evaluated with infinite-precision integer arithmetic. */
990
-
991
- #ifndef YYMAXDEPTH
992
- # define YYMAXDEPTH 10000
993
- #endif
994
-
995
-
996
-
997
- #if YYERROR_VERBOSE
998
-
999
- # ifndef yystrlen
1000
- # if defined __GLIBC__ && defined _STRING_H
1001
- # define yystrlen strlen
1002
- # else
1003
- /* Return the length of YYSTR. */
1004
- #if (defined __STDC__ || defined __C99__FUNC__ \
1005
- || defined __cplusplus || defined _MSC_VER)
1006
- static YYSIZE_T
1007
- yystrlen (const char *yystr)
1008
- #else
1009
- static YYSIZE_T
1010
- yystrlen (yystr)
1011
- const char *yystr;
1012
- #endif
1013
- {
1014
- YYSIZE_T yylen;
1015
- for (yylen = 0; yystr[yylen]; yylen++)
1016
- continue;
1017
- return yylen;
1018
- }
1019
- # endif
1020
- # endif
1021
-
1022
- # ifndef yystpcpy
1023
- # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1024
- # define yystpcpy stpcpy
1025
- # else
1026
- /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1027
- YYDEST. */
1028
- #if (defined __STDC__ || defined __C99__FUNC__ \
1029
- || defined __cplusplus || defined _MSC_VER)
1030
- static char *
1031
- yystpcpy (char *yydest, const char *yysrc)
1032
- #else
1033
- static char *
1034
- yystpcpy (yydest, yysrc)
1035
- char *yydest;
1036
- const char *yysrc;
1037
- #endif
1038
- {
1039
- char *yyd = yydest;
1040
- const char *yys = yysrc;
1041
-
1042
- while ((*yyd++ = *yys++) != '\0')
1043
- continue;
1044
-
1045
- return yyd - 1;
1046
- }
1047
- # endif
1048
- # endif
1049
-
1050
- # ifndef yytnamerr
1051
- /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1052
- quotes and backslashes, so that it's suitable for yyerror. The
1053
- heuristic is that double-quoting is unnecessary unless the string
1054
- contains an apostrophe, a comma, or backslash (other than
1055
- backslash-backslash). YYSTR is taken from yytname. If YYRES is
1056
- null, do not copy; instead, return the length of what the result
1057
- would have been. */
1058
- static YYSIZE_T
1059
- yytnamerr (char *yyres, const char *yystr)
1060
- {
1061
- if (*yystr == '"')
1062
- {
1063
- YYSIZE_T yyn = 0;
1064
- char const *yyp = yystr;
1065
-
1066
- for (;;)
1067
- switch (*++yyp)
1068
- {
1069
- case '\'':
1070
- case ',':
1071
- goto do_not_strip_quotes;
1072
-
1073
- case '\\':
1074
- if (*++yyp != '\\')
1075
- goto do_not_strip_quotes;
1076
- /* Fall through. */
1077
- default:
1078
- if (yyres)
1079
- yyres[yyn] = *yyp;
1080
- yyn++;
1081
- break;
1082
-
1083
- case '"':
1084
- if (yyres)
1085
- yyres[yyn] = '\0';
1086
- return yyn;
1087
- }
1088
- do_not_strip_quotes: ;
1089
- }
1090
-
1091
- if (! yyres)
1092
- return yystrlen (yystr);
1093
-
1094
- return yystpcpy (yyres, yystr) - yyres;
1095
- }
1096
- # endif
1097
-
1098
- /* Copy into YYRESULT an error message about the unexpected token
1099
- YYCHAR while in state YYSTATE. Return the number of bytes copied,
1100
- including the terminating null byte. If YYRESULT is null, do not
1101
- copy anything; just return the number of bytes that would be
1102
- copied. As a special case, return 0 if an ordinary "syntax error"
1103
- message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1104
- size calculation. */
1105
- static YYSIZE_T
1106
- yysyntax_error (char *yyresult, int yystate, int yychar)
1107
- {
1108
- int yyn = yypact[yystate];
1109
-
1110
- if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1111
- return 0;
1112
- else
1113
- {
1114
- int yytype = YYTRANSLATE (yychar);
1115
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1116
- YYSIZE_T yysize = yysize0;
1117
- YYSIZE_T yysize1;
1118
- int yysize_overflow = 0;
1119
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1120
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1121
- int yyx;
1122
-
1123
- # if 0
1124
- /* This is so xgettext sees the translatable formats that are
1125
- constructed on the fly. */
1126
- YY_("syntax error, unexpected %s");
1127
- YY_("syntax error, unexpected %s, expecting %s");
1128
- YY_("syntax error, unexpected %s, expecting %s or %s");
1129
- YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1130
- YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1131
- # endif
1132
- char *yyfmt;
1133
- char const *yyf;
1134
- static char const yyunexpected[] = "syntax error, unexpected %s";
1135
- static char const yyexpecting[] = ", expecting %s";
1136
- static char const yyor[] = " or %s";
1137
- char yyformat[sizeof yyunexpected
1138
- + sizeof yyexpecting - 1
1139
- + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1140
- * (sizeof yyor - 1))];
1141
- char const *yyprefix = yyexpecting;
1142
-
1143
- /* Start YYX at -YYN if negative to avoid negative indexes in
1144
- YYCHECK. */
1145
- int yyxbegin = yyn < 0 ? -yyn : 0;
1146
-
1147
- /* Stay within bounds of both yycheck and yytname. */
1148
- int yychecklim = YYLAST - yyn + 1;
1149
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1150
- int yycount = 1;
1151
-
1152
- yyarg[0] = yytname[yytype];
1153
- yyfmt = yystpcpy (yyformat, yyunexpected);
1154
-
1155
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1156
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1157
- {
1158
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1159
- {
1160
- yycount = 1;
1161
- yysize = yysize0;
1162
- yyformat[sizeof yyunexpected - 1] = '\0';
1163
- break;
1164
- }
1165
- yyarg[yycount++] = yytname[yyx];
1166
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1167
- yysize_overflow |= (yysize1 < yysize);
1168
- yysize = yysize1;
1169
- yyfmt = yystpcpy (yyfmt, yyprefix);
1170
- yyprefix = yyor;
1171
- }
1172
-
1173
- yyf = YY_(yyformat);
1174
- yysize1 = yysize + yystrlen (yyf);
1175
- yysize_overflow |= (yysize1 < yysize);
1176
- yysize = yysize1;
1177
-
1178
- if (yysize_overflow)
1179
- return YYSIZE_MAXIMUM;
1180
-
1181
- if (yyresult)
1182
- {
1183
- /* Avoid sprintf, as that infringes on the user's name space.
1184
- Don't have undefined behavior even if the translation
1185
- produced a string with the wrong number of "%s"s. */
1186
- char *yyp = yyresult;
1187
- int yyi = 0;
1188
- while ((*yyp = *yyf) != '\0')
1189
- {
1190
- if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1191
- {
1192
- yyp += yytnamerr (yyp, yyarg[yyi++]);
1193
- yyf += 2;
1194
- }
1195
- else
1196
- {
1197
- yyp++;
1198
- yyf++;
1199
- }
1200
- }
1201
- }
1202
- return yysize;
1203
- }
1204
- }
1205
- #endif /* YYERROR_VERBOSE */
1206
-
1207
-
1208
- /*-----------------------------------------------.
1209
- | Release the memory associated to this symbol. |
1210
- `-----------------------------------------------*/
1211
-
1212
- /*ARGSUSED*/
1213
- #if (defined __STDC__ || defined __C99__FUNC__ \
1214
- || defined __cplusplus || defined _MSC_VER)
1215
- static void
1216
- yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1217
- #else
1218
- static void
1219
- yydestruct (yymsg, yytype, yyvaluep)
1220
- const char *yymsg;
1221
- int yytype;
1222
- YYSTYPE *yyvaluep;
1223
- #endif
1224
- {
1225
- YYUSE (yyvaluep);
1226
-
1227
- if (!yymsg)
1228
- yymsg = "Deleting";
1229
- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1230
-
1231
- switch (yytype)
1232
- {
1233
-
1234
- default:
1235
- break;
1236
- }
1237
- }
1238
-
1239
- /* Prevent warnings from -Wmissing-prototypes. */
1240
- #ifdef YYPARSE_PARAM
1241
- #if defined __STDC__ || defined __cplusplus
1242
- int yyparse (void *YYPARSE_PARAM);
1243
- #else
1244
- int yyparse ();
1245
- #endif
1246
- #else /* ! YYPARSE_PARAM */
1247
- #if defined __STDC__ || defined __cplusplus
1248
- int yyparse (void);
1249
- #else
1250
- int yyparse ();
1251
- #endif
1252
- #endif /* ! YYPARSE_PARAM */
1253
-
1254
-
1255
- /* The lookahead symbol. */
1256
- int yychar;
1257
-
1258
- /* The semantic value of the lookahead symbol. */
1259
- YYSTYPE yylval;
1260
-
1261
- /* Number of syntax errors so far. */
1262
- int yynerrs;
1263
-
1264
-
1265
-
1266
- /*-------------------------.
1267
- | yyparse or yypush_parse. |
1268
- `-------------------------*/
1269
-
1270
- #ifdef YYPARSE_PARAM
1271
- #if (defined __STDC__ || defined __C99__FUNC__ \
1272
- || defined __cplusplus || defined _MSC_VER)
1273
- int
1274
- yyparse (void *YYPARSE_PARAM)
1275
- #else
1276
- int
1277
- yyparse (YYPARSE_PARAM)
1278
- void *YYPARSE_PARAM;
1279
- #endif
1280
- #else /* ! YYPARSE_PARAM */
1281
- #if (defined __STDC__ || defined __C99__FUNC__ \
1282
- || defined __cplusplus || defined _MSC_VER)
1283
- int
1284
- yyparse (void)
1285
- #else
1286
- int
1287
- yyparse ()
1288
-
1289
- #endif
1290
- #endif
1291
- {
1292
-
1293
-
1294
- int yystate;
1295
- /* Number of tokens to shift before error messages enabled. */
1296
- int yyerrstatus;
1297
-
1298
- /* The stacks and their tools:
1299
- `yyss': related to states.
1300
- `yyvs': related to semantic values.
1301
-
1302
- Refer to the stacks thru separate pointers, to allow yyoverflow
1303
- to reallocate them elsewhere. */
1304
-
1305
- /* The state stack. */
1306
- yytype_int16 yyssa[YYINITDEPTH];
1307
- yytype_int16 *yyss;
1308
- yytype_int16 *yyssp;
1309
-
1310
- /* The semantic value stack. */
1311
- YYSTYPE yyvsa[YYINITDEPTH];
1312
- YYSTYPE *yyvs;
1313
- YYSTYPE *yyvsp;
1314
-
1315
- YYSIZE_T yystacksize;
1316
-
1317
- int yyn;
1318
- int yyresult;
1319
- /* Lookahead token as an internal (translated) token number. */
1320
- int yytoken;
1321
- /* The variables used to return semantic value and location from the
1322
- action routines. */
1323
- YYSTYPE yyval;
1324
-
1325
- #if YYERROR_VERBOSE
1326
- /* Buffer for error messages, and its allocated size. */
1327
- char yymsgbuf[128];
1328
- char *yymsg = yymsgbuf;
1329
- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1330
- #endif
1331
-
1332
- #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1333
-
1334
- /* The number of symbols on the RHS of the reduced rule.
1335
- Keep to zero when no symbol should be popped. */
1336
- int yylen = 0;
1337
-
1338
- yytoken = 0;
1339
- yyss = yyssa;
1340
- yyvs = yyvsa;
1341
- yystacksize = YYINITDEPTH;
1342
-
1343
- YYDPRINTF ((stderr, "Starting parse\n"));
1344
-
1345
- yystate = 0;
1346
- yyerrstatus = 0;
1347
- yynerrs = 0;
1348
- yychar = YYEMPTY; /* Cause a token to be read. */
1349
-
1350
- /* Initialize stack pointers.
1351
- Waste one element of value and location stack
1352
- so that they stay on the same level as the state stack.
1353
- The wasted elements are never initialized. */
1354
- yyssp = yyss;
1355
- yyvsp = yyvs;
1356
-
1357
- goto yysetstate;
1358
-
1359
- /*------------------------------------------------------------.
1360
- | yynewstate -- Push a new state, which is found in yystate. |
1361
- `------------------------------------------------------------*/
1362
- yynewstate:
1363
- /* In all cases, when you get here, the value and location stacks
1364
- have just been pushed. So pushing a state here evens the stacks. */
1365
- yyssp++;
1366
-
1367
- yysetstate:
1368
- *yyssp = yystate;
1369
-
1370
- if (yyss + yystacksize - 1 <= yyssp)
1371
- {
1372
- /* Get the current used size of the three stacks, in elements. */
1373
- YYSIZE_T yysize = yyssp - yyss + 1;
1374
-
1375
- #ifdef yyoverflow
1376
- {
1377
- /* Give user a chance to reallocate the stack. Use copies of
1378
- these so that the &'s don't force the real ones into
1379
- memory. */
1380
- YYSTYPE *yyvs1 = yyvs;
1381
- yytype_int16 *yyss1 = yyss;
1382
-
1383
- /* Each stack pointer address is followed by the size of the
1384
- data in use in that stack, in bytes. This used to be a
1385
- conditional around just the two extra args, but that might
1386
- be undefined if yyoverflow is a macro. */
1387
- yyoverflow (YY_("memory exhausted"),
1388
- &yyss1, yysize * sizeof (*yyssp),
1389
- &yyvs1, yysize * sizeof (*yyvsp),
1390
- &yystacksize);
1391
-
1392
- yyss = yyss1;
1393
- yyvs = yyvs1;
1394
- }
1395
- #else /* no yyoverflow */
1396
- # ifndef YYSTACK_RELOCATE
1397
- goto yyexhaustedlab;
1398
- # else
1399
- /* Extend the stack our own way. */
1400
- if (YYMAXDEPTH <= yystacksize)
1401
- goto yyexhaustedlab;
1402
- yystacksize *= 2;
1403
- if (YYMAXDEPTH < yystacksize)
1404
- yystacksize = YYMAXDEPTH;
1405
-
1406
- {
1407
- yytype_int16 *yyss1 = yyss;
1408
- union yyalloc *yyptr =
1409
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1410
- if (! yyptr)
1411
- goto yyexhaustedlab;
1412
- YYSTACK_RELOCATE (yyss_alloc, yyss);
1413
- YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1414
- # undef YYSTACK_RELOCATE
1415
- if (yyss1 != yyssa)
1416
- YYSTACK_FREE (yyss1);
1417
- }
1418
- # endif
1419
- #endif /* no yyoverflow */
1420
-
1421
- yyssp = yyss + yysize - 1;
1422
- yyvsp = yyvs + yysize - 1;
1423
-
1424
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1425
- (unsigned long int) yystacksize));
1426
-
1427
- if (yyss + yystacksize - 1 <= yyssp)
1428
- YYABORT;
1429
- }
1430
-
1431
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1432
-
1433
- if (yystate == YYFINAL)
1434
- YYACCEPT;
1435
-
1436
- goto yybackup;
1437
-
1438
- /*-----------.
1439
- | yybackup. |
1440
- `-----------*/
1441
- yybackup:
1442
-
1443
- /* Do appropriate processing given the current state. Read a
1444
- lookahead token if we need one and don't already have one. */
1445
-
1446
- /* First try to decide what to do without reference to lookahead token. */
1447
- yyn = yypact[yystate];
1448
- if (yyn == YYPACT_NINF)
1449
- goto yydefault;
1450
-
1451
- /* Not known => get a lookahead token if don't already have one. */
1452
-
1453
- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1454
- if (yychar == YYEMPTY)
1455
- {
1456
- YYDPRINTF ((stderr, "Reading a token: "));
1457
- yychar = YYLEX;
1458
- }
1459
-
1460
- if (yychar <= YYEOF)
1461
- {
1462
- yychar = yytoken = YYEOF;
1463
- YYDPRINTF ((stderr, "Now at end of input.\n"));
1464
- }
1465
- else
1466
- {
1467
- yytoken = YYTRANSLATE (yychar);
1468
- YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1469
- }
1470
-
1471
- /* If the proper action on seeing token YYTOKEN is to reduce or to
1472
- detect an error, take that action. */
1473
- yyn += yytoken;
1474
- if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1475
- goto yydefault;
1476
- yyn = yytable[yyn];
1477
- if (yyn <= 0)
1478
- {
1479
- if (yyn == 0 || yyn == YYTABLE_NINF)
1480
- goto yyerrlab;
1481
- yyn = -yyn;
1482
- goto yyreduce;
1483
- }
1484
-
1485
- /* Count tokens shifted since error; after three, turn off error
1486
- status. */
1487
- if (yyerrstatus)
1488
- yyerrstatus--;
1489
-
1490
- /* Shift the lookahead token. */
1491
- YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1492
-
1493
- /* Discard the shifted token. */
1494
- yychar = YYEMPTY;
1495
-
1496
- yystate = yyn;
1497
- *++yyvsp = yylval;
1498
-
1499
- goto yynewstate;
1500
-
1501
-
1502
- /*-----------------------------------------------------------.
1503
- | yydefault -- do the default action for the current state. |
1504
- `-----------------------------------------------------------*/
1505
- yydefault:
1506
- yyn = yydefact[yystate];
1507
- if (yyn == 0)
1508
- goto yyerrlab;
1509
- goto yyreduce;
1510
-
1511
-
1512
- /*-----------------------------.
1513
- | yyreduce -- Do a reduction. |
1514
- `-----------------------------*/
1515
- yyreduce:
1516
- /* yyn is the number of a rule to reduce with. */
1517
- yylen = yyr2[yyn];
1518
-
1519
- /* If YYLEN is nonzero, implement the default value of the action:
1520
- `$$ = $1'.
1521
-
1522
- Otherwise, the following line sets YYVAL to garbage.
1523
- This behavior is undocumented and Bison
1524
- users should not rely upon it. Assigning to YYVAL
1525
- unconditionally makes the parser a bit smaller, and it avoids a
1526
- GCC warning that YYVAL may be used uninitialized. */
1527
- yyval = yyvsp[1-yylen];
1528
-
1529
-
1530
- YY_REDUCE_PRINT (yyn);
1531
- switch (yyn)
1532
- {
1533
- case 6:
1534
-
1535
- /* Line 1455 of yacc.c */
1536
- #line 104 "parser.y"
1537
- {concat("</h1>",5);}
1538
- break;
1539
-
1540
- case 7:
1541
-
1542
- /* Line 1455 of yacc.c */
1543
- #line 105 "parser.y"
1544
- {concat("</h2>",5);}
1545
- break;
1546
-
1547
- case 8:
1548
-
1549
- /* Line 1455 of yacc.c */
1550
- #line 106 "parser.y"
1551
- {concat("</h3>",5);}
1552
- break;
1553
-
1554
- case 9:
1555
-
1556
- /* Line 1455 of yacc.c */
1557
- #line 107 "parser.y"
1558
- {concat("</h4>",5);}
1559
- break;
1560
-
1561
- case 10:
1562
-
1563
- /* Line 1455 of yacc.c */
1564
- #line 108 "parser.y"
1565
- {concat("</h5>",5);}
1566
- break;
1567
-
1568
- case 11:
1569
-
1570
- /* Line 1455 of yacc.c */
1571
- #line 109 "parser.y"
1572
- {
1573
- list_level=1;
1574
- concat("<ul>",4)
1575
- ;}
1576
- break;
1577
-
1578
- case 12:
1579
-
1580
- /* Line 1455 of yacc.c */
1581
- #line 112 "parser.y"
1582
- {
1583
- concat("</ul>",5);
1584
- for(; list_level>1 && list_level<4; list_level--) concat("</li></ul>",10);
1585
- ;}
1586
- break;
1587
-
1588
- case 14:
1589
-
1590
- /* Line 1455 of yacc.c */
1591
- #line 116 "parser.y"
1592
- {
1593
- list_level=1;
1594
- concat("<ol>",4)
1595
- ;}
1596
- break;
1597
-
1598
- case 15:
1599
-
1600
- /* Line 1455 of yacc.c */
1601
- #line 119 "parser.y"
1602
- {
1603
- concat("</ol>",5);
1604
- for(; list_level>1 && list_level<4; list_level--) concat("</li></ol>",10);
1605
- ;}
1606
- break;
1607
-
1608
- case 18:
1609
-
1610
- /* Line 1455 of yacc.c */
1611
- #line 125 "parser.y"
1612
- {concat("</li>",5);}
1613
- break;
1614
-
1615
- case 19:
1616
-
1617
- /* Line 1455 of yacc.c */
1618
- #line 126 "parser.y"
1619
- {concat("</li>",5);}
1620
- break;
1621
-
1622
- case 22:
1623
-
1624
- /* Line 1455 of yacc.c */
1625
- #line 131 "parser.y"
1626
- {concat("</li>",5);}
1627
- break;
1628
-
1629
- case 23:
1630
-
1631
- /* Line 1455 of yacc.c */
1632
- #line 132 "parser.y"
1633
- {concat("</li>",5);}
1634
- break;
1635
-
1636
- case 30:
1637
-
1638
- /* Line 1455 of yacc.c */
1639
- #line 142 "parser.y"
1640
- {concat2((yyvsp[(1) - (1)].svalue));}
1641
- break;
1642
-
1643
- case 31:
1644
-
1645
- /* Line 1455 of yacc.c */
1646
- #line 143 "parser.y"
1647
- {process_url((yyvsp[(1) - (1)].svalue));}
1648
- break;
1649
-
1650
- case 32:
1651
-
1652
- /* Line 1455 of yacc.c */
1653
- #line 144 "parser.y"
1654
- {process_email((yyvsp[(1) - (1)].svalue));}
1655
- break;
1656
-
1657
- case 33:
1658
-
1659
- /* Line 1455 of yacc.c */
1660
- #line 145 "parser.y"
1661
- {(yyvsp[(1) - (1)].ivalue) ? concat(" <strong>",9) : concat("<strong>",8);}
1662
- break;
1663
-
1664
- case 34:
1665
-
1666
- /* Line 1455 of yacc.c */
1667
- #line 146 "parser.y"
1668
- {concat("</strong>",9);}
1669
- break;
1670
-
1671
- case 35:
1672
-
1673
- /* Line 1455 of yacc.c */
1674
- #line 147 "parser.y"
1675
- {(yyvsp[(1) - (1)].ivalue) ? concat(" <em>",5) : concat("<em>",4);}
1676
- break;
1677
-
1678
- case 36:
1679
-
1680
- /* Line 1455 of yacc.c */
1681
- #line 148 "parser.y"
1682
- {concat("</em>",5);}
1683
- break;
1684
-
1685
- case 37:
1686
-
1687
- /* Line 1455 of yacc.c */
1688
- #line 149 "parser.y"
1689
- {(yyvsp[(1) - (1)].ivalue) ? concat(" <strong><em>",13) : concat("<strong><em>",12);}
1690
- break;
1691
-
1692
- case 38:
1693
-
1694
- /* Line 1455 of yacc.c */
1695
- #line 150 "parser.y"
1696
- {(yyvsp[(1) - (1)].ivalue) ? concat(" <em><strong>",13) : concat("<em><strong>",12);}
1697
- break;
1698
-
1699
- case 39:
1700
-
1701
- /* Line 1455 of yacc.c */
1702
- #line 151 "parser.y"
1703
- {process_inline_code((yyvsp[(1) - (1)].svalue));}
1704
- break;
1705
-
1706
- case 40:
1707
-
1708
- /* Line 1455 of yacc.c */
1709
- #line 152 "parser.y"
1710
- {revert_bold();}
1711
- break;
1712
-
1713
- case 41:
1714
-
1715
- /* Line 1455 of yacc.c */
1716
- #line 153 "parser.y"
1717
- {revert_italic();}
1718
- break;
1719
-
1720
- case 42:
1721
-
1722
- /* Line 1455 of yacc.c */
1723
- #line 155 "parser.y"
1724
- {process_ticket_link((yyvsp[(1) - (1)].svalue));}
1725
- break;
1726
-
1727
- case 43:
1728
-
1729
- /* Line 1455 of yacc.c */
1730
- #line 156 "parser.y"
1731
- {process_svn_link((yyvsp[(1) - (1)].svalue),0);}
1732
- break;
1733
-
1734
- case 44:
1735
-
1736
- /* Line 1455 of yacc.c */
1737
- #line 157 "parser.y"
1738
- {process_git_link((yyvsp[(1) - (1)].svalue),0);}
1739
- break;
1740
-
1741
- case 45:
1742
-
1743
- /* Line 1455 of yacc.c */
1744
- #line 158 "parser.y"
1745
- {process_svn_link((yyvsp[(1) - (1)].svalue),1);}
1746
- break;
1747
-
1748
- case 46:
1749
-
1750
- /* Line 1455 of yacc.c */
1751
- #line 159 "parser.y"
1752
- {process_git_link((yyvsp[(1) - (1)].svalue),1);}
1753
- break;
1754
-
1755
- case 47:
1756
-
1757
- /* Line 1455 of yacc.c */
1758
- #line 160 "parser.y"
1759
- {process_url_link((yyvsp[(1) - (1)].svalue),NULL);}
1760
- break;
1761
-
1762
- case 48:
1763
-
1764
- /* Line 1455 of yacc.c */
1765
- #line 161 "parser.y"
1766
- {process_url_link((yyvsp[(1) - (1)].svalue),"http://");}
1767
- break;
1768
-
1769
- case 49:
1770
-
1771
- /* Line 1455 of yacc.c */
1772
- #line 162 "parser.y"
1773
- {process_wiki_link((yyvsp[(1) - (1)].svalue));}
1774
- break;
1775
-
1776
- case 50:
1777
-
1778
- /* Line 1455 of yacc.c */
1779
- #line 163 "parser.y"
1780
- {process_anchor_link((yyvsp[(1) - (1)].svalue));}
1781
- break;
1782
-
1783
- case 51:
1784
-
1785
- /* Line 1455 of yacc.c */
1786
- #line 164 "parser.y"
1787
- {process_file_link((yyvsp[(1) - (1)].svalue));}
1788
- break;
1789
-
1790
- case 52:
1791
-
1792
- /* Line 1455 of yacc.c */
1793
- #line 165 "parser.y"
1794
- {process_image_link((yyvsp[(1) - (1)].svalue));}
1795
- break;
1796
-
1797
- case 55:
1798
-
1799
- /* Line 1455 of yacc.c */
1800
- #line 170 "parser.y"
1801
- {concat_escaped_char((yyvsp[(1) - (1)].ivalue));}
1802
- break;
1803
-
1804
- case 56:
1805
-
1806
- /* Line 1455 of yacc.c */
1807
- #line 177 "parser.y"
1808
- {concat("<h1 id=\"h-",10); process_header((yyvsp[(1) - (1)].svalue));}
1809
- break;
1810
-
1811
- case 57:
1812
-
1813
- /* Line 1455 of yacc.c */
1814
- #line 178 "parser.y"
1815
- {concat("<h2 id=\"h-",10); process_header((yyvsp[(1) - (1)].svalue));}
1816
- break;
1817
-
1818
- case 58:
1819
-
1820
- /* Line 1455 of yacc.c */
1821
- #line 179 "parser.y"
1822
- {concat("<h3 id=\"h-",10); process_header((yyvsp[(1) - (1)].svalue));}
1823
- break;
1824
-
1825
- case 59:
1826
-
1827
- /* Line 1455 of yacc.c */
1828
- #line 180 "parser.y"
1829
- {concat("<h4 id=\"h-",10); process_header((yyvsp[(1) - (1)].svalue));}
1830
- break;
1831
-
1832
- case 60:
1833
-
1834
- /* Line 1455 of yacc.c */
1835
- #line 181 "parser.y"
1836
- {concat("<h5 id=\"h-",10); process_header((yyvsp[(1) - (1)].svalue));}
1837
- break;
1838
-
1839
- case 61:
1840
-
1841
- /* Line 1455 of yacc.c */
1842
- #line 183 "parser.y"
1843
- {process_oli((yyvsp[(1) - (1)].ivalue));}
1844
- break;
1845
-
1846
- case 62:
1847
-
1848
- /* Line 1455 of yacc.c */
1849
- #line 184 "parser.y"
1850
- {process_uli((yyvsp[(1) - (1)].ivalue));}
1851
- break;
1852
-
1853
- case 63:
1854
-
1855
- /* Line 1455 of yacc.c */
1856
- #line 185 "parser.y"
1857
- {concat("<br />",6);}
1858
- break;
1859
-
1860
- case 64:
1861
-
1862
- /* Line 1455 of yacc.c */
1863
- #line 188 "parser.y"
1864
- {concat("<pre><code>",11);}
1865
- break;
1866
-
1867
- case 65:
1868
-
1869
- /* Line 1455 of yacc.c */
1870
- #line 188 "parser.y"
1871
- {concat("</code></pre>",13);}
1872
- break;
1873
-
1874
- case 67:
1875
-
1876
- /* Line 1455 of yacc.c */
1877
- #line 190 "parser.y"
1878
- {concat("<pre>",5);}
1879
- break;
1880
-
1881
- case 68:
1882
-
1883
- /* Line 1455 of yacc.c */
1884
- #line 190 "parser.y"
1885
- {concat("</pre>",6);}
1886
- break;
1887
-
1888
- case 69:
1889
-
1890
- /* Line 1455 of yacc.c */
1891
- #line 191 "parser.y"
1892
- {concat("<code>",6);}
1893
- break;
1894
-
1895
- case 70:
1896
-
1897
- /* Line 1455 of yacc.c */
1898
- #line 191 "parser.y"
1899
- {concat("</code>",7);}
1900
- break;
1901
-
1902
-
1903
-
1904
- /* Line 1455 of yacc.c */
1905
- #line 1906 "parser.tab.c"
1906
- default: break;
1907
- }
1908
- YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1909
-
1910
- YYPOPSTACK (yylen);
1911
- yylen = 0;
1912
- YY_STACK_PRINT (yyss, yyssp);
1913
-
1914
- *++yyvsp = yyval;
1915
-
1916
- /* Now `shift' the result of the reduction. Determine what state
1917
- that goes to, based on the state we popped back to and the rule
1918
- number reduced by. */
1919
-
1920
- yyn = yyr1[yyn];
1921
-
1922
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1923
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1924
- yystate = yytable[yystate];
1925
- else
1926
- yystate = yydefgoto[yyn - YYNTOKENS];
1927
-
1928
- goto yynewstate;
1929
-
1930
-
1931
- /*------------------------------------.
1932
- | yyerrlab -- here on detecting error |
1933
- `------------------------------------*/
1934
- yyerrlab:
1935
- /* If not already recovering from an error, report this error. */
1936
- if (!yyerrstatus)
1937
- {
1938
- ++yynerrs;
1939
- #if ! YYERROR_VERBOSE
1940
- yyerror (YY_("syntax error"));
1941
- #else
1942
- {
1943
- YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1944
- if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1945
- {
1946
- YYSIZE_T yyalloc = 2 * yysize;
1947
- if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1948
- yyalloc = YYSTACK_ALLOC_MAXIMUM;
1949
- if (yymsg != yymsgbuf)
1950
- YYSTACK_FREE (yymsg);
1951
- yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1952
- if (yymsg)
1953
- yymsg_alloc = yyalloc;
1954
- else
1955
- {
1956
- yymsg = yymsgbuf;
1957
- yymsg_alloc = sizeof yymsgbuf;
1958
- }
1959
- }
1960
-
1961
- if (0 < yysize && yysize <= yymsg_alloc)
1962
- {
1963
- (void) yysyntax_error (yymsg, yystate, yychar);
1964
- yyerror (yymsg);
1965
- }
1966
- else
1967
- {
1968
- yyerror (YY_("syntax error"));
1969
- if (yysize != 0)
1970
- goto yyexhaustedlab;
1971
- }
1972
- }
1973
- #endif
1974
- }
1975
-
1976
-
1977
-
1978
- if (yyerrstatus == 3)
1979
- {
1980
- /* If just tried and failed to reuse lookahead token after an
1981
- error, discard it. */
1982
-
1983
- if (yychar <= YYEOF)
1984
- {
1985
- /* Return failure if at end of input. */
1986
- if (yychar == YYEOF)
1987
- YYABORT;
1988
- }
1989
- else
1990
- {
1991
- yydestruct ("Error: discarding",
1992
- yytoken, &yylval);
1993
- yychar = YYEMPTY;
1994
- }
1995
- }
1996
-
1997
- /* Else will try to reuse lookahead token after shifting the error
1998
- token. */
1999
- goto yyerrlab1;
2000
-
2001
-
2002
- /*---------------------------------------------------.
2003
- | yyerrorlab -- error raised explicitly by YYERROR. |
2004
- `---------------------------------------------------*/
2005
- yyerrorlab:
2006
-
2007
- /* Pacify compilers like GCC when the user code never invokes
2008
- YYERROR and the label yyerrorlab therefore never appears in user
2009
- code. */
2010
- if (/*CONSTCOND*/ 0)
2011
- goto yyerrorlab;
2012
-
2013
- /* Do not reclaim the symbols of the rule which action triggered
2014
- this YYERROR. */
2015
- YYPOPSTACK (yylen);
2016
- yylen = 0;
2017
- YY_STACK_PRINT (yyss, yyssp);
2018
- yystate = *yyssp;
2019
- goto yyerrlab1;
2020
-
2021
-
2022
- /*-------------------------------------------------------------.
2023
- | yyerrlab1 -- common code for both syntax error and YYERROR. |
2024
- `-------------------------------------------------------------*/
2025
- yyerrlab1:
2026
- yyerrstatus = 3; /* Each real token shifted decrements this. */
2027
-
2028
- for (;;)
2029
- {
2030
- yyn = yypact[yystate];
2031
- if (yyn != YYPACT_NINF)
2032
- {
2033
- yyn += YYTERROR;
2034
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2035
- {
2036
- yyn = yytable[yyn];
2037
- if (0 < yyn)
2038
- break;
2039
- }
2040
- }
2041
-
2042
- /* Pop the current state because it cannot handle the error token. */
2043
- if (yyssp == yyss)
2044
- YYABORT;
2045
-
2046
-
2047
- yydestruct ("Error: popping",
2048
- yystos[yystate], yyvsp);
2049
- YYPOPSTACK (1);
2050
- yystate = *yyssp;
2051
- YY_STACK_PRINT (yyss, yyssp);
2052
- }
2053
-
2054
- *++yyvsp = yylval;
2055
-
2056
-
2057
- /* Shift the error token. */
2058
- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2059
-
2060
- yystate = yyn;
2061
- goto yynewstate;
2062
-
2063
-
2064
- /*-------------------------------------.
2065
- | yyacceptlab -- YYACCEPT comes here. |
2066
- `-------------------------------------*/
2067
- yyacceptlab:
2068
- yyresult = 0;
2069
- goto yyreturn;
2070
-
2071
- /*-----------------------------------.
2072
- | yyabortlab -- YYABORT comes here. |
2073
- `-----------------------------------*/
2074
- yyabortlab:
2075
- yyresult = 1;
2076
- goto yyreturn;
2077
-
2078
- #if !defined(yyoverflow) || YYERROR_VERBOSE
2079
- /*-------------------------------------------------.
2080
- | yyexhaustedlab -- memory exhaustion comes here. |
2081
- `-------------------------------------------------*/
2082
- yyexhaustedlab:
2083
- yyerror (YY_("memory exhausted"));
2084
- yyresult = 2;
2085
- /* Fall through. */
2086
- #endif
2087
-
2088
- yyreturn:
2089
- if (yychar != YYEMPTY)
2090
- yydestruct ("Cleanup: discarding lookahead",
2091
- yytoken, &yylval);
2092
- /* Do not reclaim the symbols of the rule which action triggered
2093
- this YYABORT or YYACCEPT. */
2094
- YYPOPSTACK (yylen);
2095
- YY_STACK_PRINT (yyss, yyssp);
2096
- while (yyssp != yyss)
2097
- {
2098
- yydestruct ("Cleanup: popping",
2099
- yystos[*yyssp], yyvsp);
2100
- YYPOPSTACK (1);
2101
- }
2102
- #ifndef yyoverflow
2103
- if (yyss != yyssa)
2104
- YYSTACK_FREE (yyss);
2105
- #endif
2106
- #if YYERROR_VERBOSE
2107
- if (yymsg != yymsgbuf)
2108
- YYSTACK_FREE (yymsg);
2109
- #endif
2110
- /* Make sure YYID is used. */
2111
- return YYID (yyresult);
2112
- }
2113
-
2114
-
2115
-
2116
- /* Line 1675 of yacc.c */
2117
- #line 195 "parser.y"
2118
-
2119
-
2120
- process_uli(int level){
2121
- if( level == list_level ){
2122
- concat("<li>",4);
2123
- } else if( level < list_level ){
2124
- list_level--;
2125
- //unconcat("</li>");
2126
- concat("</ul></li><li>",14);
2127
- } else {
2128
- // if(level > list_level)
2129
- list_level++;
2130
- unconcat("</li>");
2131
- concat("<ul><li>",8);
2132
- }
2133
- }
2134
-
2135
- process_oli(int level){
2136
- if( level == list_level ){
2137
- concat("<li>",4);
2138
- } else if( level < list_level ){
2139
- list_level = level;
2140
- //unconcat("</li>");
2141
- concat("</ol></li><li>",14);
2142
- } else {
2143
- // if(level > list_level)
2144
- list_level = level;
2145
- unconcat("</li>");
2146
- concat("<ol><li>",8);
2147
- }
2148
- }
2149
-
2150
- concat_hex_char(char c){
2151
- unsigned char d;
2152
- d = ((unsigned char)c)>>4;
2153
- concat_raw_char(d>9 ? ('a'+d-10) : '0'+d);
2154
- d = c&0x0f;
2155
- concat_raw_char(d>9 ? ('a'+d-10) : '0'+d);
2156
- }
2157
-
2158
- need_hex_convert(const char*p, const char*pend){
2159
- // scan for non alphanum chars first
2160
- for(; *p && p<=pend; p++){
2161
- if( *p == ' ' ||
2162
- *p == '_' ||
2163
- *p == '-' ||
2164
- *p == '.' ||
2165
- (*p >= '0' && *p <= '9') ||
2166
- (*p >= 'a' && *p <= 'z') ||
2167
- (*p >= 'A' && *p <= 'Z')
2168
- ){
2169
- // allowed char
2170
- } else {
2171
- // forbidden char found
2172
- return 1;
2173
- }
2174
- }
2175
- return 0;
2176
- }
2177
-
2178
- process_inline_code(const char*p){
2179
- if( *p == ' ' || *p == 9 ){
2180
- concat_raw_char(' ');
2181
- while( *p == ' ' || *p == 9 ) p++;
2182
- }
2183
- if( *p == '@' ) p++;
2184
- concat("<code>",6);
2185
- for(; *p ; p++){
2186
- if( *p == '@' && *(p+1) == 0 ) break;
2187
- concat_escaped_char( *p );
2188
- }
2189
- concat("</code>",7);
2190
- }
2191
-
2192
- process_header(const char*title){
2193
- const char*p,*pend;
2194
-
2195
- // skip heading spaces
2196
- while(*title == ' ' || *title == '\t') title++;
2197
-
2198
- // skip tailing spaces
2199
- p = title;
2200
- pend = p+strlen(p)-1;
2201
- while(pend > p && (*pend == ' ' || *pend == '\t')) pend--;
2202
-
2203
- // concat 'id'
2204
- if( need_hex_convert(title,pend) ){
2205
- for(p = title; *p && p<=pend; p++) concat_hex_char( *p );
2206
- } else {
2207
- for(p = title; *p && p<=pend; p++) concat_raw_char( *p == ' ' ? '_' : *p);
2208
- }
2209
- concat("\">",2);
2210
- for(p = title; *p && p<=pend; p++) concat_escaped_char( *p );
2211
- }
2212
-
2213
- process_link_tail(const char*text,const char*pend,const char*prepend){
2214
- const char*p;
2215
-
2216
- concat("\">",2);
2217
-
2218
- if(!pend){
2219
- pend = strchr(text,']');
2220
- pend = pend ? (pend-1) : (text + strlen(text) - 1);
2221
- }
2222
-
2223
- // find start of TITLE: [[url:http://www.ru|TITLE]]
2224
- if(p = strchr(text,'|')){
2225
- // title found
2226
- p++;
2227
- } else {
2228
- // no title
2229
- if(prepend) concat2(prepend);
2230
- p = text;
2231
- }
2232
-
2233
- for(; *p && p<=pend; p++) concat_escaped_char( *p );
2234
- concat("</a>",4);
2235
- }
2236
-
2237
- process_anchor_link(const char*target){
2238
- const char *p,*pend;
2239
-
2240
- // skip tail
2241
- p = target;
2242
- pend = p+strlen(p)-1;
2243
- while(pend > p && (*pend == ' ' || *pend == '\t' || *pend == ']')) pend--;
2244
-
2245
- if((p = strchr(target,'|')) && (p<pend) && (p>target)) pend = p-1;
2246
-
2247
- concat("<a href=\"#h-",12);
2248
- if( need_hex_convert(target,pend) ){
2249
- for(p = target; *p && p<=pend; p++) concat_hex_char( *p );
2250
- } else {
2251
- for(p = target; *p && p<=pend; p++) concat_raw_char( *p == ' ' ? '_' : *p);
2252
- }
2253
- concat("\" title=\"#",10);
2254
- for(p = target; *p && p<=pend; p++) concat_raw_char( *p );
2255
- concat("\" class=\"wiki_link",18);
2256
- process_link_tail(target,NULL,"#");
2257
- }
2258
-
2259
- process_url_link(const char*target,const char* proto){
2260
- const char *c;
2261
- concat("<a rel=\"nofollow\" href=\"",24);
2262
- if(proto){
2263
- concat2(proto);
2264
- } else if(target && *target == '/'){
2265
- // relative link
2266
- if( absolute_urls && site_url ){
2267
- concat2(site_url);
2268
- if(*(bufptr-1) == '/') bufptr--; // skip redundant '/'
2269
- }
2270
- }
2271
- for(c=target; *c && *c != ']' && *c != '|'; c++) concat_raw_char(*c);
2272
- process_link_tail(target,NULL,proto);
2273
- }
2274
-
2275
- concat_site_url(){
2276
- if( site_url && site_url_len > 0 ){
2277
- concat(site_url, site_url_len);
2278
- }
2279
- }
2280
-
2281
- process_svn_link(const char*target, int numbered_repo){
2282
- const char *c;
2283
- // can use sprintf here.. but I think it's a way slower than raw concat
2284
- concat("<a href=\"",9);
2285
- if( !concat_custom_vcs_url(target) ){
2286
- concat_site_url();
2287
- concat("/code/",6);
2288
- concat(space_name,space_name_len);
2289
- if( numbered_repo ){
2290
- concat("/subversion-",12);
2291
- while( *target >= '0' && *target <= '9' ) concat_raw_char(*target++);
2292
- while( *target == ':' ) target++;
2293
- concat("/changesets/",12);
2294
- } else {
2295
- concat("/subversion/changesets/",23);
2296
- }
2297
- for(c=target; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
2298
- }
2299
- process_link_tail(target,NULL,"revision:");
2300
- }
2301
-
2302
- int concat_custom_vcs_url(const char*rev){
2303
- const char *c,*p,*t;
2304
- if( vcs_url && (c = StringValuePtr(vcs_url)) ){
2305
- size_t l = strlen(c);
2306
- if( l>0 ){
2307
- if( p=strstr(c, "$REV$") ){
2308
- concat(c, p-c);
2309
- // concat revision number
2310
- for(t=rev; *t && *t!=']' && *t!='|'; t++) concat_raw_char(*t);
2311
- concat2(p+5);
2312
- } else {
2313
- concat2(c);
2314
- // concat revision number
2315
- for(t=rev; *t && *t!=']' && *t!='|'; t++) concat_raw_char(*t);
2316
- }
2317
- return 1;
2318
- }
2319
- }
2320
- return 0;
2321
- }
2322
-
2323
- process_git_link(const char*target, int numbered_repo){
2324
- const char *c;
2325
- // can use sprintf here.. but I think it's a way slower than raw concat
2326
- concat("<a href=\"",9);
2327
- if( !concat_custom_vcs_url(target) ){
2328
- concat_site_url();
2329
- concat("/code/",6);
2330
- concat(space_name,space_name_len);
2331
- if( numbered_repo ){
2332
- concat("/git-",5);
2333
- while( *target >= '0' && *target <= '9' ) concat_raw_char(*target++);
2334
- while( *target == ':' ) target++;
2335
- concat("/changesets/",12);
2336
- } else {
2337
- concat("/git/changesets/",16);
2338
- }
2339
- for(c=target; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
2340
- }
2341
- process_link_tail(target,NULL,"revision:");
2342
- }
2343
-
2344
- process_wiki_link(const char*target){
2345
- const char *c;
2346
- // can use sprintf here.. but I think it's a way slower than raw concat
2347
- concat("<a class=\"wiki_link\" title=\"",28);
2348
- for(c=target; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
2349
- concat("\" href=\"",8);
2350
- concat_site_url();
2351
- concat("/spaces/",8);
2352
- concat(space_name,space_name_len);
2353
- concat("/wiki/",6);
2354
- for(c=target; *c && *c!=']' && *c!='|' && *c!='#'; c++) concat_raw_char( *c == ' ' ? '_' : *c );
2355
- if( *c == '#' ){
2356
- concat_raw_char('#');
2357
- //if(memcmp(c, "#h-", 3) != 0){
2358
- // anchor w/o "h-" prefix, we need to add it
2359
- concat_raw_char('h');
2360
- concat_raw_char('-');
2361
- //}
2362
- for(c++; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
2363
- }
2364
- process_link_tail(target,NULL,NULL);
2365
- }
2366
-
2367
- process_file_link(const char*target){
2368
- const char *c;
2369
- // can use sprintf here.. but I think it's a way slower than raw concat
2370
- concat("<a href=\"",9);
2371
- concat_site_url();
2372
- concat("/spaces/",8);
2373
- concat(space_name,space_name_len);
2374
- concat("/documents/download/",20);
2375
- for(c=target; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
2376
- process_link_tail(target,NULL,"file:");
2377
- }
2378
-
2379
- process_image_link(const char*target){
2380
- const char *c, *p;
2381
- // can use sprintf here.. but I think it's a way slower than raw concat
2382
- concat("<img src=\"",10);
2383
- concat_site_url();
2384
- concat("/spaces/",8);
2385
- concat(space_name,space_name_len);
2386
- concat("/documents/download/",20);
2387
- for(c=target; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
2388
- concat("\" alt=\"",7);
2389
- if(p = strchr(target,'|')){
2390
- for(c=p+1; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
2391
- } else {
2392
- for(c=target; *c && *c!=']' && *c!='|'; c++) concat_raw_char(*c);
2393
- }
2394
- concat("\" />",4);
2395
- }
2396
-
2397
- process_ticket_link(const char*ticket_id){
2398
- const char *c;
2399
- while(*ticket_id && (*ticket_id < '0' || *ticket_id > '9') ) ticket_id++;
2400
- // can use sprintf here.. but I think it's a way slower than raw concat
2401
- concat("<a href=\"",9);
2402
- concat_site_url();
2403
- concat("/spaces/",8);
2404
- concat(space_name,space_name_len);
2405
- concat("/tickets/",9);
2406
- for(c=ticket_id; *c && *c>='0' && *c<='9'; c++) concat_raw_char(*c);
2407
- process_link_tail(ticket_id,NULL,"#");
2408
- }
2409
-
2410
- concat_escaped_char(int c){
2411
- switch(c){
2412
- case '<':
2413
- concat("&lt;",4);
2414
- break;
2415
- case '>':
2416
- concat("&gt;",4);
2417
- break;
2418
- case '"':
2419
- concat("&quot;",6);
2420
- break;
2421
- case '&':
2422
- concat("&amp;",5);
2423
- break;
2424
- default:
2425
- concat_raw_char(c);
2426
- break;
2427
- }
2428
- }
2429
-
2430
-
2431
- concat_raw_char(int c){
2432
- CHECK_BUF_SIZE(1);
2433
- *bufptr++ = c;
2434
- }
2435
-
2436
- process_url(const char*url){
2437
- const char *p;
2438
-
2439
- concat("<a rel=\"nofollow\" href=\"",24);
2440
- if( *url == 'w' ){
2441
- // url starts with 'www.'
2442
- concat("http://",7);
2443
- } else {
2444
- // assume url starts with 'http://'
2445
- }
2446
- for(p=url; *p; p++) concat_raw_char(*p);
2447
- process_link_tail(url,NULL,NULL);
2448
- }
2449
-
2450
- process_email(const char*url){
2451
- const char *p;
2452
-
2453
- concat("<a href=\"mailto:",16);
2454
- for(p=url; *p; p++) concat_raw_char(*p);
2455
- process_link_tail(url,NULL,NULL);
2456
- }
2457
-
2458
- unconcat(const char*what){
2459
- int l = strlen(what);
2460
- if( bufptr-buf > l && strncmp(bufptr-l,what,l) == 0 ) bufptr -= l;
2461
- }
2462
-
2463
- revert_bold(){
2464
- char *p;
2465
- for( p=bufptr-1; p >= (buf+7) ; p--){
2466
- if( 0 == strncmp(p-7, "<strong>", 8) ){
2467
- memcpy(p-7," *",8);
2468
- break;
2469
- }
2470
- }
2471
- }
2472
-
2473
- revert_italic(){
2474
- char *p;
2475
- for( p=bufptr-1; p >= (buf+3) ; p--){
2476
- if( 0 == strncmp(p-3, "<em>", 4) ){
2477
- memcpy(p-3," _",4);
2478
- break;
2479
- }
2480
- }
2481
- }
2482
-