breakout_parser 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/breakout_parser/lex.yy.c +455 -396
- data/ext/breakout_parser/make_win32.bat +4 -2
- data/ext/breakout_parser/parser.l +20 -7
- data/ext/breakout_parser/parser.tab.c +124 -94
- data/ext/breakout_parser/parser.tab.h +11 -8
- data/ext/breakout_parser/parser.y +9 -6
- data/spec/parser_spec.rb +174 -101
- metadata +2 -2
@@ -3,13 +3,15 @@ ruby extconf.rb
|
|
3
3
|
if errorlevel 1 goto err
|
4
4
|
nmake
|
5
5
|
if errorlevel 1 goto err
|
6
|
-
mt.exe -manifest breakout_parser.so.manifest -outputresource:breakout_parser.so;2
|
6
|
+
if exist breakout_parser.so.manifest mt.exe -manifest breakout_parser.so.manifest -outputresource:breakout_parser.so;2
|
7
7
|
|
8
|
+
echo.
|
8
9
|
echo ALL OK!
|
9
10
|
goto end
|
10
11
|
|
11
12
|
:err
|
13
|
+
echo.
|
12
14
|
echo ERROR!
|
13
15
|
goto end
|
14
16
|
|
15
|
-
:end
|
17
|
+
:end
|
@@ -77,7 +77,7 @@ extern size_t in_buf_len;
|
|
77
77
|
%}
|
78
78
|
|
79
79
|
%option stack
|
80
|
-
%x _PRE
|
80
|
+
%x _PRE_CODE _PRE _CODE
|
81
81
|
%s _BOLD _ITALIC
|
82
82
|
|
83
83
|
|
@@ -87,14 +87,17 @@ extern size_t in_buf_len;
|
|
87
87
|
\xff ; /* EOF mark. should not appear in valid UTF8 text */
|
88
88
|
[\r\n\t ]+\xff ; /* EOF + skip tailing whitespace */
|
89
89
|
|
90
|
-
|
90
|
+
/*
|
91
91
|
([ \t]*\n){2,} { return BRBR; }
|
92
92
|
([ \t]*\r){2,} { return BRBR; }
|
93
93
|
([ \t]*\r\n){2,} { return BRBR; }
|
94
|
+
*/
|
94
95
|
|
95
96
|
[ \t]*(\r\n|\r|\n) { return BR; }
|
96
97
|
|
97
|
-
\<pre>[ \t]*<code>[\r\n]* { BEGIN
|
98
|
+
\<pre>[ \t]*<code>[\r\n]* { BEGIN _PRE_CODE; return PRE_CODE_START; }
|
99
|
+
\<pre>[\r\n]* { BEGIN _PRE; return PRE_START; }
|
100
|
+
\<code>[\r\n \t]* { yy_push_state(_CODE); return CODE_START; }
|
98
101
|
|
99
102
|
^\*/[^ \t\r\n*.] { yylval.ivalue=0; yy_push_state(_BOLD); return BOLD_START; }
|
100
103
|
[ \t]+\*/[^ \t\r\n*.] { yylval.ivalue=1; yy_push_state(_BOLD); return BOLD_START; }
|
@@ -145,10 +148,20 @@ https?:\/\/[^ \r\n<>"(){}*]+[^ \r\n<>"(){}*,.\[\]] { yylval.svalue = yytext; re
|
|
145
148
|
|
146
149
|
|
147
150
|
|
148
|
-
<
|
149
|
-
<
|
150
|
-
<
|
151
|
-
<
|
151
|
+
<_PRE_CODE>[ \t\r\n]*<\/code>[ \t]*<\/pre> { BEGIN INITIAL; return PRE_CODE_END; }
|
152
|
+
<_PRE_CODE>[ \t\r\n]*\xff { BEGIN INITIAL; return PRE_CODE_END; }
|
153
|
+
<_PRE_CODE>(?s:.) { yylval.ivalue = yytext[0]; return T_CHAR; }
|
154
|
+
<_PRE_CODE><<EOF>> { BEGIN INITIAL; return PRE_CODE_END; }
|
155
|
+
|
156
|
+
<_PRE>[ \t\r\n]*<\/pre> { BEGIN INITIAL; return PRE_END; }
|
157
|
+
<_PRE>[ \t\r\n]*\xff { BEGIN INITIAL; return PRE_END; }
|
158
|
+
<_PRE>(?s:.) { yylval.ivalue = yytext[0]; return T_CHAR; }
|
159
|
+
<_PRE><<EOF>> { BEGIN INITIAL; return PRE_END; }
|
160
|
+
|
161
|
+
<_CODE>[ \t\r\n]*<\/code> { yy_pop_state(); return CODE_END; }
|
162
|
+
<_CODE>[ \t\r\n]*\xff { yy_pop_state(); return CODE_END; }
|
163
|
+
<_CODE>(?s:.) { yylval.ivalue = yytext[0]; return T_CHAR; }
|
164
|
+
<_CODE><<EOF>> { yy_pop_state(); return CODE_END; }
|
152
165
|
|
153
166
|
<_BOLD>[ \t]+\*/[ \t]+ { yylval.svalue = " *"; return T_WORD; } /* skip lone star */
|
154
167
|
<_BOLD>\*/[ \t\r\n'.,] { yy_pop_state(); return BOLD_END; }
|
@@ -178,13 +178,16 @@ void yyerror(const char *msg)
|
|
178
178
|
H5 = 276,
|
179
179
|
SPACE = 277,
|
180
180
|
BR = 278,
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
181
|
+
OLI = 279,
|
182
|
+
ULI = 280,
|
183
|
+
PRE_CODE_START = 281,
|
184
|
+
PRE_CODE_END = 282,
|
185
|
+
PRE_START = 283,
|
186
|
+
PRE_END = 284,
|
187
|
+
CODE_START = 285,
|
188
|
+
CODE_END = 286,
|
189
|
+
BOLD_END = 287,
|
190
|
+
ITALIC_END = 288
|
188
191
|
};
|
189
192
|
#endif
|
190
193
|
|
@@ -204,7 +207,7 @@ typedef union YYSTYPE
|
|
204
207
|
|
205
208
|
|
206
209
|
/* Line 214 of yacc.c */
|
207
|
-
#line
|
210
|
+
#line 211 "parser.tab.c"
|
208
211
|
} YYSTYPE;
|
209
212
|
# define YYSTYPE_IS_TRIVIAL 1
|
210
213
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
@@ -216,7 +219,7 @@ typedef union YYSTYPE
|
|
216
219
|
|
217
220
|
|
218
221
|
/* Line 264 of yacc.c */
|
219
|
-
#line
|
222
|
+
#line 223 "parser.tab.c"
|
220
223
|
|
221
224
|
#ifdef short
|
222
225
|
# undef short
|
@@ -429,22 +432,22 @@ union yyalloc
|
|
429
432
|
#endif
|
430
433
|
|
431
434
|
/* YYFINAL -- State number of the termination state. */
|
432
|
-
#define YYFINAL
|
435
|
+
#define YYFINAL 43
|
433
436
|
/* YYLAST -- Last index in YYTABLE. */
|
434
|
-
#define YYLAST
|
437
|
+
#define YYLAST 95
|
435
438
|
|
436
439
|
/* YYNTOKENS -- Number of terminals. */
|
437
|
-
#define YYNTOKENS
|
440
|
+
#define YYNTOKENS 34
|
438
441
|
/* YYNNTS -- Number of nonterminals. */
|
439
|
-
#define YYNNTS
|
442
|
+
#define YYNNTS 28
|
440
443
|
/* YYNRULES -- Number of rules. */
|
441
|
-
#define YYNRULES
|
444
|
+
#define YYNRULES 59
|
442
445
|
/* YYNRULES -- Number of states. */
|
443
|
-
#define YYNSTATES
|
446
|
+
#define YYNSTATES 71
|
444
447
|
|
445
448
|
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
446
449
|
#define YYUNDEFTOK 2
|
447
|
-
#define YYMAXUTOK
|
450
|
+
#define YYMAXUTOK 288
|
448
451
|
|
449
452
|
#define YYTRANSLATE(YYX) \
|
450
453
|
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
@@ -480,7 +483,7 @@ static const yytype_uint8 yytranslate[] =
|
|
480
483
|
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
|
481
484
|
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
482
485
|
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
|
483
|
-
25, 26, 27, 28, 29, 30
|
486
|
+
25, 26, 27, 28, 29, 30, 31, 32, 33
|
484
487
|
};
|
485
488
|
|
486
489
|
#if YYDEBUG
|
@@ -493,25 +496,26 @@ static const yytype_uint8 yyprhs[] =
|
|
493
496
|
42, 45, 49, 51, 54, 57, 61, 63, 66, 68,
|
494
497
|
70, 72, 74, 76, 78, 80, 82, 84, 86, 88,
|
495
498
|
90, 92, 94, 96, 97, 100, 102, 104, 106, 108,
|
496
|
-
110, 112, 114, 116, 118,
|
499
|
+
110, 112, 114, 116, 118, 119, 124, 125, 130, 131
|
497
500
|
};
|
498
501
|
|
499
502
|
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
|
500
503
|
static const yytype_int8 yyrhs[] =
|
501
504
|
{
|
502
|
-
|
503
|
-
-1,
|
504
|
-
-1, -1, -1,
|
505
|
-
|
506
|
-
|
507
|
-
-1,
|
508
|
-
-1,
|
509
|
-
6, -1, 15, -1, 4, -1,
|
510
|
-
|
511
|
-
14, -1, 11, -1, 12, -1, -1,
|
505
|
+
35, 0, -1, -1, 36, 35, -1, 57, -1, 45,
|
506
|
+
-1, 50, -1, 51, -1, 52, -1, 53, -1, 54,
|
507
|
+
-1, -1, -1, 37, 41, 38, 36, -1, -1, -1,
|
508
|
+
39, 43, 40, 36, -1, 58, -1, 42, -1, 41,
|
509
|
+
42, -1, 56, 45, -1, 56, 45, 23, -1, 44,
|
510
|
+
-1, 43, 44, -1, 55, 45, -1, 55, 45, 23,
|
511
|
+
-1, 46, -1, 46, 45, -1, 48, -1, 47, -1,
|
512
|
+
6, -1, 15, -1, 4, -1, 32, -1, 5, -1,
|
513
|
+
33, -1, 7, -1, 9, -1, 10, -1, 13, -1,
|
514
|
+
14, -1, 11, -1, 12, -1, -1, 49, 48, -1,
|
512
515
|
3, -1, 17, -1, 18, -1, 19, -1, 20, -1,
|
513
|
-
21, -1,
|
514
|
-
|
516
|
+
21, -1, 24, -1, 25, -1, 23, -1, -1, 26,
|
517
|
+
59, 48, 27, -1, -1, 28, 60, 48, 29, -1,
|
518
|
+
-1, 30, 61, 48, 31, -1
|
515
519
|
};
|
516
520
|
|
517
521
|
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
@@ -522,7 +526,7 @@ static const yytype_uint8 yyrline[] =
|
|
522
526
|
100, 101, 103, 104, 106, 107, 109, 110, 112, 113,
|
523
527
|
114, 115, 116, 117, 118, 119, 121, 122, 123, 124,
|
524
528
|
125, 126, 127, 129, 130, 132, 139, 140, 141, 142,
|
525
|
-
143, 145, 146, 147,
|
529
|
+
143, 145, 146, 147, 150, 150, 151, 151, 152, 152
|
526
530
|
};
|
527
531
|
#endif
|
528
532
|
|
@@ -535,10 +539,12 @@ static const char *const yytname[] =
|
|
535
539
|
"T_WORD", "TICKET_LINK", "LINK", "SVN_REVISION_LINK",
|
536
540
|
"GIT_REVISION_LINK", "WIKI_LINK", "ANCHOR_LINK", "URL_WITH_PROTO_LINK",
|
537
541
|
"URL_WITHOUT_PROTO_LINK", "URL", "UL", "H1", "H2", "H3", "H4", "H5",
|
538
|
-
"SPACE", "BR", "
|
542
|
+
"SPACE", "BR", "OLI", "ULI", "PRE_CODE_START", "PRE_CODE_END",
|
543
|
+
"PRE_START", "PRE_END", "CODE_START", "CODE_END", "BOLD_END",
|
539
544
|
"ITALIC_END", "$accept", "text", "textitem", "$@1", "$@2", "$@3", "$@4",
|
540
545
|
"ulist", "ulitem", "olist", "olitem", "words", "word", "link", "chars",
|
541
|
-
"char", "h1", "h2", "h3", "h4", "h5", "oli", "uli", "br", "
|
546
|
+
"char", "h1", "h2", "h3", "h4", "h5", "oli", "uli", "br", "code", "$@5",
|
547
|
+
"$@6", "$@7", 0
|
542
548
|
};
|
543
549
|
#endif
|
544
550
|
|
@@ -550,19 +556,19 @@ static const yytype_uint16 yytoknum[] =
|
|
550
556
|
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
|
551
557
|
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
|
552
558
|
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
|
553
|
-
285
|
559
|
+
285, 286, 287, 288
|
554
560
|
};
|
555
561
|
# endif
|
556
562
|
|
557
563
|
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
558
564
|
static const yytype_uint8 yyr1[] =
|
559
565
|
{
|
560
|
-
0,
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
+
0, 34, 35, 35, 36, 36, 36, 36, 36, 36,
|
567
|
+
36, 37, 38, 36, 39, 40, 36, 36, 41, 41,
|
568
|
+
42, 42, 43, 43, 44, 44, 45, 45, 46, 46,
|
569
|
+
46, 46, 46, 46, 46, 46, 47, 47, 47, 47,
|
570
|
+
47, 47, 47, 48, 48, 49, 50, 51, 52, 53,
|
571
|
+
54, 55, 56, 57, 59, 58, 60, 58, 61, 58
|
566
572
|
};
|
567
573
|
|
568
574
|
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
|
@@ -573,7 +579,7 @@ static const yytype_uint8 yyr2[] =
|
|
573
579
|
2, 3, 1, 2, 2, 3, 1, 2, 1, 1,
|
574
580
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
575
581
|
1, 1, 1, 0, 2, 1, 1, 1, 1, 1,
|
576
|
-
1, 1, 1, 1,
|
582
|
+
1, 1, 1, 1, 0, 4, 0, 4, 0, 4
|
577
583
|
};
|
578
584
|
|
579
585
|
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
|
@@ -583,41 +589,43 @@ static const yytype_uint8 yydefact[] =
|
|
583
589
|
{
|
584
590
|
2, 45, 32, 34, 30, 36, 37, 38, 41, 42,
|
585
591
|
39, 40, 31, 46, 47, 48, 49, 50, 53, 54,
|
586
|
-
|
587
|
-
28, 43, 6, 7, 8, 9, 10, 4, 17,
|
588
|
-
|
589
|
-
27, 44, 0,
|
590
|
-
13, 21, 16,
|
592
|
+
56, 58, 33, 35, 0, 2, 0, 0, 5, 26,
|
593
|
+
29, 28, 43, 6, 7, 8, 9, 10, 4, 17,
|
594
|
+
43, 43, 43, 1, 3, 52, 12, 18, 43, 51,
|
595
|
+
15, 22, 43, 27, 44, 0, 0, 0, 11, 19,
|
596
|
+
20, 11, 23, 24, 55, 57, 59, 13, 21, 16,
|
597
|
+
25
|
591
598
|
};
|
592
599
|
|
593
600
|
/* YYDEFGOTO[NTERM-NUM]. */
|
594
601
|
static const yytype_int8 yydefgoto[] =
|
595
602
|
{
|
596
|
-
-1,
|
597
|
-
|
598
|
-
|
603
|
+
-1, 24, 25, 26, 58, 27, 61, 46, 47, 50,
|
604
|
+
51, 28, 29, 30, 31, 32, 33, 34, 35, 36,
|
605
|
+
37, 52, 48, 38, 39, 40, 41, 42
|
599
606
|
};
|
600
607
|
|
601
608
|
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
|
602
609
|
STATE-NUM. */
|
603
|
-
#define YYPACT_NINF -
|
610
|
+
#define YYPACT_NINF -37
|
604
611
|
static const yytype_int8 yypact[] =
|
605
612
|
{
|
606
|
-
|
607
|
-
-
|
608
|
-
-
|
609
|
-
-
|
610
|
-
|
611
|
-
|
612
|
-
-
|
613
|
+
31, -37, -37, -37, -37, -37, -37, -37, -37, -37,
|
614
|
+
-37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
|
615
|
+
-37, -37, -37, -37, 1, 31, -23, -8, -37, 62,
|
616
|
+
-37, -37, 26, -37, -37, -37, -37, -37, -37, -37,
|
617
|
+
26, 26, 26, -37, -37, -37, -23, -37, 62, -37,
|
618
|
+
-8, -37, 62, -37, -37, 12, 18, 22, 0, -37,
|
619
|
+
35, 0, -37, 37, -37, -37, -37, -37, -37, -37,
|
620
|
+
-37
|
613
621
|
};
|
614
622
|
|
615
623
|
/* YYPGOTO[NTERM-NUM]. */
|
616
624
|
static const yytype_int8 yypgoto[] =
|
617
625
|
{
|
618
|
-
-
|
619
|
-
|
620
|
-
-
|
626
|
+
-37, 56, -36, -37, -37, -37, -37, -37, 16, -37,
|
627
|
+
32, -21, -37, -37, 38, -37, -37, -37, -37, -37,
|
628
|
+
-37, -37, -37, -37, -37, -37, -37, -37
|
621
629
|
};
|
622
630
|
|
623
631
|
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
|
@@ -627,30 +635,30 @@ static const yytype_int8 yypgoto[] =
|
|
627
635
|
#define YYTABLE_NINF -44
|
628
636
|
static const yytype_int8 yytable[] =
|
629
637
|
{
|
630
|
-
-43,
|
631
|
-
7, 8, 9, 10, 11, 12,
|
632
|
-
16, 17,
|
633
|
-
22, 1, 2, 3, 4, 5,
|
634
|
-
9, 10, 11, 12,
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
0, 0, 0,
|
638
|
+
-43, 43, 45, 1, 2, 3, 4, 5, 53, 6,
|
639
|
+
7, 8, 9, 10, 11, 12, 49, 13, 14, 15,
|
640
|
+
16, 17, 67, 18, -14, 69, 19, 60, 20, 1,
|
641
|
+
21, 63, 22, 23, 1, 2, 3, 4, 5, 64,
|
642
|
+
6, 7, 8, 9, 10, 11, 12, 65, 13, 14,
|
643
|
+
15, 16, 17, 66, 18, -14, -11, 19, 68, 20,
|
644
|
+
70, 21, 59, 22, 23, 1, 2, 3, 4, 5,
|
645
|
+
54, 6, 7, 8, 9, 10, 11, 12, 55, 56,
|
646
|
+
57, 44, 62, 0, 0, 0, 0, 0, 0, 0,
|
647
|
+
0, 0, 0, 0, 22, 23
|
640
648
|
};
|
641
649
|
|
642
650
|
static const yytype_int8 yycheck[] =
|
643
651
|
{
|
644
|
-
0, 0,
|
645
|
-
10, 11, 12, 13, 14, 15,
|
646
|
-
20, 21,
|
647
|
-
30, 3, 4, 5, 6, 7,
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
-1, -1, -1, -1, -1,
|
653
|
-
-1, -1, -1,
|
652
|
+
0, 0, 25, 3, 4, 5, 6, 7, 29, 9,
|
653
|
+
10, 11, 12, 13, 14, 15, 24, 17, 18, 19,
|
654
|
+
20, 21, 58, 23, 24, 61, 26, 48, 28, 3,
|
655
|
+
30, 52, 32, 33, 3, 4, 5, 6, 7, 27,
|
656
|
+
9, 10, 11, 12, 13, 14, 15, 29, 17, 18,
|
657
|
+
19, 20, 21, 31, 23, 24, 25, 26, 23, 28,
|
658
|
+
23, 30, 46, 32, 33, 3, 4, 5, 6, 7,
|
659
|
+
32, 9, 10, 11, 12, 13, 14, 15, 40, 41,
|
660
|
+
42, 25, 50, -1, -1, -1, -1, -1, -1, -1,
|
661
|
+
-1, -1, -1, -1, 32, 33
|
654
662
|
};
|
655
663
|
|
656
664
|
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
|
@@ -658,12 +666,13 @@ static const yytype_int8 yycheck[] =
|
|
658
666
|
static const yytype_uint8 yystos[] =
|
659
667
|
{
|
660
668
|
0, 3, 4, 5, 6, 7, 9, 10, 11, 12,
|
661
|
-
13, 14, 15, 17, 18, 19, 20, 21, 23,
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
669
|
+
13, 14, 15, 17, 18, 19, 20, 21, 23, 26,
|
670
|
+
28, 30, 32, 33, 35, 36, 37, 39, 45, 46,
|
671
|
+
47, 48, 49, 50, 51, 52, 53, 54, 57, 58,
|
672
|
+
59, 60, 61, 0, 35, 25, 41, 42, 56, 24,
|
673
|
+
43, 44, 55, 45, 48, 48, 48, 48, 38, 42,
|
674
|
+
45, 40, 44, 45, 27, 29, 31, 36, 23, 36,
|
675
|
+
23
|
667
676
|
};
|
668
677
|
|
669
678
|
#define yyerrok (yyerrstatus = 0)
|
@@ -1722,28 +1731,49 @@ yyreduce:
|
|
1722
1731
|
case 54:
|
1723
1732
|
|
1724
1733
|
/* Line 1455 of yacc.c */
|
1725
|
-
#line
|
1726
|
-
{concat("<
|
1734
|
+
#line 150 "parser.y"
|
1735
|
+
{concat("<pre><code>",11);}
|
1727
1736
|
break;
|
1728
1737
|
|
1729
1738
|
case 55:
|
1730
1739
|
|
1731
1740
|
/* Line 1455 of yacc.c */
|
1732
|
-
#line
|
1733
|
-
{concat("
|
1741
|
+
#line 150 "parser.y"
|
1742
|
+
{concat("</code></pre>",13);}
|
1734
1743
|
break;
|
1735
1744
|
|
1736
1745
|
case 56:
|
1737
1746
|
|
1738
1747
|
/* Line 1455 of yacc.c */
|
1739
|
-
#line
|
1740
|
-
{concat("
|
1748
|
+
#line 151 "parser.y"
|
1749
|
+
{concat("<pre>",5);}
|
1750
|
+
break;
|
1751
|
+
|
1752
|
+
case 57:
|
1753
|
+
|
1754
|
+
/* Line 1455 of yacc.c */
|
1755
|
+
#line 151 "parser.y"
|
1756
|
+
{concat("</pre>",6);}
|
1757
|
+
break;
|
1758
|
+
|
1759
|
+
case 58:
|
1760
|
+
|
1761
|
+
/* Line 1455 of yacc.c */
|
1762
|
+
#line 152 "parser.y"
|
1763
|
+
{concat("<code>",6);}
|
1764
|
+
break;
|
1765
|
+
|
1766
|
+
case 59:
|
1767
|
+
|
1768
|
+
/* Line 1455 of yacc.c */
|
1769
|
+
#line 152 "parser.y"
|
1770
|
+
{concat("</code>",7);}
|
1741
1771
|
break;
|
1742
1772
|
|
1743
1773
|
|
1744
1774
|
|
1745
1775
|
/* Line 1455 of yacc.c */
|
1746
|
-
#line
|
1776
|
+
#line 1777 "parser.tab.c"
|
1747
1777
|
default: break;
|
1748
1778
|
}
|
1749
1779
|
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
@@ -1955,7 +1985,7 @@ yyreturn:
|
|
1955
1985
|
|
1956
1986
|
|
1957
1987
|
/* Line 1675 of yacc.c */
|
1958
|
-
#line
|
1988
|
+
#line 156 "parser.y"
|
1959
1989
|
|
1960
1990
|
|
1961
1991
|
concat_hex_char(char c){
|
@@ -60,13 +60,16 @@
|
|
60
60
|
H5 = 276,
|
61
61
|
SPACE = 277,
|
62
62
|
BR = 278,
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
63
|
+
OLI = 279,
|
64
|
+
ULI = 280,
|
65
|
+
PRE_CODE_START = 281,
|
66
|
+
PRE_CODE_END = 282,
|
67
|
+
PRE_START = 283,
|
68
|
+
PRE_END = 284,
|
69
|
+
CODE_START = 285,
|
70
|
+
CODE_END = 286,
|
71
|
+
BOLD_END = 287,
|
72
|
+
ITALIC_END = 288
|
70
73
|
};
|
71
74
|
#endif
|
72
75
|
|
@@ -86,7 +89,7 @@ typedef union YYSTYPE
|
|
86
89
|
|
87
90
|
|
88
91
|
/* Line 1676 of yacc.c */
|
89
|
-
#line
|
92
|
+
#line 93 "parser.tab.h"
|
90
93
|
} YYSTYPE;
|
91
94
|
# define YYSTYPE_IS_TRIVIAL 1
|
92
95
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
@@ -71,8 +71,8 @@ void yyerror(const char *msg)
|
|
71
71
|
%token <svalue> URL
|
72
72
|
%token <svalue> UL
|
73
73
|
%token <svalue> H1 H2 H3 H4 H5
|
74
|
-
%token SPACE BR BRBR OLI ULI
|
75
|
-
%token PRE_START PRE_END
|
74
|
+
%token SPACE BR /*BRBR*/ OLI ULI
|
75
|
+
%token PRE_CODE_START PRE_CODE_END PRE_START PRE_END CODE_START CODE_END
|
76
76
|
%token BOLD_END ITALIC_END
|
77
77
|
|
78
78
|
//%type <dvalue> expression
|
@@ -92,7 +92,7 @@ textitem: br
|
|
92
92
|
| h5 {concat("</h5>",5)}
|
93
93
|
| {concat("<ul>",4)} ulist {concat("</ul>",5)} textitem
|
94
94
|
| {concat("<ol>",4)} olist {concat("</ol>",5)} textitem
|
95
|
-
|
|
95
|
+
| code
|
96
96
|
|
97
97
|
ulist: ulitem {concat("</li>",5)}
|
98
98
|
| ulist ulitem {concat("</li>",5)}
|
@@ -141,12 +141,15 @@ h2 : H2 {concat("<h2 id=\"",8); process_header($1)}
|
|
141
141
|
h3 : H3 {concat("<h3 id=\"",8); process_header($1)}
|
142
142
|
h4 : H4 {concat("<h4 id=\"",8); process_header($1)}
|
143
143
|
h5 : H5 {concat("<h5 id=\"",8); process_header($1)}
|
144
|
-
ul : UL {concat("<ul>",4)}
|
144
|
+
//ul : UL {concat("<ul>",4)}
|
145
145
|
oli : OLI {concat("<li>",4)}
|
146
146
|
uli : ULI {concat("<li>",4)}
|
147
147
|
br : BR {concat("<br />",6)}
|
148
|
-
| BRBR {concat("<br /><br />",12)}
|
149
|
-
|
148
|
+
// | BRBR {concat("<br /><br />",12)}
|
149
|
+
|
150
|
+
code : PRE_CODE_START {concat("<pre><code>",11)} chars PRE_CODE_END {concat("</code></pre>",13)}
|
151
|
+
| PRE_START {concat("<pre>",5)} chars PRE_END {concat("</pre>",6)}
|
152
|
+
| CODE_START {concat("<code>",6)} chars CODE_END {concat("</code>",7)}
|
150
153
|
|
151
154
|
//word : T_WORD { process_word($1); }
|
152
155
|
|