diff --git a/libretroshare/src/services/p3posted.cc b/libretroshare/src/services/p3posted.cc index 20736ee6c..0ad470653 100644 --- a/libretroshare/src/services/p3posted.cc +++ b/libretroshare/src/services/p3posted.cc @@ -2,6 +2,7 @@ #include #include #include +#include #include "p3posted.h" #include "gxs/rsgxsflags.h" diff --git a/supportlibs/pegmarkdown/GLibFacade.c b/supportlibs/pegmarkdown/GLibFacade.c new file mode 100644 index 000000000..f60c1443b --- /dev/null +++ b/supportlibs/pegmarkdown/GLibFacade.c @@ -0,0 +1,208 @@ +/* + * GLibFacade.c + * MultiMarkdown + * + * Created by Daniel Jalkut on 7/26/11. + * Modified by Fletcher T. Penney on 9/15/11. + * Modified by Dan Lowe on 1/3/12. + * Copyright 2011 __MyCompanyName__. All rights reserved. + */ + +#include "GLibFacade.h" + +#include +#include +#include +#include + +/* + * The following section came from: + * + * http://lists-archives.org/mingw-users/12649-asprintf-missing-vsnprintf- + * behaving-differently-and-_vsncprintf-undefined.html + * + * and + * + * http://groups.google.com/group/jansson-users/browse_thread/thread/ + * 76a88d63d9519978/041a7d0570de2d48?lnk=raot + */ + +/* Solaris and Windows do not provide vasprintf() or asprintf(). */ +#if defined(__WIN32) || (defined(__SVR4) && defined(__sun)) +int vasprintf( char **sptr, char *fmt, va_list argv ) +{ + int wanted = vsnprintf( *sptr = NULL, 0, fmt, argv ); + if( (wanted > 0) && ((*sptr = malloc( 1 + wanted )) != NULL) ) + return vsprintf( *sptr, fmt, argv ); + + return wanted; +} + +int asprintf( char **sptr, char *fmt, ... ) +{ + int retval; + va_list argv; + va_start( argv, fmt ); + retval = vasprintf( sptr, fmt, argv ); + va_end( argv ); + return retval; +} +#endif + + +/* GString */ + +#define kStringBufferStartingSize 1024 +#define kStringBufferGrowthMultiplier 2 + +GString* g_string_new(char *startingString) +{ + GString* newString = malloc(sizeof(GString)); + + if (startingString == NULL) startingString = ""; + + size_t startingBufferSize = kStringBufferStartingSize; + size_t startingStringSize = strlen(startingString); + while (startingBufferSize < (startingStringSize + 1)) + { + startingBufferSize *= kStringBufferGrowthMultiplier; + } + + newString->str = malloc(startingBufferSize); + newString->currentStringBufferSize = startingBufferSize; + strncpy(newString->str, startingString, startingStringSize); + newString->str[startingStringSize] = '\0'; + newString->currentStringLength = startingStringSize; + + return newString; +} + +char* g_string_free(GString* ripString, bool freeCharacterData) +{ + char* returnedString = ripString->str; + if (freeCharacterData) + { + if (ripString->str != NULL) + { + free(ripString->str); + } + returnedString = NULL; + } + + free(ripString); + + return returnedString; +} + +static void ensureStringBufferCanHold(GString* baseString, size_t newStringSize) +{ + size_t newBufferSizeNeeded = newStringSize + 1; + if (newBufferSizeNeeded > baseString->currentStringBufferSize) + { + size_t newBufferSize = baseString->currentStringBufferSize; + + while (newBufferSizeNeeded > newBufferSize) + { + newBufferSize *= kStringBufferGrowthMultiplier; + } + + baseString->str = realloc(baseString->str, newBufferSize); + baseString->currentStringBufferSize = newBufferSize; + } +} + +void g_string_append(GString* baseString, char* appendedString) +{ + if ((appendedString != NULL) && (strlen(appendedString) > 0)) + { + size_t appendedStringLength = strlen(appendedString); + size_t newStringLength = baseString->currentStringLength + appendedStringLength; + ensureStringBufferCanHold(baseString, newStringLength); + + /* We already know where the current string ends, so pass that as the starting address for strncat */ + strncat(baseString->str + baseString->currentStringLength, appendedString, appendedStringLength); + baseString->currentStringLength = newStringLength; + } +} + +void g_string_append_c(GString* baseString, char appendedCharacter) +{ + size_t newSizeNeeded = baseString->currentStringLength + 1; + ensureStringBufferCanHold(baseString, newSizeNeeded); + + baseString->str[baseString->currentStringLength] = appendedCharacter; + baseString->currentStringLength++; + baseString->str[baseString->currentStringLength] = '\0'; +} + +void g_string_append_printf(GString* baseString, char* format, ...) +{ + va_list args; + va_start(args, format); + + char* formattedString = NULL; + vasprintf(&formattedString, format, args); + if (formattedString != NULL) + { + g_string_append(baseString, formattedString); + free(formattedString); + } +} + +void g_string_prepend(GString* baseString, char* prependedString) +{ + if ((prependedString != NULL) && (strlen(prependedString) > 0)) + { + size_t prependedStringLength = strlen(prependedString); + size_t newStringLength = baseString->currentStringLength + prependedStringLength; + ensureStringBufferCanHold(baseString, newStringLength); + + memmove(baseString->str + prependedStringLength, baseString->str, baseString->currentStringLength); + strncpy(baseString->str, prependedString, prependedStringLength); + baseString->currentStringLength = newStringLength; + baseString->str[baseString->currentStringLength] = '\0'; + } +} + +/* GSList */ + +void g_slist_free(GSList* ripList) +{ + GSList* thisListItem = ripList; + while (thisListItem != NULL) + { + GSList* nextItem = thisListItem->next; + + /* I guess we don't release the data? Non-retained memory management is hard... let's figure it out later. */ + free(thisListItem); + + thisListItem = nextItem; + } +} + +/* Currently only used for markdown_output.c endnotes printing */ +GSList* g_slist_reverse(GSList* theList) +{ + GSList* lastNodeSeen = NULL; + + /* Iterate the list items, tacking them on to our new reversed List as we find them */ + GSList* listWalker = theList; + while (listWalker != NULL) + { + GSList* nextNode = listWalker->next; + listWalker->next = lastNodeSeen; + lastNodeSeen = listWalker; + listWalker = nextNode; + } + + return lastNodeSeen; +} + +GSList* g_slist_prepend(GSList* targetElement, void* newElementData) +{ + GSList* newElement = malloc(sizeof(GSList)); + newElement->data = newElementData; + newElement->next = targetElement; + return newElement; +} + diff --git a/supportlibs/pegmarkdown/GLibFacade.h b/supportlibs/pegmarkdown/GLibFacade.h new file mode 100644 index 000000000..30651ac54 --- /dev/null +++ b/supportlibs/pegmarkdown/GLibFacade.h @@ -0,0 +1,67 @@ +/* + * GLibFacade.h + * MultiMarkdown + * + * Created by Daniel Jalkut on 7/26/11. + * Copyright 2011 __MyCompanyName__. All rights reserved. + */ + +#ifndef __MARKDOWN_GLIB_FACADE__ +#define __MARKDOWN_GLIB_FACADE__ + +/* peg_markdown uses the link symbol for its own purposes */ +#define link MARKDOWN_LINK_IGNORED +#include +#undef link + +#include +#include + +typedef int gboolean; +typedef char gchar; + +/* This style of bool is used in shared source code */ +#define FALSE false +#define TRUE true + +/* WE implement minimal mirror implementations of GLib's GString and GSList + * sufficient to cover the functionality required by MultiMarkdown. + * + * NOTE: THese are 100% clean, from-scratch implementations using only the + * GLib function prototype as guide for behavior. + */ + +typedef struct +{ + /* Current UTF8 byte stream this string represents */ + char* str; + + /* Where in the str buffer will we add new characters */ + /* or append new strings? */ + int currentStringBufferSize; + int currentStringLength; +} GString; + +GString* g_string_new(char *startingString); +char* g_string_free(GString* ripString, bool freeCharacterData); + +void g_string_append_c(GString* baseString, char appendedCharacter); +void g_string_append(GString* baseString, char *appendedString); + +void g_string_prepend(GString* baseString, char* prependedString); + +void g_string_append_printf(GString* baseString, char* format, ...); + +/* Just implement a very simple singly linked list. */ + +typedef struct _GSList +{ + void* data; + struct _GSList* next; +} GSList; + +void g_slist_free(GSList* ripList); +GSList* g_slist_prepend(GSList* targetElement, void* newElementData); +GSList* g_slist_reverse(GSList* theList); + +#endif diff --git a/supportlibs/pegmarkdown/LICENSE b/supportlibs/pegmarkdown/LICENSE new file mode 100644 index 000000000..878252980 --- /dev/null +++ b/supportlibs/pegmarkdown/LICENSE @@ -0,0 +1,88 @@ +markdown in c, implemented using PEG grammar +Copyright (c) 2008-2011 John MacFarlane +ODF output code (c) 2011 Fletcher T. Penney + +peg-markdown is released under both the GPL and MIT licenses. +You may pick the license that best fits your needs. + +The GPL + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +The MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + +peg-0.1.4 (included for convenience - http://piumarta.com/software/peg/) + +Copyright (c) 2007 by Ian Piumarta +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the 'Software'), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, provided that the above copyright notice(s) and this +permission notice appear in all copies of the Software. Acknowledgement +of the use of this Software in supporting documentation would be +appreciated but is not required. + +THE SOFTWARE IS PROVIDED 'AS IS'. USE ENTIRELY AT YOUR OWN RISK. + +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + +my_getopt (included for convenience - http://www.geocities.com/bsittler/) + +Copyright 1997, 2000, 2001, 2002, 2006, Benjamin Sittler + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + diff --git a/supportlibs/pegmarkdown/Makefile.orig b/supportlibs/pegmarkdown/Makefile.orig new file mode 100644 index 000000000..1e8c7a003 --- /dev/null +++ b/supportlibs/pegmarkdown/Makefile.orig @@ -0,0 +1,42 @@ +uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') +ifneq (,$(findstring MINGW,$(uname_S))) + X = .exe +endif + +export X + +PROGRAM=markdown$(X) +CFLAGS ?= -Wall -O3 -ansi -D_GNU_SOURCE # -flto for newer GCC versions +OBJS=markdown_parser.o markdown_output.o markdown_lib.o utility_functions.o parsing_functions.o odf.o +PEGDIR=peg-0.1.9 +LEG=$(PEGDIR)/leg$(X) +PKG_CONFIG = pkg-config + +ALL : $(PROGRAM) + +$(LEG): $(PEGDIR) + CC=gcc make -C $(PEGDIR) + +%.o : %.c markdown_peg.h + $(CC) -c `$(PKG_CONFIG) --cflags glib-2.0` $(CFLAGS) -o $@ $< + +$(PROGRAM) : markdown.c $(OBJS) + $(CC) `$(PKG_CONFIG) --cflags glib-2.0` $(CFLAGS) -o $@ $< $(OBJS) `$(PKG_CONFIG) --libs glib-2.0` + +markdown_parser.c : markdown_parser.leg $(LEG) markdown_peg.h parsing_functions.c utility_functions.c + $(LEG) -o $@ $< + +.PHONY: clean test + +clean: + rm -f markdown_parser.c $(PROGRAM) $(OBJS) + +distclean: clean + make -C $(PEGDIR) clean +\ +test: $(PROGRAM) + cd MarkdownTest_1.0.3; \ + ./MarkdownTest.pl --script=../$(PROGRAM) --tidy + +leak-check: $(PROGRAM) + valgrind --leak-check=full ./markdown README diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/MarkdownTest.pl b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/MarkdownTest.pl new file mode 100755 index 000000000..55553d09c --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/MarkdownTest.pl @@ -0,0 +1,176 @@ +#!/usr/bin/perl + +# +# MarkdownTester -- Run tests for Markdown implementations +# +# Copyright (c) 2004-2005 John Gruber +# +# + +use strict; +use warnings; +use Getopt::Long; +use Benchmark; + +our $VERSION = '1.0.2'; +# Sat 24 Dec 2005 + +my $time_start = new Benchmark; +my $test_dir = "Tests"; +my $script = "./Markdown.pl"; +my $use_tidy = 0; +my ($flag_version); + +GetOptions ( + "script=s" => \$script, + "testdir=s" => \$test_dir, + "tidy" => \$use_tidy, + "version" => \$flag_version, + ); + +if($flag_version) { + my $progname = $0; + $progname =~ s{.*/}{}; + die "$progname version $VERSION\n"; +} + +unless (-d $test_dir) { die "'$test_dir' is not a directory.\n"; } +unless (-f $script) { die "$script does not exist.\n"; } +unless (-x $script) { die "$script is not executable.\n"; } + +my $tests_passed = 0; +my $tests_failed = 0; + +TEST: +foreach my $testfile (glob "$test_dir/*.text") { + my $testname = $testfile; + $testname =~ s{.*/(.+)\.text$}{$1}i; + print "$testname ... "; + + # Look for a corresponding .html file for each .text file: + my $resultfile = $testfile; + $resultfile =~ s{\.text$}{\.html}i; + unless (-f $resultfile) { + print "'$resultfile' does not exist.\n\n"; + next TEST; + } + + # open(TEST, $testfile) || die("Can't open testfile: $!"); + open(RESULT, $resultfile) || die("Can't open resultfile: $!"); + undef $/; + # my $t_input = ; + my $t_result = ; + + my $t_output = `'$script' '$testfile'`; + + # Normalize the output and expected result strings: + $t_result =~ s/\s+\z//; # trim trailing whitespace + $t_output =~ s/\s+\z//; # trim trailing whitespace + if ($use_tidy) { + # Escape the strings, pass them through to CLI tidy tool for tag-level equivalency + $t_result =~ s{'}{'\\''}g; # escape ' chars for shell + $t_output =~ s{'}{'\\''}g; + $t_result = `echo '$t_result' | tidy --show-body-only 1 --quiet 1 --show-warnings 0`; + $t_output = `echo '$t_output' | tidy --show-body-only 1 --quiet 1 --show-warnings 0`; + } + + if ($t_output eq $t_result) { + print "OK\n"; + $tests_passed++; + } + else { + print "FAILED\n\n"; +# This part added by JM to print diffs + open(OUT, '>tmp1') or die $!; + print OUT $t_output or die $!; + open(RES, '>tmp2') or die $!; + print RES $t_result or die $!; + print `diff tmp1 tmp2`; + close RES; + close OUT; + print "\n"; + `rm tmp?`; +# End of added part + $tests_failed++; + } +} + +print "\n\n"; +print "$tests_passed passed; $tests_failed failed.\n"; + +my $time_end = new Benchmark; +my $time_diff = timediff($time_end, $time_start); +print "Benchmark: ", timestr($time_diff), "\n"; + + +__END__ + +=pod + +=head1 NAME + +B + + +=head1 SYNOPSIS + +B [ B<--options> ] [ I ... ] + + +=head1 DESCRIPTION + + +=head1 OPTIONS + +Use "--" to end switch parsing. For example, to open a file named "-z", use: + + MarkdownTest.pl -- -z + +=over 4 + +=item B<--script> + +Specify the path to the Markdown script to test. Defaults to +"./Markdown.pl". Example: + + ./MarkdownTest.pl --script ./PHP-Markdown/php-markdown + +=item B<--testdir> + +Specify the path to a directory containing test data. Defaults to "Tests". + +=item B<--tidy> + +Flag to turn on using the command line 'tidy' tool to normalize HTML +output before comparing script output to the expected test result. +Assumes that the 'tidy' command is available in your PATH. Defaults to +off. + +=back + + + +=head1 BUGS + + + +=head1 VERSION HISTORY + +1.0 Mon 13 Dec 2004-2005 + +1.0.1 Mon 19 Sep 2005 + + + Better handling of case when foo.text exists, but foo.html doesn't. + It now prints a message and moves on, rather than dying. + + +=head1 COPYRIGHT AND LICENSE + +Copyright (c) 2004-2005 John Gruber + +All rights reserved. + +This is free software; you may redistribute it and/or modify it under +the same terms as Perl itself. + +=cut diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Amps and angle encoding.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Amps and angle encoding.html new file mode 100644 index 000000000..9606860b6 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Amps and angle encoding.html @@ -0,0 +1,17 @@ +

AT&T has an ampersand in their name.

+ +

AT&T is another way to write it.

+ +

This & that.

+ +

4 < 5.

+ +

6 > 5.

+ +

Here's a link with an ampersand in the URL.

+ +

Here's a link with an amersand in the link text: AT&T.

+ +

Here's an inline link.

+ +

Here's an inline link.

diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Amps and angle encoding.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Amps and angle encoding.text new file mode 100644 index 000000000..0e9527f93 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Amps and angle encoding.text @@ -0,0 +1,21 @@ +AT&T has an ampersand in their name. + +AT&T is another way to write it. + +This & that. + +4 < 5. + +6 > 5. + +Here's a [link] [1] with an ampersand in the URL. + +Here's a link with an amersand in the link text: [AT&T] [2]. + +Here's an inline [link](/script?foo=1&bar=2). + +Here's an inline [link](). + + +[1]: http://example.com/?foo=1&bar=2 +[2]: http://att.com/ "AT&T" \ No newline at end of file diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Auto links.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Auto links.html new file mode 100644 index 000000000..f8df9852c --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Auto links.html @@ -0,0 +1,18 @@ +

Link: http://example.com/.

+ +

With an ampersand: http://example.com/?foo=1&bar=2

+ + + +
+

Blockquoted: http://example.com/

+
+ +

Auto-links should not occur here: <http://example.com/>

+ +
or here: <http://example.com/>
+
diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Auto links.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Auto links.text new file mode 100644 index 000000000..abbc48869 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Auto links.text @@ -0,0 +1,13 @@ +Link: . + +With an ampersand: + +* In a list? +* +* It should. + +> Blockquoted: + +Auto-links should not occur here: `` + + or here: \ No newline at end of file diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Backslash escapes.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Backslash escapes.html new file mode 100644 index 000000000..29870dac5 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Backslash escapes.html @@ -0,0 +1,118 @@ +

These should all get escaped:

+ +

Backslash: \

+ +

Backtick: `

+ +

Asterisk: *

+ +

Underscore: _

+ +

Left brace: {

+ +

Right brace: }

+ +

Left bracket: [

+ +

Right bracket: ]

+ +

Left paren: (

+ +

Right paren: )

+ +

Greater-than: >

+ +

Hash: #

+ +

Period: .

+ +

Bang: !

+ +

Plus: +

+ +

Minus: -

+ +

These should not, because they occur within a code block:

+ +
Backslash: \\
+
+Backtick: \`
+
+Asterisk: \*
+
+Underscore: \_
+
+Left brace: \{
+
+Right brace: \}
+
+Left bracket: \[
+
+Right bracket: \]
+
+Left paren: \(
+
+Right paren: \)
+
+Greater-than: \>
+
+Hash: \#
+
+Period: \.
+
+Bang: \!
+
+Plus: \+
+
+Minus: \-
+
+ +

Nor should these, which occur in code spans:

+ +

Backslash: \\

+ +

Backtick: \`

+ +

Asterisk: \*

+ +

Underscore: \_

+ +

Left brace: \{

+ +

Right brace: \}

+ +

Left bracket: \[

+ +

Right bracket: \]

+ +

Left paren: \(

+ +

Right paren: \)

+ +

Greater-than: \>

+ +

Hash: \#

+ +

Period: \.

+ +

Bang: \!

+ +

Plus: \+

+ +

Minus: \-

+ + +

These should get escaped, even though they're matching pairs for +other Markdown constructs:

+ +

*asterisks*

+ +

_underscores_

+ +

`backticks`

+ +

This is a code span with a literal backslash-backtick sequence: \`

+ +

This is a tag with unescaped backticks bar.

+ +

This is a tag with backslashes bar.

diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Backslash escapes.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Backslash escapes.text new file mode 100644 index 000000000..5b014cb33 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Backslash escapes.text @@ -0,0 +1,120 @@ +These should all get escaped: + +Backslash: \\ + +Backtick: \` + +Asterisk: \* + +Underscore: \_ + +Left brace: \{ + +Right brace: \} + +Left bracket: \[ + +Right bracket: \] + +Left paren: \( + +Right paren: \) + +Greater-than: \> + +Hash: \# + +Period: \. + +Bang: \! + +Plus: \+ + +Minus: \- + + + +These should not, because they occur within a code block: + + Backslash: \\ + + Backtick: \` + + Asterisk: \* + + Underscore: \_ + + Left brace: \{ + + Right brace: \} + + Left bracket: \[ + + Right bracket: \] + + Left paren: \( + + Right paren: \) + + Greater-than: \> + + Hash: \# + + Period: \. + + Bang: \! + + Plus: \+ + + Minus: \- + + +Nor should these, which occur in code spans: + +Backslash: `\\` + +Backtick: `` \` `` + +Asterisk: `\*` + +Underscore: `\_` + +Left brace: `\{` + +Right brace: `\}` + +Left bracket: `\[` + +Right bracket: `\]` + +Left paren: `\(` + +Right paren: `\)` + +Greater-than: `\>` + +Hash: `\#` + +Period: `\.` + +Bang: `\!` + +Plus: `\+` + +Minus: `\-` + + +These should get escaped, even though they're matching pairs for +other Markdown constructs: + +\*asterisks\* + +\_underscores\_ + +\`backticks\` + +This is a code span with a literal backslash-backtick sequence: `` \` `` + +This is a tag with unescaped backticks bar. + +This is a tag with backslashes bar. diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Blockquotes with code blocks.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Blockquotes with code blocks.html new file mode 100644 index 000000000..990202a1b --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Blockquotes with code blocks.html @@ -0,0 +1,15 @@ +
+

Example:

+ +
sub status {
+    print "working";
+}
+
+ +

Or:

+ +
sub status {
+    return "working";
+}
+
+
diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Blockquotes with code blocks.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Blockquotes with code blocks.text new file mode 100644 index 000000000..c31d17104 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Blockquotes with code blocks.text @@ -0,0 +1,11 @@ +> Example: +> +> sub status { +> print "working"; +> } +> +> Or: +> +> sub status { +> return "working"; +> } diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Code Blocks.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Code Blocks.html new file mode 100644 index 000000000..32703f5cb --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Code Blocks.html @@ -0,0 +1,18 @@ +
code block on the first line
+
+ +

Regular text.

+ +
code block indented by spaces
+
+ +

Regular text.

+ +
the lines in this block  
+all contain trailing spaces  
+
+ +

Regular Text.

+ +
code block on the last line
+
diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Code Blocks.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Code Blocks.text new file mode 100644 index 000000000..b54b09285 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Code Blocks.text @@ -0,0 +1,14 @@ + code block on the first line + +Regular text. + + code block indented by spaces + +Regular text. + + the lines in this block + all contain trailing spaces + +Regular Text. + + code block on the last line \ No newline at end of file diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Code Spans.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Code Spans.html new file mode 100644 index 000000000..4b8afbb70 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Code Spans.html @@ -0,0 +1,6 @@ +

<test a=" content of attribute ">

+ +

Fix for backticks within HTML tag: like this

+ +

Here's how you put `backticks` in a code span.

+ diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Code Spans.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Code Spans.text new file mode 100644 index 000000000..750a1973d --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Code Spans.text @@ -0,0 +1,6 @@ +`` + +Fix for backticks within HTML tag: like this + +Here's how you put `` `backticks` `` in a code span. + diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Hard-wrapped paragraphs with list-like lines.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Hard-wrapped paragraphs with list-like lines.html new file mode 100644 index 000000000..e21ac79a2 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Hard-wrapped paragraphs with list-like lines.html @@ -0,0 +1,8 @@ +

In Markdown 1.0.0 and earlier. Version +8. This line turns into a list item. +Because a hard-wrapped line in the +middle of a paragraph looked like a +list item.

+ +

Here's one with a bullet. +* criminey.

diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Hard-wrapped paragraphs with list-like lines.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Hard-wrapped paragraphs with list-like lines.text new file mode 100644 index 000000000..f8a5b27bf --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Hard-wrapped paragraphs with list-like lines.text @@ -0,0 +1,8 @@ +In Markdown 1.0.0 and earlier. Version +8. This line turns into a list item. +Because a hard-wrapped line in the +middle of a paragraph looked like a +list item. + +Here's one with a bullet. +* criminey. diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Horizontal rules.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Horizontal rules.html new file mode 100644 index 000000000..2dc2ab656 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Horizontal rules.html @@ -0,0 +1,71 @@ +

Dashes:

+ +
+ +
+ +
+ +
+ +
---
+
+ +
+ +
+ +
+ +
+ +
- - -
+
+ +

Asterisks:

+ +
+ +
+ +
+ +
+ +
***
+
+ +
+ +
+ +
+ +
+ +
* * *
+
+ +

Underscores:

+ +
+ +
+ +
+ +
+ +
___
+
+ +
+ +
+ +
+ +
+ +
_ _ _
+
diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Horizontal rules.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Horizontal rules.text new file mode 100644 index 000000000..1594bda27 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Horizontal rules.text @@ -0,0 +1,67 @@ +Dashes: + +--- + + --- + + --- + + --- + + --- + +- - - + + - - - + + - - - + + - - - + + - - - + + +Asterisks: + +*** + + *** + + *** + + *** + + *** + +* * * + + * * * + + * * * + + * * * + + * * * + + +Underscores: + +___ + + ___ + + ___ + + ___ + + ___ + +_ _ _ + + _ _ _ + + _ _ _ + + _ _ _ + + _ _ _ diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML (Advanced).html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML (Advanced).html new file mode 100644 index 000000000..3af9cafb1 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML (Advanced).html @@ -0,0 +1,15 @@ +

Simple block on one line:

+ +
foo
+ +

And nested without indentation:

+ +
+
+
+foo +
+
+
+
bar
+
diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML (Advanced).text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML (Advanced).text new file mode 100644 index 000000000..86b7206d2 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML (Advanced).text @@ -0,0 +1,15 @@ +Simple block on one line: + +
foo
+ +And nested without indentation: + +
+
+
+foo +
+
+
+
bar
+
diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML (Simple).html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML (Simple).html new file mode 100644 index 000000000..6bf78f8fc --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML (Simple).html @@ -0,0 +1,72 @@ +

Here's a simple block:

+ +
+ foo +
+ +

This should be a code block, though:

+ +
<div>
+    foo
+</div>
+
+ +

As should this:

+ +
<div>foo</div>
+
+ +

Now, nested:

+ +
+
+
+ foo +
+
+
+ +

This should just be an HTML comment:

+ + + +

Multiline:

+ + + +

Code block:

+ +
<!-- Comment -->
+
+ +

Just plain comment, with trailing spaces on the line:

+ + + +

Code:

+ +
<hr />
+
+ +

Hr's:

+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML (Simple).text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML (Simple).text new file mode 100644 index 000000000..14aa2dc27 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML (Simple).text @@ -0,0 +1,69 @@ +Here's a simple block: + +
+ foo +
+ +This should be a code block, though: + +
+ foo +
+ +As should this: + +
foo
+ +Now, nested: + +
+
+
+ foo +
+
+
+ +This should just be an HTML comment: + + + +Multiline: + + + +Code block: + + + +Just plain comment, with trailing spaces on the line: + + + +Code: + +
+ +Hr's: + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML comments.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML comments.html new file mode 100644 index 000000000..3f167a161 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML comments.html @@ -0,0 +1,13 @@ +

Paragraph one.

+ + + + + +

Paragraph two.

+ + + +

The end.

diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML comments.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML comments.text new file mode 100644 index 000000000..41d830d03 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Inline HTML comments.text @@ -0,0 +1,13 @@ +Paragraph one. + + + + + +Paragraph two. + + + +The end. diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, inline style.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, inline style.html new file mode 100644 index 000000000..f36607ddd --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, inline style.html @@ -0,0 +1,11 @@ +

Just a URL.

+ +

URL and title.

+ +

URL and title.

+ +

URL and title.

+ +

URL and title.

+ +

Empty.

diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, inline style.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, inline style.text new file mode 100644 index 000000000..09017a90c --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, inline style.text @@ -0,0 +1,12 @@ +Just a [URL](/url/). + +[URL and title](/url/ "title"). + +[URL and title](/url/ "title preceded by two spaces"). + +[URL and title](/url/ "title preceded by a tab"). + +[URL and title](/url/ "title has spaces afterward" ). + + +[Empty](). diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, reference style.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, reference style.html new file mode 100644 index 000000000..8e70c32f4 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, reference style.html @@ -0,0 +1,52 @@ +

Foo bar.

+ +

Foo bar.

+ +

Foo bar.

+ +

With embedded [brackets].

+ +

Indented once.

+ +

Indented twice.

+ +

Indented thrice.

+ +

Indented [four][] times.

+ +
[four]: /url
+
+ +
+ +

this should work

+ +

So should this.

+ +

And this.

+ +

And this.

+ +

And this.

+ +

But not [that] [].

+ +

Nor [that][].

+ +

Nor [that].

+ +

[Something in brackets like this should work]

+ +

[Same with this.]

+ +

In this case, this points to something else.

+ +

Backslashing should suppress [this] and [this].

+ +
+ +

Here's one where the link +breaks across lines.

+ +

Here's another where the link +breaks across lines, but with a line-ending space.

diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, reference style.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, reference style.text new file mode 100644 index 000000000..341ec88e3 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, reference style.text @@ -0,0 +1,71 @@ +Foo [bar] [1]. + +Foo [bar][1]. + +Foo [bar] +[1]. + +[1]: /url/ "Title" + + +With [embedded [brackets]] [b]. + + +Indented [once][]. + +Indented [twice][]. + +Indented [thrice][]. + +Indented [four][] times. + + [once]: /url + + [twice]: /url + + [thrice]: /url + + [four]: /url + + +[b]: /url/ + +* * * + +[this] [this] should work + +So should [this][this]. + +And [this] []. + +And [this][]. + +And [this]. + +But not [that] []. + +Nor [that][]. + +Nor [that]. + +[Something in brackets like [this][] should work] + +[Same with [this].] + +In this case, [this](/somethingelse/) points to something else. + +Backslashing should suppress \[this] and [this\]. + +[this]: foo + + +* * * + +Here's one where the [link +breaks] across lines. + +Here's another where the [link +breaks] across lines, but with a line-ending space. + + +[link breaks]: /url/ diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, shortcut references.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, shortcut references.html new file mode 100644 index 000000000..bf81e939f --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, shortcut references.html @@ -0,0 +1,9 @@ +

This is the simple case.

+ +

This one has a line +break.

+ +

This one has a line +break with a line-ending space.

+ +

this and the other

diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, shortcut references.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, shortcut references.text new file mode 100644 index 000000000..8c44c98fe --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Links, shortcut references.text @@ -0,0 +1,20 @@ +This is the [simple case]. + +[simple case]: /simple + + + +This one has a [line +break]. + +This one has a [line +break] with a line-ending space. + +[line break]: /foo + + +[this] [that] and the [other] + +[this]: /this +[that]: /that +[other]: /other diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Literal quotes in titles.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Literal quotes in titles.html new file mode 100644 index 000000000..611c1ac61 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Literal quotes in titles.html @@ -0,0 +1,3 @@ +

Foo bar.

+ +

Foo bar.

diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Literal quotes in titles.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Literal quotes in titles.text new file mode 100644 index 000000000..29d0e4235 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Literal quotes in titles.text @@ -0,0 +1,7 @@ +Foo [bar][]. + +Foo [bar](/url/ "Title with "quotes" inside"). + + + [bar]: /url/ "Title with "quotes" inside" + diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Markdown Documentation - Basics.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Markdown Documentation - Basics.html new file mode 100644 index 000000000..d5bdbb29a --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Markdown Documentation - Basics.html @@ -0,0 +1,314 @@ +

Markdown: Basics

+ + + +

Getting the Gist of Markdown's Formatting Syntax

+ +

This page offers a brief overview of what it's like to use Markdown. +The syntax page provides complete, detailed documentation for +every feature, but Markdown should be very easy to pick up simply by +looking at a few examples of it in action. The examples on this page +are written in a before/after style, showing example syntax and the +HTML output produced by Markdown.

+ +

It's also helpful to simply try Markdown out; the Dingus is a +web application that allows you type your own Markdown-formatted text +and translate it to XHTML.

+ +

Note: This document is itself written using Markdown; you +can see the source for it by adding '.text' to the URL.

+ +

Paragraphs, Headers, Blockquotes

+ +

A paragraph is simply one or more consecutive lines of text, separated +by one or more blank lines. (A blank line is any line that looks like a +blank line -- a line containing nothing spaces or tabs is considered +blank.) Normal paragraphs should not be intended with spaces or tabs.

+ +

Markdown offers two styles of headers: Setext and atx. +Setext-style headers for <h1> and <h2> are created by +"underlining" with equal signs (=) and hyphens (-), respectively. +To create an atx-style header, you put 1-6 hash marks (#) at the +beginning of the line -- the number of hashes equals the resulting +HTML header level.

+ +

Blockquotes are indicated using email-style '>' angle brackets.

+ +

Markdown:

+ +
A First Level Header
+====================
+
+A Second Level Header
+---------------------
+
+Now is the time for all good men to come to
+the aid of their country. This is just a
+regular paragraph.
+
+The quick brown fox jumped over the lazy
+dog's back.
+
+### Header 3
+
+> This is a blockquote.
+> 
+> This is the second paragraph in the blockquote.
+>
+> ## This is an H2 in a blockquote
+
+ +

Output:

+ +
<h1>A First Level Header</h1>
+
+<h2>A Second Level Header</h2>
+
+<p>Now is the time for all good men to come to
+the aid of their country. This is just a
+regular paragraph.</p>
+
+<p>The quick brown fox jumped over the lazy
+dog's back.</p>
+
+<h3>Header 3</h3>
+
+<blockquote>
+    <p>This is a blockquote.</p>
+
+    <p>This is the second paragraph in the blockquote.</p>
+
+    <h2>This is an H2 in a blockquote</h2>
+</blockquote>
+
+ +

Phrase Emphasis

+ +

Markdown uses asterisks and underscores to indicate spans of emphasis.

+ +

Markdown:

+ +
Some of these words *are emphasized*.
+Some of these words _are emphasized also_.
+
+Use two asterisks for **strong emphasis**.
+Or, if you prefer, __use two underscores instead__.
+
+ +

Output:

+ +
<p>Some of these words <em>are emphasized</em>.
+Some of these words <em>are emphasized also</em>.</p>
+
+<p>Use two asterisks for <strong>strong emphasis</strong>.
+Or, if you prefer, <strong>use two underscores instead</strong>.</p>
+
+ +

Lists

+ +

Unordered (bulleted) lists use asterisks, pluses, and hyphens (*, ++, and -) as list markers. These three markers are +interchangable; this:

+ +
*   Candy.
+*   Gum.
+*   Booze.
+
+ +

this:

+ +
+   Candy.
++   Gum.
++   Booze.
+
+ +

and this:

+ +
-   Candy.
+-   Gum.
+-   Booze.
+
+ +

all produce the same output:

+ +
<ul>
+<li>Candy.</li>
+<li>Gum.</li>
+<li>Booze.</li>
+</ul>
+
+ +

Ordered (numbered) lists use regular numbers, followed by periods, as +list markers:

+ +
1.  Red
+2.  Green
+3.  Blue
+
+ +

Output:

+ +
<ol>
+<li>Red</li>
+<li>Green</li>
+<li>Blue</li>
+</ol>
+
+ +

If you put blank lines between items, you'll get <p> tags for the +list item text. You can create multi-paragraph list items by indenting +the paragraphs by 4 spaces or 1 tab:

+ +
*   A list item.
+
+    With multiple paragraphs.
+
+*   Another item in the list.
+
+ +

Output:

+ +
<ul>
+<li><p>A list item.</p>
+<p>With multiple paragraphs.</p></li>
+<li><p>Another item in the list.</p></li>
+</ul>
+
+ +

Links

+ +

Markdown supports two styles for creating links: inline and +reference. With both styles, you use square brackets to delimit the +text you want to turn into a link.

+ +

Inline-style links use parentheses immediately after the link text. +For example:

+ +
This is an [example link](http://example.com/).
+
+ +

Output:

+ +
<p>This is an <a href="http://example.com/">
+example link</a>.</p>
+
+ +

Optionally, you may include a title attribute in the parentheses:

+ +
This is an [example link](http://example.com/ "With a Title").
+
+ +

Output:

+ +
<p>This is an <a href="http://example.com/" title="With a Title">
+example link</a>.</p>
+
+ +

Reference-style links allow you to refer to your links by names, which +you define elsewhere in your document:

+ +
I get 10 times more traffic from [Google][1] than from
+[Yahoo][2] or [MSN][3].
+
+[1]: http://google.com/        "Google"
+[2]: http://search.yahoo.com/  "Yahoo Search"
+[3]: http://search.msn.com/    "MSN Search"
+
+ +

Output:

+ +
<p>I get 10 times more traffic from <a href="http://google.com/"
+title="Google">Google</a> than from <a href="http://search.yahoo.com/"
+title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/"
+title="MSN Search">MSN</a>.</p>
+
+ +

The title attribute is optional. Link names may contain letters, +numbers and spaces, but are not case sensitive:

+ +
I start my morning with a cup of coffee and
+[The New York Times][NY Times].
+
+[ny times]: http://www.nytimes.com/
+
+ +

Output:

+ +
<p>I start my morning with a cup of coffee and
+<a href="http://www.nytimes.com/">The New York Times</a>.</p>
+
+ +

Images

+ +

Image syntax is very much like link syntax.

+ +

Inline (titles are optional):

+ +
![alt text](/path/to/img.jpg "Title")
+
+ +

Reference-style:

+ +
![alt text][id]
+
+[id]: /path/to/img.jpg "Title"
+
+ +

Both of the above examples produce the same output:

+ +
<img src="/path/to/img.jpg" alt="alt text" title="Title" />
+
+ +

Code

+ +

In a regular paragraph, you can create code span by wrapping text in +backtick quotes. Any ampersands (&) and angle brackets (< or +>) will automatically be translated into HTML entities. This makes +it easy to use Markdown to write about HTML example code:

+ +
I strongly recommend against using any `<blink>` tags.
+
+I wish SmartyPants used named entities like `&mdash;`
+instead of decimal-encoded entites like `&#8212;`.
+
+ +

Output:

+ +
<p>I strongly recommend against using any
+<code>&lt;blink&gt;</code> tags.</p>
+
+<p>I wish SmartyPants used named entities like
+<code>&amp;mdash;</code> instead of decimal-encoded
+entites like <code>&amp;#8212;</code>.</p>
+
+ +

To specify an entire block of pre-formatted code, indent every line of +the block by 4 spaces or 1 tab. Just like with code spans, &, <, +and > characters will be escaped automatically.

+ +

Markdown:

+ +
If you want your page to validate under XHTML 1.0 Strict,
+you've got to put paragraph tags in your blockquotes:
+
+    <blockquote>
+        <p>For example.</p>
+    </blockquote>
+
+ +

Output:

+ +
<p>If you want your page to validate under XHTML 1.0 Strict,
+you've got to put paragraph tags in your blockquotes:</p>
+
+<pre><code>&lt;blockquote&gt;
+    &lt;p&gt;For example.&lt;/p&gt;
+&lt;/blockquote&gt;
+</code></pre>
+
diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Markdown Documentation - Basics.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Markdown Documentation - Basics.text new file mode 100644 index 000000000..486055ca7 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Markdown Documentation - Basics.text @@ -0,0 +1,306 @@ +Markdown: Basics +================ + + + + +Getting the Gist of Markdown's Formatting Syntax +------------------------------------------------ + +This page offers a brief overview of what it's like to use Markdown. +The [syntax page] [s] provides complete, detailed documentation for +every feature, but Markdown should be very easy to pick up simply by +looking at a few examples of it in action. The examples on this page +are written in a before/after style, showing example syntax and the +HTML output produced by Markdown. + +It's also helpful to simply try Markdown out; the [Dingus] [d] is a +web application that allows you type your own Markdown-formatted text +and translate it to XHTML. + +**Note:** This document is itself written using Markdown; you +can [see the source for it by adding '.text' to the URL] [src]. + + [s]: /projects/markdown/syntax "Markdown Syntax" + [d]: /projects/markdown/dingus "Markdown Dingus" + [src]: /projects/markdown/basics.text + + +## Paragraphs, Headers, Blockquotes ## + +A paragraph is simply one or more consecutive lines of text, separated +by one or more blank lines. (A blank line is any line that looks like a +blank line -- a line containing nothing spaces or tabs is considered +blank.) Normal paragraphs should not be intended with spaces or tabs. + +Markdown offers two styles of headers: *Setext* and *atx*. +Setext-style headers for `

` and `

` are created by +"underlining" with equal signs (`=`) and hyphens (`-`), respectively. +To create an atx-style header, you put 1-6 hash marks (`#`) at the +beginning of the line -- the number of hashes equals the resulting +HTML header level. + +Blockquotes are indicated using email-style '`>`' angle brackets. + +Markdown: + + A First Level Header + ==================== + + A Second Level Header + --------------------- + + Now is the time for all good men to come to + the aid of their country. This is just a + regular paragraph. + + The quick brown fox jumped over the lazy + dog's back. + + ### Header 3 + + > This is a blockquote. + > + > This is the second paragraph in the blockquote. + > + > ## This is an H2 in a blockquote + + +Output: + +

A First Level Header

+ +

A Second Level Header

+ +

Now is the time for all good men to come to + the aid of their country. This is just a + regular paragraph.

+ +

The quick brown fox jumped over the lazy + dog's back.

+ +

Header 3

+ +
+

This is a blockquote.

+ +

This is the second paragraph in the blockquote.

+ +

This is an H2 in a blockquote

+
+ + + +### Phrase Emphasis ### + +Markdown uses asterisks and underscores to indicate spans of emphasis. + +Markdown: + + Some of these words *are emphasized*. + Some of these words _are emphasized also_. + + Use two asterisks for **strong emphasis**. + Or, if you prefer, __use two underscores instead__. + +Output: + +

Some of these words are emphasized. + Some of these words are emphasized also.

+ +

Use two asterisks for strong emphasis. + Or, if you prefer, use two underscores instead.

+ + + +## Lists ## + +Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`, +`+`, and `-`) as list markers. These three markers are +interchangable; this: + + * Candy. + * Gum. + * Booze. + +this: + + + Candy. + + Gum. + + Booze. + +and this: + + - Candy. + - Gum. + - Booze. + +all produce the same output: + +
    +
  • Candy.
  • +
  • Gum.
  • +
  • Booze.
  • +
+ +Ordered (numbered) lists use regular numbers, followed by periods, as +list markers: + + 1. Red + 2. Green + 3. Blue + +Output: + +
    +
  1. Red
  2. +
  3. Green
  4. +
  5. Blue
  6. +
+ +If you put blank lines between items, you'll get `

` tags for the +list item text. You can create multi-paragraph list items by indenting +the paragraphs by 4 spaces or 1 tab: + + * A list item. + + With multiple paragraphs. + + * Another item in the list. + +Output: + +

    +
  • A list item.

    +

    With multiple paragraphs.

  • +
  • Another item in the list.

  • +
+ + + +### Links ### + +Markdown supports two styles for creating links: *inline* and +*reference*. With both styles, you use square brackets to delimit the +text you want to turn into a link. + +Inline-style links use parentheses immediately after the link text. +For example: + + This is an [example link](http://example.com/). + +Output: + +

This is an + example link.

+ +Optionally, you may include a title attribute in the parentheses: + + This is an [example link](http://example.com/ "With a Title"). + +Output: + +

This is an + example link.

+ +Reference-style links allow you to refer to your links by names, which +you define elsewhere in your document: + + I get 10 times more traffic from [Google][1] than from + [Yahoo][2] or [MSN][3]. + + [1]: http://google.com/ "Google" + [2]: http://search.yahoo.com/ "Yahoo Search" + [3]: http://search.msn.com/ "MSN Search" + +Output: + +

I get 10 times more traffic from Google than from Yahoo or MSN.

+ +The title attribute is optional. Link names may contain letters, +numbers and spaces, but are *not* case sensitive: + + I start my morning with a cup of coffee and + [The New York Times][NY Times]. + + [ny times]: http://www.nytimes.com/ + +Output: + +

I start my morning with a cup of coffee and + The New York Times.

+ + +### Images ### + +Image syntax is very much like link syntax. + +Inline (titles are optional): + + ![alt text](/path/to/img.jpg "Title") + +Reference-style: + + ![alt text][id] + + [id]: /path/to/img.jpg "Title" + +Both of the above examples produce the same output: + + alt text + + + +### Code ### + +In a regular paragraph, you can create code span by wrapping text in +backtick quotes. Any ampersands (`&`) and angle brackets (`<` or +`>`) will automatically be translated into HTML entities. This makes +it easy to use Markdown to write about HTML example code: + + I strongly recommend against using any `` tags. + + I wish SmartyPants used named entities like `—` + instead of decimal-encoded entites like `—`. + +Output: + +

I strongly recommend against using any + <blink> tags.

+ +

I wish SmartyPants used named entities like + &mdash; instead of decimal-encoded + entites like &#8212;.

+ + +To specify an entire block of pre-formatted code, indent every line of +the block by 4 spaces or 1 tab. Just like with code spans, `&`, `<`, +and `>` characters will be escaped automatically. + +Markdown: + + If you want your page to validate under XHTML 1.0 Strict, + you've got to put paragraph tags in your blockquotes: + +
+

For example.

+
+ +Output: + +

If you want your page to validate under XHTML 1.0 Strict, + you've got to put paragraph tags in your blockquotes:

+ +
<blockquote>
+        <p>For example.</p>
+    </blockquote>
+    
diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Markdown Documentation - Syntax.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Markdown Documentation - Syntax.html new file mode 100644 index 000000000..5c01306cc --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Markdown Documentation - Syntax.html @@ -0,0 +1,942 @@ +

Markdown: Syntax

+ + + + + +

Note: This document is itself written using Markdown; you +can see the source for it by adding '.text' to the URL.

+ +
+ +

Overview

+ +

Philosophy

+ +

Markdown is intended to be as easy-to-read and easy-to-write as is feasible.

+ +

Readability, however, is emphasized above all else. A Markdown-formatted +document should be publishable as-is, as plain text, without looking +like it's been marked up with tags or formatting instructions. While +Markdown's syntax has been influenced by several existing text-to-HTML +filters -- including Setext, atx, Textile, reStructuredText, +Grutatext, and EtText -- the single biggest source of +inspiration for Markdown's syntax is the format of plain text email.

+ +

To this end, Markdown's syntax is comprised entirely of punctuation +characters, which punctuation characters have been carefully chosen so +as to look like what they mean. E.g., asterisks around a word actually +look like *emphasis*. Markdown lists look like, well, lists. Even +blockquotes look like quoted passages of text, assuming you've ever +used email.

+ +

Inline HTML

+ +

Markdown's syntax is intended for one purpose: to be used as a +format for writing for the web.

+ +

Markdown is not a replacement for HTML, or even close to it. Its +syntax is very small, corresponding only to a very small subset of +HTML tags. The idea is not to create a syntax that makes it easier +to insert HTML tags. In my opinion, HTML tags are already easy to +insert. The idea for Markdown is to make it easy to read, write, and +edit prose. HTML is a publishing format; Markdown is a writing +format. Thus, Markdown's formatting syntax only addresses issues that +can be conveyed in plain text.

+ +

For any markup that is not covered by Markdown's syntax, you simply +use HTML itself. There's no need to preface it or delimit it to +indicate that you're switching from Markdown to HTML; you just use +the tags.

+ +

The only restrictions are that block-level HTML elements -- e.g. <div>, +<table>, <pre>, <p>, etc. -- must be separated from surrounding +content by blank lines, and the start and end tags of the block should +not be indented with tabs or spaces. Markdown is smart enough not +to add extra (unwanted) <p> tags around HTML block-level tags.

+ +

For example, to add an HTML table to a Markdown article:

+ +
This is a regular paragraph.
+
+<table>
+    <tr>
+        <td>Foo</td>
+    </tr>
+</table>
+
+This is another regular paragraph.
+
+ +

Note that Markdown formatting syntax is not processed within block-level +HTML tags. E.g., you can't use Markdown-style *emphasis* inside an +HTML block.

+ +

Span-level HTML tags -- e.g. <span>, <cite>, or <del> -- can be +used anywhere in a Markdown paragraph, list item, or header. If you +want, you can even use HTML tags instead of Markdown formatting; e.g. if +you'd prefer to use HTML <a> or <img> tags instead of Markdown's +link or image syntax, go right ahead.

+ +

Unlike block-level HTML tags, Markdown syntax is processed within +span-level tags.

+ +

Automatic Escaping for Special Characters

+ +

In HTML, there are two characters that demand special treatment: < +and &. Left angle brackets are used to start tags; ampersands are +used to denote HTML entities. If you want to use them as literal +characters, you must escape them as entities, e.g. &lt;, and +&amp;.

+ +

Ampersands in particular are bedeviling for web writers. If you want to +write about 'AT&T', you need to write 'AT&amp;T'. You even need to +escape ampersands within URLs. Thus, if you want to link to:

+ +
http://images.google.com/images?num=30&q=larry+bird
+
+ +

you need to encode the URL as:

+ +
http://images.google.com/images?num=30&amp;q=larry+bird
+
+ +

in your anchor tag href attribute. Needless to say, this is easy to +forget, and is probably the single most common source of HTML validation +errors in otherwise well-marked-up web sites.

+ +

Markdown allows you to use these characters naturally, taking care of +all the necessary escaping for you. If you use an ampersand as part of +an HTML entity, it remains unchanged; otherwise it will be translated +into &amp;.

+ +

So, if you want to include a copyright symbol in your article, you can write:

+ +
&copy;
+
+ +

and Markdown will leave it alone. But if you write:

+ +
AT&T
+
+ +

Markdown will translate it to:

+ +
AT&amp;T
+
+ +

Similarly, because Markdown supports inline HTML, if you use +angle brackets as delimiters for HTML tags, Markdown will treat them as +such. But if you write:

+ +
4 < 5
+
+ +

Markdown will translate it to:

+ +
4 &lt; 5
+
+ +

However, inside Markdown code spans and blocks, angle brackets and +ampersands are always encoded automatically. This makes it easy to use +Markdown to write about HTML code. (As opposed to raw HTML, which is a +terrible format for writing about HTML syntax, because every single < +and & in your example code needs to be escaped.)

+ +
+ +

Block Elements

+ +

Paragraphs and Line Breaks

+ +

A paragraph is simply one or more consecutive lines of text, separated +by one or more blank lines. (A blank line is any line that looks like a +blank line -- a line containing nothing but spaces or tabs is considered +blank.) Normal paragraphs should not be intended with spaces or tabs.

+ +

The implication of the "one or more consecutive lines of text" rule is +that Markdown supports "hard-wrapped" text paragraphs. This differs +significantly from most other text-to-HTML formatters (including Movable +Type's "Convert Line Breaks" option) which translate every line break +character in a paragraph into a <br /> tag.

+ +

When you do want to insert a <br /> break tag using Markdown, you +end a line with two or more spaces, then type return.

+ +

Yes, this takes a tad more effort to create a <br />, but a simplistic +"every line break is a <br />" rule wouldn't work for Markdown. +Markdown's email-style blockquoting and multi-paragraph list items +work best -- and look better -- when you format them with hard breaks.

+ + + +

Markdown supports two styles of headers, Setext and atx.

+ +

Setext-style headers are "underlined" using equal signs (for first-level +headers) and dashes (for second-level headers). For example:

+ +
This is an H1
+=============
+
+This is an H2
+-------------
+
+ +

Any number of underlining ='s or -'s will work.

+ +

Atx-style headers use 1-6 hash characters at the start of the line, +corresponding to header levels 1-6. For example:

+ +
# This is an H1
+
+## This is an H2
+
+###### This is an H6
+
+ +

Optionally, you may "close" atx-style headers. This is purely +cosmetic -- you can use this if you think it looks better. The +closing hashes don't even need to match the number of hashes +used to open the header. (The number of opening hashes +determines the header level.) :

+ +
# This is an H1 #
+
+## This is an H2 ##
+
+### This is an H3 ######
+
+ +

Blockquotes

+ +

Markdown uses email-style > characters for blockquoting. If you're +familiar with quoting passages of text in an email message, then you +know how to create a blockquote in Markdown. It looks best if you hard +wrap the text and put a > before every line:

+ +
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
+> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
+> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
+> 
+> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
+> id sem consectetuer libero luctus adipiscing.
+
+ +

Markdown allows you to be lazy and only put the > before the first +line of a hard-wrapped paragraph:

+ +
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
+consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
+Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
+
+> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
+id sem consectetuer libero luctus adipiscing.
+
+ +

Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by +adding additional levels of >:

+ +
> This is the first level of quoting.
+>
+> > This is nested blockquote.
+>
+> Back to the first level.
+
+ +

Blockquotes can contain other Markdown elements, including headers, lists, +and code blocks:

+ +
> ## This is a header.
+> 
+> 1.   This is the first list item.
+> 2.   This is the second list item.
+> 
+> Here's some example code:
+> 
+>     return shell_exec("echo $input | $markdown_script");
+
+ +

Any decent text editor should make email-style quoting easy. For +example, with BBEdit, you can make a selection and choose Increase +Quote Level from the Text menu.

+ +

Lists

+ +

Markdown supports ordered (numbered) and unordered (bulleted) lists.

+ +

Unordered lists use asterisks, pluses, and hyphens -- interchangably +-- as list markers:

+ +
*   Red
+*   Green
+*   Blue
+
+ +

is equivalent to:

+ +
+   Red
++   Green
++   Blue
+
+ +

and:

+ +
-   Red
+-   Green
+-   Blue
+
+ +

Ordered lists use numbers followed by periods:

+ +
1.  Bird
+2.  McHale
+3.  Parish
+
+ +

It's important to note that the actual numbers you use to mark the +list have no effect on the HTML output Markdown produces. The HTML +Markdown produces from the above list is:

+ +
<ol>
+<li>Bird</li>
+<li>McHale</li>
+<li>Parish</li>
+</ol>
+
+ +

If you instead wrote the list in Markdown like this:

+ +
1.  Bird
+1.  McHale
+1.  Parish
+
+ +

or even:

+ +
3. Bird
+1. McHale
+8. Parish
+
+ +

you'd get the exact same HTML output. The point is, if you want to, +you can use ordinal numbers in your ordered Markdown lists, so that +the numbers in your source match the numbers in your published HTML. +But if you want to be lazy, you don't have to.

+ +

If you do use lazy list numbering, however, you should still start the +list with the number 1. At some point in the future, Markdown may support +starting ordered lists at an arbitrary number.

+ +

List markers typically start at the left margin, but may be indented by +up to three spaces. List markers must be followed by one or more spaces +or a tab.

+ +

To make lists look nice, you can wrap items with hanging indents:

+ +
*   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
+    Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
+    viverra nec, fringilla in, laoreet vitae, risus.
+*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
+    Suspendisse id sem consectetuer libero luctus adipiscing.
+
+ +

But if you want to be lazy, you don't have to:

+ +
*   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
+Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
+viverra nec, fringilla in, laoreet vitae, risus.
+*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
+Suspendisse id sem consectetuer libero luctus adipiscing.
+
+ +

If list items are separated by blank lines, Markdown will wrap the +items in <p> tags in the HTML output. For example, this input:

+ +
*   Bird
+*   Magic
+
+ +

will turn into:

+ +
<ul>
+<li>Bird</li>
+<li>Magic</li>
+</ul>
+
+ +

But this:

+ +
*   Bird
+
+*   Magic
+
+ +

will turn into:

+ +
<ul>
+<li><p>Bird</p></li>
+<li><p>Magic</p></li>
+</ul>
+
+ +

List items may consist of multiple paragraphs. Each subsequent +paragraph in a list item must be intended by either 4 spaces +or one tab:

+ +
1.  This is a list item with two paragraphs. Lorem ipsum dolor
+    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
+    mi posuere lectus.
+
+    Vestibulum enim wisi, viverra nec, fringilla in, laoreet
+    vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
+    sit amet velit.
+
+2.  Suspendisse id sem consectetuer libero luctus adipiscing.
+
+ +

It looks nice if you indent every line of the subsequent +paragraphs, but here again, Markdown will allow you to be +lazy:

+ +
*   This is a list item with two paragraphs.
+
+    This is the second paragraph in the list item. You're
+only required to indent the first line. Lorem ipsum dolor
+sit amet, consectetuer adipiscing elit.
+
+*   Another item in the same list.
+
+ +

To put a blockquote within a list item, the blockquote's > +delimiters need to be indented:

+ +
*   A list item with a blockquote:
+
+    > This is a blockquote
+    > inside a list item.
+
+ +

To put a code block within a list item, the code block needs +to be indented twice -- 8 spaces or two tabs:

+ +
*   A list item with a code block:
+
+        <code goes here>
+
+ +

It's worth noting that it's possible to trigger an ordered list by +accident, by writing something like this:

+ +
1986. What a great season.
+
+ +

In other words, a number-period-space sequence at the beginning of a +line. To avoid this, you can backslash-escape the period:

+ +
1986\. What a great season.
+
+ +

Code Blocks

+ +

Pre-formatted code blocks are used for writing about programming or +markup source code. Rather than forming normal paragraphs, the lines +of a code block are interpreted literally. Markdown wraps a code block +in both <pre> and <code> tags.

+ +

To produce a code block in Markdown, simply indent every line of the +block by at least 4 spaces or 1 tab. For example, given this input:

+ +
This is a normal paragraph:
+
+    This is a code block.
+
+ +

Markdown will generate:

+ +
<p>This is a normal paragraph:</p>
+
+<pre><code>This is a code block.
+</code></pre>
+
+ +

One level of indentation -- 4 spaces or 1 tab -- is removed from each +line of the code block. For example, this:

+ +
Here is an example of AppleScript:
+
+    tell application "Foo"
+        beep
+    end tell
+
+ +

will turn into:

+ +
<p>Here is an example of AppleScript:</p>
+
+<pre><code>tell application "Foo"
+    beep
+end tell
+</code></pre>
+
+ +

A code block continues until it reaches a line that is not indented +(or the end of the article).

+ +

Within a code block, ampersands (&) and angle brackets (< and >) +are automatically converted into HTML entities. This makes it very +easy to include example HTML source code using Markdown -- just paste +it and indent it, and Markdown will handle the hassle of encoding the +ampersands and angle brackets. For example, this:

+ +
    <div class="footer">
+        &copy; 2004 Foo Corporation
+    </div>
+
+ +

will turn into:

+ +
<pre><code>&lt;div class="footer"&gt;
+    &amp;copy; 2004 Foo Corporation
+&lt;/div&gt;
+</code></pre>
+
+ +

Regular Markdown syntax is not processed within code blocks. E.g., +asterisks are just literal asterisks within a code block. This means +it's also easy to use Markdown to write about Markdown's own syntax.

+ +

Horizontal Rules

+ +

You can produce a horizontal rule tag (<hr />) by placing three or +more hyphens, asterisks, or underscores on a line by themselves. If you +wish, you may use spaces between the hyphens or asterisks. Each of the +following lines will produce a horizontal rule:

+ +
* * *
+
+***
+
+*****
+
+- - -
+
+---------------------------------------
+
+_ _ _
+
+ +
+ +

Span Elements

+ + + +

Markdown supports two style of links: inline and reference.

+ +

In both styles, the link text is delimited by [square brackets].

+ +

To create an inline link, use a set of regular parentheses immediately +after the link text's closing square bracket. Inside the parentheses, +put the URL where you want the link to point, along with an optional +title for the link, surrounded in quotes. For example:

+ +
This is [an example](http://example.com/ "Title") inline link.
+
+[This link](http://example.net/) has no title attribute.
+
+ +

Will produce:

+ +
<p>This is <a href="http://example.com/" title="Title">
+an example</a> inline link.</p>
+
+<p><a href="http://example.net/">This link</a> has no
+title attribute.</p>
+
+ +

If you're referring to a local resource on the same server, you can +use relative paths:

+ +
See my [About](/about/) page for details.
+
+ +

Reference-style links use a second set of square brackets, inside +which you place a label of your choosing to identify the link:

+ +
This is [an example][id] reference-style link.
+
+ +

You can optionally use a space to separate the sets of brackets:

+ +
This is [an example] [id] reference-style link.
+
+ +

Then, anywhere in the document, you define your link label like this, +on a line by itself:

+ +
[id]: http://example.com/  "Optional Title Here"
+
+ +

That is:

+ +
    +
  • Square brackets containing the link identifier (optionally +indented from the left margin using up to three spaces);
  • +
  • followed by a colon;
  • +
  • followed by one or more spaces (or tabs);
  • +
  • followed by the URL for the link;
  • +
  • optionally followed by a title attribute for the link, enclosed +in double or single quotes.
  • +
+ +

The link URL may, optionally, be surrounded by angle brackets:

+ +
[id]: <http://example.com/>  "Optional Title Here"
+
+ +

You can put the title attribute on the next line and use extra spaces +or tabs for padding, which tends to look better with longer URLs:

+ +
[id]: http://example.com/longish/path/to/resource/here
+    "Optional Title Here"
+
+ +

Link definitions are only used for creating links during Markdown +processing, and are stripped from your document in the HTML output.

+ +

Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are not case sensitive. E.g. these two links:

+ +
[link text][a]
+[link text][A]
+
+ +

are equivalent.

+ +

The implicit link name shortcut allows you to omit the name of the +link, in which case the link text itself is used as the name. +Just use an empty set of square brackets -- e.g., to link the word +"Google" to the google.com web site, you could simply write:

+ +
[Google][]
+
+ +

And then define the link:

+ +
[Google]: http://google.com/
+
+ +

Because link names may contain spaces, this shortcut even works for +multiple words in the link text:

+ +
Visit [Daring Fireball][] for more information.
+
+ +

And then define the link:

+ +
[Daring Fireball]: http://daringfireball.net/
+
+ +

Link definitions can be placed anywhere in your Markdown document. I +tend to put them immediately after each paragraph in which they're +used, but if you want, you can put them all at the end of your +document, sort of like footnotes.

+ +

Here's an example of reference links in action:

+ +
I get 10 times more traffic from [Google] [1] than from
+[Yahoo] [2] or [MSN] [3].
+
+  [1]: http://google.com/        "Google"
+  [2]: http://search.yahoo.com/  "Yahoo Search"
+  [3]: http://search.msn.com/    "MSN Search"
+
+ +

Using the implicit link name shortcut, you could instead write:

+ +
I get 10 times more traffic from [Google][] than from
+[Yahoo][] or [MSN][].
+
+  [google]: http://google.com/        "Google"
+  [yahoo]:  http://search.yahoo.com/  "Yahoo Search"
+  [msn]:    http://search.msn.com/    "MSN Search"
+
+ +

Both of the above examples will produce the following HTML output:

+ +
<p>I get 10 times more traffic from <a href="http://google.com/"
+title="Google">Google</a> than from
+<a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a>
+or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
+
+ +

For comparison, here is the same paragraph written using +Markdown's inline link style:

+ +
I get 10 times more traffic from [Google](http://google.com/ "Google")
+than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
+[MSN](http://search.msn.com/ "MSN Search").
+
+ +

The point of reference-style links is not that they're easier to +write. The point is that with reference-style links, your document +source is vastly more readable. Compare the above examples: using +reference-style links, the paragraph itself is only 81 characters +long; with inline-style links, it's 176 characters; and as raw HTML, +it's 234 characters. In the raw HTML, there's more markup than there +is text.

+ +

With Markdown's reference-style links, a source document much more +closely resembles the final output, as rendered in a browser. By +allowing you to move the markup-related metadata out of the paragraph, +you can add links without interrupting the narrative flow of your +prose.

+ +

Emphasis

+ +

Markdown treats asterisks (*) and underscores (_) as indicators of +emphasis. Text wrapped with one * or _ will be wrapped with an +HTML <em> tag; double *'s or _'s will be wrapped with an HTML +<strong> tag. E.g., this input:

+ +
*single asterisks*
+
+_single underscores_
+
+**double asterisks**
+
+__double underscores__
+
+ +

will produce:

+ +
<em>single asterisks</em>
+
+<em>single underscores</em>
+
+<strong>double asterisks</strong>
+
+<strong>double underscores</strong>
+
+ +

You can use whichever style you prefer; the lone restriction is that +the same character must be used to open and close an emphasis span.

+ +

Emphasis can be used in the middle of a word:

+ +
un*fucking*believable
+
+ +

But if you surround an * or _ with spaces, it'll be treated as a +literal asterisk or underscore.

+ +

To produce a literal asterisk or underscore at a position where it +would otherwise be used as an emphasis delimiter, you can backslash +escape it:

+ +
\*this text is surrounded by literal asterisks\*
+
+ +

Code

+ +

To indicate a span of code, wrap it with backtick quotes (`). +Unlike a pre-formatted code block, a code span indicates code within a +normal paragraph. For example:

+ +
Use the `printf()` function.
+
+ +

will produce:

+ +
<p>Use the <code>printf()</code> function.</p>
+
+ +

To include a literal backtick character within a code span, you can use +multiple backticks as the opening and closing delimiters:

+ +
``There is a literal backtick (`) here.``
+
+ +

which will produce this:

+ +
<p><code>There is a literal backtick (`) here.</code></p>
+
+ +

The backtick delimiters surrounding a code span may include spaces -- +one after the opening, one before the closing. This allows you to place +literal backtick characters at the beginning or end of a code span:

+ +
A single backtick in a code span: `` ` ``
+
+A backtick-delimited string in a code span: `` `foo` ``
+
+ +

will produce:

+ +
<p>A single backtick in a code span: <code>`</code></p>
+
+<p>A backtick-delimited string in a code span: <code>`foo`</code></p>
+
+ +

With a code span, ampersands and angle brackets are encoded as HTML +entities automatically, which makes it easy to include example HTML +tags. Markdown will turn this:

+ +
Please don't use any `<blink>` tags.
+
+ +

into:

+ +
<p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>
+
+ +

You can write this:

+ +
`&#8212;` is the decimal-encoded equivalent of `&mdash;`.
+
+ +

to produce:

+ +
<p><code>&amp;#8212;</code> is the decimal-encoded
+equivalent of <code>&amp;mdash;</code>.</p>
+
+ +

Images

+ +

Admittedly, it's fairly difficult to devise a "natural" syntax for +placing images into a plain text document format.

+ +

Markdown uses an image syntax that is intended to resemble the syntax +for links, allowing for two styles: inline and reference.

+ +

Inline image syntax looks like this:

+ +
![Alt text](/path/to/img.jpg)
+
+![Alt text](/path/to/img.jpg "Optional title")
+
+ +

That is:

+ +
    +
  • An exclamation mark: !;
  • +
  • followed by a set of square brackets, containing the alt +attribute text for the image;
  • +
  • followed by a set of parentheses, containing the URL or path to +the image, and an optional title attribute enclosed in double +or single quotes.
  • +
+ +

Reference-style image syntax looks like this:

+ +
![Alt text][id]
+
+ +

Where "id" is the name of a defined image reference. Image references +are defined using syntax identical to link references:

+ +
[id]: url/to/image  "Optional title attribute"
+
+ +

As of this writing, Markdown has no syntax for specifying the +dimensions of an image; if this is important to you, you can simply +use regular HTML <img> tags.

+ +
+ +

Miscellaneous

+ + + +

Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:

+ +
<http://example.com/>
+
+ +

Markdown will turn this into:

+ +
<a href="http://example.com/">http://example.com/</a>
+
+ +

Automatic links for email addresses work similarly, except that +Markdown will also perform a bit of randomized decimal and hex +entity-encoding to help obscure your address from address-harvesting +spambots. For example, Markdown will turn this:

+ +
<address@example.com>
+
+ +

into something like this:

+ +
<a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65;
+&#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;
+&#109;">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61;
+&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;&#109;</a>
+
+ +

which will render in a browser as a clickable link to "address@example.com".

+ +

(This sort of entity-encoding trick will indeed fool many, if not +most, address-harvesting bots, but it definitely won't fool all of +them. It's better than nothing, but an address published in this way +will probably eventually start receiving spam.)

+ +

Backslash Escapes

+ +

Markdown allows you to use backslash escapes to generate literal +characters which would otherwise have special meaning in Markdown's +formatting syntax. For example, if you wanted to surround a word with +literal asterisks (instead of an HTML <em> tag), you can backslashes +before the asterisks, like this:

+ +
\*literal asterisks\*
+
+ +

Markdown provides backslash escapes for the following characters:

+ +
\   backslash
+`   backtick
+*   asterisk
+_   underscore
+{}  curly braces
+[]  square brackets
+()  parentheses
+#   hash mark
++   plus sign
+-   minus sign (hyphen)
+.   dot
+!   exclamation mark
+
diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Markdown Documentation - Syntax.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Markdown Documentation - Syntax.text new file mode 100644 index 000000000..57360a16c --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Markdown Documentation - Syntax.text @@ -0,0 +1,888 @@ +Markdown: Syntax +================ + + + + +* [Overview](#overview) + * [Philosophy](#philosophy) + * [Inline HTML](#html) + * [Automatic Escaping for Special Characters](#autoescape) +* [Block Elements](#block) + * [Paragraphs and Line Breaks](#p) + * [Headers](#header) + * [Blockquotes](#blockquote) + * [Lists](#list) + * [Code Blocks](#precode) + * [Horizontal Rules](#hr) +* [Span Elements](#span) + * [Links](#link) + * [Emphasis](#em) + * [Code](#code) + * [Images](#img) +* [Miscellaneous](#misc) + * [Backslash Escapes](#backslash) + * [Automatic Links](#autolink) + + +**Note:** This document is itself written using Markdown; you +can [see the source for it by adding '.text' to the URL][src]. + + [src]: /projects/markdown/syntax.text + +* * * + +

Overview

+ +

Philosophy

+ +Markdown is intended to be as easy-to-read and easy-to-write as is feasible. + +Readability, however, is emphasized above all else. A Markdown-formatted +document should be publishable as-is, as plain text, without looking +like it's been marked up with tags or formatting instructions. While +Markdown's syntax has been influenced by several existing text-to-HTML +filters -- including [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4], +[Grutatext] [5], and [EtText] [6] -- the single biggest source of +inspiration for Markdown's syntax is the format of plain text email. + + [1]: http://docutils.sourceforge.net/mirror/setext.html + [2]: http://www.aaronsw.com/2002/atx/ + [3]: http://textism.com/tools/textile/ + [4]: http://docutils.sourceforge.net/rst.html + [5]: http://www.triptico.com/software/grutatxt.html + [6]: http://ettext.taint.org/doc/ + +To this end, Markdown's syntax is comprised entirely of punctuation +characters, which punctuation characters have been carefully chosen so +as to look like what they mean. E.g., asterisks around a word actually +look like \*emphasis\*. Markdown lists look like, well, lists. Even +blockquotes look like quoted passages of text, assuming you've ever +used email. + + + +

Inline HTML

+ +Markdown's syntax is intended for one purpose: to be used as a +format for *writing* for the web. + +Markdown is not a replacement for HTML, or even close to it. Its +syntax is very small, corresponding only to a very small subset of +HTML tags. The idea is *not* to create a syntax that makes it easier +to insert HTML tags. In my opinion, HTML tags are already easy to +insert. The idea for Markdown is to make it easy to read, write, and +edit prose. HTML is a *publishing* format; Markdown is a *writing* +format. Thus, Markdown's formatting syntax only addresses issues that +can be conveyed in plain text. + +For any markup that is not covered by Markdown's syntax, you simply +use HTML itself. There's no need to preface it or delimit it to +indicate that you're switching from Markdown to HTML; you just use +the tags. + +The only restrictions are that block-level HTML elements -- e.g. `
`, +``, `
`, `

`, etc. -- must be separated from surrounding +content by blank lines, and the start and end tags of the block should +not be indented with tabs or spaces. Markdown is smart enough not +to add extra (unwanted) `

` tags around HTML block-level tags. + +For example, to add an HTML table to a Markdown article: + + This is a regular paragraph. + +

+ + + +
Foo
+ + This is another regular paragraph. + +Note that Markdown formatting syntax is not processed within block-level +HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an +HTML block. + +Span-level HTML tags -- e.g. ``, ``, or `` -- can be +used anywhere in a Markdown paragraph, list item, or header. If you +want, you can even use HTML tags instead of Markdown formatting; e.g. if +you'd prefer to use HTML `` or `` tags instead of Markdown's +link or image syntax, go right ahead. + +Unlike block-level HTML tags, Markdown syntax *is* processed within +span-level tags. + + +

Automatic Escaping for Special Characters

+ +In HTML, there are two characters that demand special treatment: `<` +and `&`. Left angle brackets are used to start tags; ampersands are +used to denote HTML entities. If you want to use them as literal +characters, you must escape them as entities, e.g. `<`, and +`&`. + +Ampersands in particular are bedeviling for web writers. If you want to +write about 'AT&T', you need to write '`AT&T`'. You even need to +escape ampersands within URLs. Thus, if you want to link to: + + http://images.google.com/images?num=30&q=larry+bird + +you need to encode the URL as: + + http://images.google.com/images?num=30&q=larry+bird + +in your anchor tag `href` attribute. Needless to say, this is easy to +forget, and is probably the single most common source of HTML validation +errors in otherwise well-marked-up web sites. + +Markdown allows you to use these characters naturally, taking care of +all the necessary escaping for you. If you use an ampersand as part of +an HTML entity, it remains unchanged; otherwise it will be translated +into `&`. + +So, if you want to include a copyright symbol in your article, you can write: + + © + +and Markdown will leave it alone. But if you write: + + AT&T + +Markdown will translate it to: + + AT&T + +Similarly, because Markdown supports [inline HTML](#html), if you use +angle brackets as delimiters for HTML tags, Markdown will treat them as +such. But if you write: + + 4 < 5 + +Markdown will translate it to: + + 4 < 5 + +However, inside Markdown code spans and blocks, angle brackets and +ampersands are *always* encoded automatically. This makes it easy to use +Markdown to write about HTML code. (As opposed to raw HTML, which is a +terrible format for writing about HTML syntax, because every single `<` +and `&` in your example code needs to be escaped.) + + +* * * + + +

Block Elements

+ + +

Paragraphs and Line Breaks

+ +A paragraph is simply one or more consecutive lines of text, separated +by one or more blank lines. (A blank line is any line that looks like a +blank line -- a line containing nothing but spaces or tabs is considered +blank.) Normal paragraphs should not be intended with spaces or tabs. + +The implication of the "one or more consecutive lines of text" rule is +that Markdown supports "hard-wrapped" text paragraphs. This differs +significantly from most other text-to-HTML formatters (including Movable +Type's "Convert Line Breaks" option) which translate every line break +character in a paragraph into a `
` tag. + +When you *do* want to insert a `
` break tag using Markdown, you +end a line with two or more spaces, then type return. + +Yes, this takes a tad more effort to create a `
`, but a simplistic +"every line break is a `
`" rule wouldn't work for Markdown. +Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l] +work best -- and look better -- when you format them with hard breaks. + + [bq]: #blockquote + [l]: #list + + + + + +Markdown supports two styles of headers, [Setext] [1] and [atx] [2]. + +Setext-style headers are "underlined" using equal signs (for first-level +headers) and dashes (for second-level headers). For example: + + This is an H1 + ============= + + This is an H2 + ------------- + +Any number of underlining `=`'s or `-`'s will work. + +Atx-style headers use 1-6 hash characters at the start of the line, +corresponding to header levels 1-6. For example: + + # This is an H1 + + ## This is an H2 + + ###### This is an H6 + +Optionally, you may "close" atx-style headers. This is purely +cosmetic -- you can use this if you think it looks better. The +closing hashes don't even need to match the number of hashes +used to open the header. (The number of opening hashes +determines the header level.) : + + # This is an H1 # + + ## This is an H2 ## + + ### This is an H3 ###### + + +

Blockquotes

+ +Markdown uses email-style `>` characters for blockquoting. If you're +familiar with quoting passages of text in an email message, then you +know how to create a blockquote in Markdown. It looks best if you hard +wrap the text and put a `>` before every line: + + > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, + > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. + > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. + > + > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse + > id sem consectetuer libero luctus adipiscing. + +Markdown allows you to be lazy and only put the `>` before the first +line of a hard-wrapped paragraph: + + > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, + consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. + Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. + + > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse + id sem consectetuer libero luctus adipiscing. + +Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by +adding additional levels of `>`: + + > This is the first level of quoting. + > + > > This is nested blockquote. + > + > Back to the first level. + +Blockquotes can contain other Markdown elements, including headers, lists, +and code blocks: + + > ## This is a header. + > + > 1. This is the first list item. + > 2. This is the second list item. + > + > Here's some example code: + > + > return shell_exec("echo $input | $markdown_script"); + +Any decent text editor should make email-style quoting easy. For +example, with BBEdit, you can make a selection and choose Increase +Quote Level from the Text menu. + + +

Lists

+ +Markdown supports ordered (numbered) and unordered (bulleted) lists. + +Unordered lists use asterisks, pluses, and hyphens -- interchangably +-- as list markers: + + * Red + * Green + * Blue + +is equivalent to: + + + Red + + Green + + Blue + +and: + + - Red + - Green + - Blue + +Ordered lists use numbers followed by periods: + + 1. Bird + 2. McHale + 3. Parish + +It's important to note that the actual numbers you use to mark the +list have no effect on the HTML output Markdown produces. The HTML +Markdown produces from the above list is: + +
    +
  1. Bird
  2. +
  3. McHale
  4. +
  5. Parish
  6. +
+ +If you instead wrote the list in Markdown like this: + + 1. Bird + 1. McHale + 1. Parish + +or even: + + 3. Bird + 1. McHale + 8. Parish + +you'd get the exact same HTML output. The point is, if you want to, +you can use ordinal numbers in your ordered Markdown lists, so that +the numbers in your source match the numbers in your published HTML. +But if you want to be lazy, you don't have to. + +If you do use lazy list numbering, however, you should still start the +list with the number 1. At some point in the future, Markdown may support +starting ordered lists at an arbitrary number. + +List markers typically start at the left margin, but may be indented by +up to three spaces. List markers must be followed by one or more spaces +or a tab. + +To make lists look nice, you can wrap items with hanging indents: + + * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, + viverra nec, fringilla in, laoreet vitae, risus. + * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. + Suspendisse id sem consectetuer libero luctus adipiscing. + +But if you want to be lazy, you don't have to: + + * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, + viverra nec, fringilla in, laoreet vitae, risus. + * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. + Suspendisse id sem consectetuer libero luctus adipiscing. + +If list items are separated by blank lines, Markdown will wrap the +items in `

` tags in the HTML output. For example, this input: + + * Bird + * Magic + +will turn into: + +

    +
  • Bird
  • +
  • Magic
  • +
+ +But this: + + * Bird + + * Magic + +will turn into: + +
    +
  • Bird

  • +
  • Magic

  • +
+ +List items may consist of multiple paragraphs. Each subsequent +paragraph in a list item must be intended by either 4 spaces +or one tab: + + 1. This is a list item with two paragraphs. Lorem ipsum dolor + sit amet, consectetuer adipiscing elit. Aliquam hendrerit + mi posuere lectus. + + Vestibulum enim wisi, viverra nec, fringilla in, laoreet + vitae, risus. Donec sit amet nisl. Aliquam semper ipsum + sit amet velit. + + 2. Suspendisse id sem consectetuer libero luctus adipiscing. + +It looks nice if you indent every line of the subsequent +paragraphs, but here again, Markdown will allow you to be +lazy: + + * This is a list item with two paragraphs. + + This is the second paragraph in the list item. You're + only required to indent the first line. Lorem ipsum dolor + sit amet, consectetuer adipiscing elit. + + * Another item in the same list. + +To put a blockquote within a list item, the blockquote's `>` +delimiters need to be indented: + + * A list item with a blockquote: + + > This is a blockquote + > inside a list item. + +To put a code block within a list item, the code block needs +to be indented *twice* -- 8 spaces or two tabs: + + * A list item with a code block: + + + + +It's worth noting that it's possible to trigger an ordered list by +accident, by writing something like this: + + 1986. What a great season. + +In other words, a *number-period-space* sequence at the beginning of a +line. To avoid this, you can backslash-escape the period: + + 1986\. What a great season. + + + +

Code Blocks

+ +Pre-formatted code blocks are used for writing about programming or +markup source code. Rather than forming normal paragraphs, the lines +of a code block are interpreted literally. Markdown wraps a code block +in both `
` and `` tags.
+
+To produce a code block in Markdown, simply indent every line of the
+block by at least 4 spaces or 1 tab. For example, given this input:
+
+    This is a normal paragraph:
+
+        This is a code block.
+
+Markdown will generate:
+
+    

This is a normal paragraph:

+ +
This is a code block.
+    
+ +One level of indentation -- 4 spaces or 1 tab -- is removed from each +line of the code block. For example, this: + + Here is an example of AppleScript: + + tell application "Foo" + beep + end tell + +will turn into: + +

Here is an example of AppleScript:

+ +
tell application "Foo"
+        beep
+    end tell
+    
+ +A code block continues until it reaches a line that is not indented +(or the end of the article). + +Within a code block, ampersands (`&`) and angle brackets (`<` and `>`) +are automatically converted into HTML entities. This makes it very +easy to include example HTML source code using Markdown -- just paste +it and indent it, and Markdown will handle the hassle of encoding the +ampersands and angle brackets. For example, this: + + + +will turn into: + +
<div class="footer">
+        &copy; 2004 Foo Corporation
+    </div>
+    
+ +Regular Markdown syntax is not processed within code blocks. E.g., +asterisks are just literal asterisks within a code block. This means +it's also easy to use Markdown to write about Markdown's own syntax. + + + +

Horizontal Rules

+ +You can produce a horizontal rule tag (`
`) by placing three or +more hyphens, asterisks, or underscores on a line by themselves. If you +wish, you may use spaces between the hyphens or asterisks. Each of the +following lines will produce a horizontal rule: + + * * * + + *** + + ***** + + - - - + + --------------------------------------- + + _ _ _ + + +* * * + +

Span Elements

+ + + +Markdown supports two style of links: *inline* and *reference*. + +In both styles, the link text is delimited by [square brackets]. + +To create an inline link, use a set of regular parentheses immediately +after the link text's closing square bracket. Inside the parentheses, +put the URL where you want the link to point, along with an *optional* +title for the link, surrounded in quotes. For example: + + This is [an example](http://example.com/ "Title") inline link. + + [This link](http://example.net/) has no title attribute. + +Will produce: + +

This is + an example inline link.

+ +

This link has no + title attribute.

+ +If you're referring to a local resource on the same server, you can +use relative paths: + + See my [About](/about/) page for details. + +Reference-style links use a second set of square brackets, inside +which you place a label of your choosing to identify the link: + + This is [an example][id] reference-style link. + +You can optionally use a space to separate the sets of brackets: + + This is [an example] [id] reference-style link. + +Then, anywhere in the document, you define your link label like this, +on a line by itself: + + [id]: http://example.com/ "Optional Title Here" + +That is: + +* Square brackets containing the link identifier (optionally + indented from the left margin using up to three spaces); +* followed by a colon; +* followed by one or more spaces (or tabs); +* followed by the URL for the link; +* optionally followed by a title attribute for the link, enclosed + in double or single quotes. + +The link URL may, optionally, be surrounded by angle brackets: + + [id]: "Optional Title Here" + +You can put the title attribute on the next line and use extra spaces +or tabs for padding, which tends to look better with longer URLs: + + [id]: http://example.com/longish/path/to/resource/here + "Optional Title Here" + +Link definitions are only used for creating links during Markdown +processing, and are stripped from your document in the HTML output. + +Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are *not* case sensitive. E.g. these two links: + + [link text][a] + [link text][A] + +are equivalent. + +The *implicit link name* shortcut allows you to omit the name of the +link, in which case the link text itself is used as the name. +Just use an empty set of square brackets -- e.g., to link the word +"Google" to the google.com web site, you could simply write: + + [Google][] + +And then define the link: + + [Google]: http://google.com/ + +Because link names may contain spaces, this shortcut even works for +multiple words in the link text: + + Visit [Daring Fireball][] for more information. + +And then define the link: + + [Daring Fireball]: http://daringfireball.net/ + +Link definitions can be placed anywhere in your Markdown document. I +tend to put them immediately after each paragraph in which they're +used, but if you want, you can put them all at the end of your +document, sort of like footnotes. + +Here's an example of reference links in action: + + I get 10 times more traffic from [Google] [1] than from + [Yahoo] [2] or [MSN] [3]. + + [1]: http://google.com/ "Google" + [2]: http://search.yahoo.com/ "Yahoo Search" + [3]: http://search.msn.com/ "MSN Search" + +Using the implicit link name shortcut, you could instead write: + + I get 10 times more traffic from [Google][] than from + [Yahoo][] or [MSN][]. + + [google]: http://google.com/ "Google" + [yahoo]: http://search.yahoo.com/ "Yahoo Search" + [msn]: http://search.msn.com/ "MSN Search" + +Both of the above examples will produce the following HTML output: + +

I get 10 times more traffic from Google than from + Yahoo + or MSN.

+ +For comparison, here is the same paragraph written using +Markdown's inline link style: + + I get 10 times more traffic from [Google](http://google.com/ "Google") + than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or + [MSN](http://search.msn.com/ "MSN Search"). + +The point of reference-style links is not that they're easier to +write. The point is that with reference-style links, your document +source is vastly more readable. Compare the above examples: using +reference-style links, the paragraph itself is only 81 characters +long; with inline-style links, it's 176 characters; and as raw HTML, +it's 234 characters. In the raw HTML, there's more markup than there +is text. + +With Markdown's reference-style links, a source document much more +closely resembles the final output, as rendered in a browser. By +allowing you to move the markup-related metadata out of the paragraph, +you can add links without interrupting the narrative flow of your +prose. + + +

Emphasis

+ +Markdown treats asterisks (`*`) and underscores (`_`) as indicators of +emphasis. Text wrapped with one `*` or `_` will be wrapped with an +HTML `` tag; double `*`'s or `_`'s will be wrapped with an HTML +`` tag. E.g., this input: + + *single asterisks* + + _single underscores_ + + **double asterisks** + + __double underscores__ + +will produce: + + single asterisks + + single underscores + + double asterisks + + double underscores + +You can use whichever style you prefer; the lone restriction is that +the same character must be used to open and close an emphasis span. + +Emphasis can be used in the middle of a word: + + un*fucking*believable + +But if you surround an `*` or `_` with spaces, it'll be treated as a +literal asterisk or underscore. + +To produce a literal asterisk or underscore at a position where it +would otherwise be used as an emphasis delimiter, you can backslash +escape it: + + \*this text is surrounded by literal asterisks\* + + + +

Code

+ +To indicate a span of code, wrap it with backtick quotes (`` ` ``). +Unlike a pre-formatted code block, a code span indicates code within a +normal paragraph. For example: + + Use the `printf()` function. + +will produce: + +

Use the printf() function.

+ +To include a literal backtick character within a code span, you can use +multiple backticks as the opening and closing delimiters: + + ``There is a literal backtick (`) here.`` + +which will produce this: + +

There is a literal backtick (`) here.

+ +The backtick delimiters surrounding a code span may include spaces -- +one after the opening, one before the closing. This allows you to place +literal backtick characters at the beginning or end of a code span: + + A single backtick in a code span: `` ` `` + + A backtick-delimited string in a code span: `` `foo` `` + +will produce: + +

A single backtick in a code span: `

+ +

A backtick-delimited string in a code span: `foo`

+ +With a code span, ampersands and angle brackets are encoded as HTML +entities automatically, which makes it easy to include example HTML +tags. Markdown will turn this: + + Please don't use any `` tags. + +into: + +

Please don't use any <blink> tags.

+ +You can write this: + + `—` is the decimal-encoded equivalent of `—`. + +to produce: + +

&#8212; is the decimal-encoded + equivalent of &mdash;.

+ + + +

Images

+ +Admittedly, it's fairly difficult to devise a "natural" syntax for +placing images into a plain text document format. + +Markdown uses an image syntax that is intended to resemble the syntax +for links, allowing for two styles: *inline* and *reference*. + +Inline image syntax looks like this: + + ![Alt text](/path/to/img.jpg) + + ![Alt text](/path/to/img.jpg "Optional title") + +That is: + +* An exclamation mark: `!`; +* followed by a set of square brackets, containing the `alt` + attribute text for the image; +* followed by a set of parentheses, containing the URL or path to + the image, and an optional `title` attribute enclosed in double + or single quotes. + +Reference-style image syntax looks like this: + + ![Alt text][id] + +Where "id" is the name of a defined image reference. Image references +are defined using syntax identical to link references: + + [id]: url/to/image "Optional title attribute" + +As of this writing, Markdown has no syntax for specifying the +dimensions of an image; if this is important to you, you can simply +use regular HTML `` tags. + + +* * * + + +

Miscellaneous

+ + + +Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this: + + + +Markdown will turn this into: + + http://example.com/ + +Automatic links for email addresses work similarly, except that +Markdown will also perform a bit of randomized decimal and hex +entity-encoding to help obscure your address from address-harvesting +spambots. For example, Markdown will turn this: + + + +into something like this: + + address@exa + mple.com + +which will render in a browser as a clickable link to "address@example.com". + +(This sort of entity-encoding trick will indeed fool many, if not +most, address-harvesting bots, but it definitely won't fool all of +them. It's better than nothing, but an address published in this way +will probably eventually start receiving spam.) + + + +

Backslash Escapes

+ +Markdown allows you to use backslash escapes to generate literal +characters which would otherwise have special meaning in Markdown's +formatting syntax. For example, if you wanted to surround a word with +literal asterisks (instead of an HTML `` tag), you can backslashes +before the asterisks, like this: + + \*literal asterisks\* + +Markdown provides backslash escapes for the following characters: + + \ backslash + ` backtick + * asterisk + _ underscore + {} curly braces + [] square brackets + () parentheses + # hash mark + + plus sign + - minus sign (hyphen) + . dot + ! exclamation mark + diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Nested blockquotes.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Nested blockquotes.html new file mode 100644 index 000000000..d8ec7f8e0 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Nested blockquotes.html @@ -0,0 +1,9 @@ +
+

foo

+ +
+

bar

+
+ +

foo

+
diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Nested blockquotes.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Nested blockquotes.text new file mode 100644 index 000000000..ed3c624ff --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Nested blockquotes.text @@ -0,0 +1,5 @@ +> foo +> +> > bar +> +> foo diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Ordered and unordered lists.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Ordered and unordered lists.html new file mode 100644 index 000000000..ba71eab39 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Ordered and unordered lists.html @@ -0,0 +1,148 @@ +

Unordered

+ +

Asterisks tight:

+ +
    +
  • asterisk 1
  • +
  • asterisk 2
  • +
  • asterisk 3
  • +
+ +

Asterisks loose:

+ +
    +
  • asterisk 1

  • +
  • asterisk 2

  • +
  • asterisk 3

  • +
+ +
+ +

Pluses tight:

+ +
    +
  • Plus 1
  • +
  • Plus 2
  • +
  • Plus 3
  • +
+ +

Pluses loose:

+ +
    +
  • Plus 1

  • +
  • Plus 2

  • +
  • Plus 3

  • +
+ +
+ +

Minuses tight:

+ +
    +
  • Minus 1
  • +
  • Minus 2
  • +
  • Minus 3
  • +
+ +

Minuses loose:

+ +
    +
  • Minus 1

  • +
  • Minus 2

  • +
  • Minus 3

  • +
+ +

Ordered

+ +

Tight:

+ +
    +
  1. First
  2. +
  3. Second
  4. +
  5. Third
  6. +
+ +

and:

+ +
    +
  1. One
  2. +
  3. Two
  4. +
  5. Three
  6. +
+ +

Loose using tabs:

+ +
    +
  1. First

  2. +
  3. Second

  4. +
  5. Third

  6. +
+ +

and using spaces:

+ +
    +
  1. One

  2. +
  3. Two

  4. +
  5. Three

  6. +
+ +

Multiple paragraphs:

+ +
    +
  1. Item 1, graf one.

    + +

    Item 2. graf two. The quick brown fox jumped over the lazy dog's +back.

  2. +
  3. Item 2.

  4. +
  5. Item 3.

  6. +
+ +

Nested

+ +
    +
  • Tab +
      +
    • Tab +
        +
      • Tab
      • +
    • +
  • +
+ +

Here's another:

+ +
    +
  1. First
  2. +
  3. Second: +
      +
    • Fee
    • +
    • Fie
    • +
    • Foe
    • +
  4. +
  5. Third
  6. +
+ +

Same thing but with paragraphs:

+ +
    +
  1. First

  2. +
  3. Second:

    + +
      +
    • Fee
    • +
    • Fie
    • +
    • Foe
    • +
  4. +
  5. Third

  6. +
+ + +

This was an error in Markdown 1.0.1:

+ +
    +
  • this

    + +
    • sub
    + +

    that

  • +
diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Ordered and unordered lists.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Ordered and unordered lists.text new file mode 100644 index 000000000..7f3b49777 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Ordered and unordered lists.text @@ -0,0 +1,131 @@ +## Unordered + +Asterisks tight: + +* asterisk 1 +* asterisk 2 +* asterisk 3 + + +Asterisks loose: + +* asterisk 1 + +* asterisk 2 + +* asterisk 3 + +* * * + +Pluses tight: + ++ Plus 1 ++ Plus 2 ++ Plus 3 + + +Pluses loose: + ++ Plus 1 + ++ Plus 2 + ++ Plus 3 + +* * * + + +Minuses tight: + +- Minus 1 +- Minus 2 +- Minus 3 + + +Minuses loose: + +- Minus 1 + +- Minus 2 + +- Minus 3 + + +## Ordered + +Tight: + +1. First +2. Second +3. Third + +and: + +1. One +2. Two +3. Three + + +Loose using tabs: + +1. First + +2. Second + +3. Third + +and using spaces: + +1. One + +2. Two + +3. Three + +Multiple paragraphs: + +1. Item 1, graf one. + + Item 2. graf two. The quick brown fox jumped over the lazy dog's + back. + +2. Item 2. + +3. Item 3. + + + +## Nested + +* Tab + * Tab + * Tab + +Here's another: + +1. First +2. Second: + * Fee + * Fie + * Foe +3. Third + +Same thing but with paragraphs: + +1. First + +2. Second: + * Fee + * Fie + * Foe + +3. Third + + +This was an error in Markdown 1.0.1: + +* this + + * sub + + that diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Strong and em together.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Strong and em together.html new file mode 100644 index 000000000..71ec78c70 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Strong and em together.html @@ -0,0 +1,7 @@ +

This is strong and em.

+ +

So is this word.

+ +

This is strong and em.

+ +

So is this word.

diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Strong and em together.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Strong and em together.text new file mode 100644 index 000000000..95ee690db --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Strong and em together.text @@ -0,0 +1,7 @@ +***This is strong and em.*** + +So is ***this*** word. + +___This is strong and em.___ + +So is ___this___ word. diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Tabs.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Tabs.html new file mode 100644 index 000000000..3301ba803 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Tabs.html @@ -0,0 +1,25 @@ +
    +
  • this is a list item +indented with tabs

  • +
  • this is a list item +indented with spaces

  • +
+ +

Code:

+ +
this code block is indented by one tab
+
+ +

And:

+ +
    this code block is indented by two tabs
+
+ +

And:

+ +
+   this is an example list item
+    indented with tabs
+
++   this is an example list item
+    indented with spaces
+
diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Tabs.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Tabs.text new file mode 100644 index 000000000..589d1136e --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Tabs.text @@ -0,0 +1,21 @@ ++ this is a list item + indented with tabs + ++ this is a list item + indented with spaces + +Code: + + this code block is indented by one tab + +And: + + this code block is indented by two tabs + +And: + + + this is an example list item + indented with tabs + + + this is an example list item + indented with spaces diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Tidyness.html b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Tidyness.html new file mode 100644 index 000000000..f2a8ce70f --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Tidyness.html @@ -0,0 +1,8 @@ +
+

A list within a blockquote:

+
    +
  • asterisk 1
  • +
  • asterisk 2
  • +
  • asterisk 3
  • +
+
diff --git a/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Tidyness.text b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Tidyness.text new file mode 100644 index 000000000..5f18b8da2 --- /dev/null +++ b/supportlibs/pegmarkdown/MarkdownTest_1.0.3/Tests/Tidyness.text @@ -0,0 +1,5 @@ +> A list within a blockquote: +> +> * asterisk 1 +> * asterisk 2 +> * asterisk 3 diff --git a/supportlibs/pegmarkdown/README.markdown b/supportlibs/pegmarkdown/README.markdown new file mode 100644 index 000000000..409c5e3fe --- /dev/null +++ b/supportlibs/pegmarkdown/README.markdown @@ -0,0 +1,225 @@ + +This a forked version of peg-markdown.... only minor changes: + + * Switch to Qt .pro make system for easy x-platform. + + * build a library instead of exec. + + * Add GLibFacade from multimarkdown to allow Win32 compilations. + + * Added ifdefs for C++ linking, + + +What is this? +============= + +This is an implementation of John Gruber's [markdown][] in C. It uses a +[parsing expression grammar (PEG)][] to define the syntax. This should +allow easy modification and extension. It currently supports output in +HTML, LaTeX, ODF, or groff_mm formats, and adding new formats is +relatively easy. + +[parsing expression grammar (PEG)]: http://en.wikipedia.org/wiki/Parsing_expression_grammar +[markdown]: http://daringfireball.net/projects/markdown/ + +It is pretty fast. A 179K text file that takes 5.7 seconds for +Markdown.pl (v. 1.0.1) to parse takes less than 0.2 seconds for this +markdown. It does, however, use a lot of memory (up to 4M of heap space +while parsing the 179K file, and up to 80K for a 4K file). (Note that +the memory leaks in earlier versions of this program have now been +plugged.) + +Both a library and a standalone program are provided. + +peg-markdown is written and maintained by John MacFarlane (jgm on +github), with significant contributions by Ryan Tomayko (rtomayko). +It is released under both the GPL and the MIT license; see LICENSE for +details. + +Installing +========== + +On a linux or unix-based system +------------------------------- + +This program is written in portable ANSI C. It requires +[glib2](http://www.gtk.org/download/index.php). Most *nix systems will have +this installed already. The build system requires GNU make. + +The other required dependency, [Ian Piumarta's peg/leg PEG parser +generator](http://piumarta.com/software/peg/), is included in the source +directory. It will be built automatically. (However, it is not as portable +as peg-markdown itself, and seems to require gcc.) + +To make the 'markdown' executable: + + make + +(Or, on some systems, `gmake`.) Then, for usage instructions: + + ./markdown --help + +To run John Gruber's Markdown 1.0.3 test suite: + + make test + +The test suite will fail on one of the list tests. Here's why. +Markdown.pl encloses "item one" in the following list in `

` tags: + + 1. item one + * subitem + * subitem + + 2. item two + + 3. item three + +peg-markdown does not enclose "item one" in `

` tags unless it has a +following blank line. This is consistent with the official markdown +syntax description, and lets the author of the document choose whether +`

` tags are desired. + +Cross-compiling for Windows with MinGW on a linux box +----------------------------------------------------- + +Prerequisites: + +* Linux system with MinGW cross compiler For Ubuntu: + + sudo apt-get install mingw32 + +* [Windows glib-2.0 binary & development files](http://www.gtk.org/download-windows.html). + Unzip files into cross-compiler directory tree (e.g., `/usr/i586-mingw32msvc`). + +Steps: + +1. Create the markdown parser using Linux-compiled `leg` from peg-0.1.4: + + ./peg-0.1.4/leg markdown_parser.leg >markdown_parser.c + + (Note: The same thing could be accomplished by cross-compiling leg, + executing it on Windows, and copying the resulting C file to the Linux + cross-compiler host.) + +2. Run the cross compiler with include flag for the Windows glib-2.0 headers: + for example, + + /usr/bin/i586-mingw32msvc-cc -c \ + -I/usr/i586-mingw32msvc/include/glib-2.0 \ + -I/usr/i586-mingw32msvc/lib/glib-2.0/include -Wall -O3 -ansi markdown*.c + +3. Link against Windows glib-2.0 headers: for example, + + /usr/bin/i586-mingw32msvc-cc markdown*.o \ + -Wl,-L/usr/i586-mingw32msvc/lib/glib,--dy,--warn-unresolved-symbols,-lglib-2.0 \ + -o markdown.exe + +The resulting executable depends on the glib dll file, so be sure to +load the glib binary on the Windows host. + +Compiling with MinGW on Windows +------------------------------- + +These directions assume that MinGW is installed in `c:\MinGW` and glib-2.0 +is installed in the MinGW directory hierarchy (with the mingw bin directory +in the system path). + +Unzip peg-markdown in a temp directory. From the directory with the +peg-markdown source, execute: + + cd peg-0.1.4 + make PKG_CONFIG=c:/path/to/glib/bin/pkg-config.exe + +Extensions +========== + +peg-markdown supports extensions to standard markdown syntax. +These can be turned on using the command line flag `-x` or +`--extensions`. `-x` by itself turns on all extensions. Extensions +can also be turned on selectively, using individual command-line +options. To see the available extensions: + + ./markdown --help-extensions + +The `--smart` extension provides "smart quotes", dashes, and ellipses. + +The `--notes` extension provides a footnote syntax like that of +Pandoc or PHP Markdown Extra. + +Using the library +================= + +The library exports two functions: + + GString * markdown_to_g_string(char *text, int extensions, int output_format); + char * markdown_to_string(char *text, int extensions, int output_format); + +The only difference between these is that `markdown_to_g_string` returns a +`GString` (glib's automatically resizable string), while `markdown_to_string` +returns a regular character pointer. The memory allocated for these must be +freed by the calling program, using `g_string_free()` or `free()`. + +`text` is the markdown-formatted text to be converted. Note that tabs will +be converted to spaces, using a four-space tab stop. Character encodings are +ignored. + +`extensions` is a bit-field specifying which syntax extensions should be used. +If `extensions` is 0, no extensions will be used. If it is `0xFFFFFF`, +all extensions will be used. To set extensions selectively, use the +bitwise `&` operator and the following constants: + + - `EXT_SMART` turns on smart quotes, dashes, and ellipses. + - `EXT_NOTES` turns on footnote syntax. [Pandoc's footnote syntax][] is used here. + - `EXT_FILTER_HTML` filters out raw HTML (except for styles). + - `EXT_FILTER_STYLES` filters out styles in HTML. + + [Pandoc's footnote syntax]: http://johnmacfarlane.net/pandoc/README.html#footnotes + +`output_format` is either `HTML_FORMAT`, `LATEX_FORMAT`, `ODF_FORMAT`, +or `GROFF_MM_FORMAT`. + +To use the library, include `markdown_lib.h`. See `markdown.c` for an example. + +Hacking +======= + +It should be pretty easy to modify the program to produce other formats, +and to parse syntax extensions. A quick guide: + + * `markdown_parser.leg` contains the grammar itself. + + * `markdown_output.c` contains functions for printing the `Element` + structure in various output formats. + + * To add an output format, add the format to `markdown_formats` in + `markdown_lib.h`. Then modify `print_element` in `markdown_output.c`, + and add functions `print_XXXX_string`, `print_XXXX_element`, and + `print_XXXX_element_list`. Also add an option in the main program + that selects the new format. Don't forget to add it to the list of + formats in the usage message. + + * To add syntax extensions, define them in the PEG grammar + (`markdown_parser.leg`), using existing extensions as a guide. New + inline elements will need to be added to `Inline =`; new block + elements will need to be added to `Block =`. (Note: the order + of the alternatives does matter in PEG grammars.) + + * If you need to add new types of elements, modify the `keys` + enum in `markdown_peg.h`. + + * By using `&{ }` rules one can selectively disable extensions + depending on command-line options. For example, + `&{ extension(EXT_SMART) }` succeeds only if the `EXT_SMART` bit + of the global `syntax_extensions` is set. Add your option to + `markdown_extensions` in `markdown_lib.h`, and add an option in + `markdown.c` to turn on your extension. + + * Note: Avoid using `[^abc]` character classes in the grammar, because + they cause problems with non-ascii input. Instead, use: `( !'a' !'b' + !'c' . )` + +Acknowledgements +================ + +Support for ODF output was added by Fletcher T. Penney. + diff --git a/supportlibs/pegmarkdown/glib.h b/supportlibs/pegmarkdown/glib.h new file mode 100644 index 000000000..eafb859ff --- /dev/null +++ b/supportlibs/pegmarkdown/glib.h @@ -0,0 +1,11 @@ +/* + * glib.h + * MultiMarkdown + * + * Created by Daniel Jalkut on 7/26/11. + * Copyright 2011 __MyCompanyName__. All rights reserved. + * + */ + +/* Just a dummy file to keep the glib-dependent sources compiling as we would hope */ +#include "GLibFacade.h" diff --git a/supportlibs/pegmarkdown/markdown.c b/supportlibs/pegmarkdown/markdown.c new file mode 100644 index 000000000..ca277e529 --- /dev/null +++ b/supportlibs/pegmarkdown/markdown.c @@ -0,0 +1,183 @@ +/********************************************************************** + + markdown.c - markdown in C using a PEG grammar. + (c) 2008 John MacFarlane (jgm at berkeley dot edu). + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License or the MIT + license. See LICENSE for details. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + ***********************************************************************/ + +#include +#include +#include +#include +#include +#include +#include "markdown_peg.h" + +static int extensions; + +/********************************************************************** + + The main program is just a wrapper around the library functions in + markdown_lib.c. It parses command-line options, reads the text to + be converted from input files or stdin, converts the text, and sends + the output to stdout or a file. Character encodings are ignored. + + ***********************************************************************/ + +#define VERSION "0.4.14" +#define COPYRIGHT "Copyright (c) 2008-2009 John MacFarlane. License GPLv2+ or MIT.\n" \ + "This is free software: you are free to change and redistribute it.\n" \ + "There is NO WARRANTY, to the extent permitted by law." + +/* print version and copyright information */ +void version(const char *progname) +{ + printf("peg-markdown version %s\n" + "%s\n", + VERSION, + COPYRIGHT); +} + +int main(int argc, char * argv[]) { + + int numargs; /* number of filename arguments */ + int i; + + GString *inputbuf; + char *out; /* string containing processed output */ + + FILE *input; + FILE *output; + char curchar; + char *progname = argv[0]; + + int output_format = HTML_FORMAT; + + /* Code for command-line option parsing. */ + + static gboolean opt_version = FALSE; + static gchar *opt_output = 0; + static gchar *opt_to = 0; + static gboolean opt_smart = FALSE; + static gboolean opt_notes = FALSE; + static gboolean opt_filter_html = FALSE; + static gboolean opt_filter_styles = FALSE; + static gboolean opt_allext = FALSE; + + static GOptionEntry entries[] = + { + { "version", 'v', 0, G_OPTION_ARG_NONE, &opt_version, "print version and exit", NULL }, + { "output", 'o', 0, G_OPTION_ARG_STRING, &opt_output, "send output to FILE (default is stdout)", "FILE" }, + { "to", 't', 0, G_OPTION_ARG_STRING, &opt_to, "convert to FORMAT (default is html)", "FORMAT" }, + { "extensions", 'x', 0, G_OPTION_ARG_NONE, &opt_allext, "use all syntax extensions", NULL }, + { "filter-html", 0, 0, G_OPTION_ARG_NONE, &opt_filter_html, "filter out raw HTML (except styles)", NULL }, + { "filter-styles", 0, 0, G_OPTION_ARG_NONE, &opt_filter_styles, "filter out HTML styles", NULL }, + { NULL } + }; + + /* Options to active syntax extensions. These appear separately in --help. */ + static GOptionEntry ext_entries[] = + { + { "smart", 0, 0, G_OPTION_ARG_NONE, &opt_smart, "use smart typography extension", NULL }, + { "notes", 0, 0, G_OPTION_ARG_NONE, &opt_notes, "use notes extension", NULL }, + { NULL } + }; + + GError *error = NULL; + GOptionContext *context; + GOptionGroup *ext_group; + + context = g_option_context_new ("[FILE...]"); + g_option_context_add_main_entries (context, entries, NULL); + ext_group = g_option_group_new ("extensions", "Syntax extensions", "show available syntax extensions", NULL, NULL); + g_option_group_add_entries (ext_group, ext_entries); + g_option_context_add_group (context, ext_group); + g_option_context_set_description (context, "Converts text in specified files (or stdin) from markdown to FORMAT.\n" + "Available FORMATs: html, latex, groff-mm, odf"); + if (!g_option_context_parse (context, &argc, &argv, &error)) { + g_print ("option parsing failed: %s\n", error->message); + exit (1); + } + g_option_context_free(context); + + /* Process command-line options and arguments. */ + + if (opt_version) { + version(progname); + return EXIT_SUCCESS; + } + + extensions = 0; + if (opt_allext) + extensions = 0xFFFFFF; /* turn on all extensions */ + if (opt_smart) + extensions = extensions | EXT_SMART; + if (opt_notes) + extensions = extensions | EXT_NOTES; + if (opt_filter_html) + extensions = extensions | EXT_FILTER_HTML; + if (opt_filter_styles) + extensions = extensions | EXT_FILTER_STYLES; + + if (opt_to == NULL) + output_format = HTML_FORMAT; + else if (strcmp(opt_to, "html") == 0) + output_format = HTML_FORMAT; + else if (strcmp(opt_to, "latex") == 0) + output_format = LATEX_FORMAT; + else if (strcmp(opt_to, "groff-mm") == 0) + output_format = GROFF_MM_FORMAT; + else if (strcmp(opt_to, "odf") == 0) + output_format = ODF_FORMAT; + else { + fprintf(stderr, "%s: Unknown output format '%s'\n", progname, opt_to); + exit(EXIT_FAILURE); + } + + /* we allow "-" as a synonym for stdout here */ + if (opt_output == NULL || strcmp(opt_output, "-") == 0) + output = stdout; + else if (!(output = fopen(opt_output, "w"))) { + perror(opt_output); + return 1; + } + + inputbuf = g_string_new(""); /* string for concatenated input */ + + /* Read input from stdin or input files into inputbuf */ + + numargs = argc - 1; + if (numargs == 0) { /* use stdin if no files specified */ + while ((curchar = fgetc(stdin)) != EOF) + g_string_append_c(inputbuf, curchar); + fclose(stdin); + } + else { /* open all the files on command line */ + for (i = 0; i < numargs; i++) { + if ((input = fopen(argv[i+1], "r")) == NULL) { + perror(argv[i+1]); + exit(EXIT_FAILURE); + } + while ((curchar = fgetc(input)) != EOF) + g_string_append_c(inputbuf, curchar); + fclose(input); + } + } + + out = markdown_to_string(inputbuf->str, extensions, output_format); + fprintf(output, "%s\n", out); + free(out); + + g_string_free(inputbuf, true); + + return(EXIT_SUCCESS); +} diff --git a/supportlibs/pegmarkdown/markdown_lib.c b/supportlibs/pegmarkdown/markdown_lib.c new file mode 100644 index 000000000..628fce29f --- /dev/null +++ b/supportlibs/pegmarkdown/markdown_lib.c @@ -0,0 +1,181 @@ +/********************************************************************** + + markdown_lib.c - markdown in C using a PEG grammar. + (c) 2008 John MacFarlane (jgm at berkeley dot edu). + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License or the MIT + license. See LICENSE for details. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + ***********************************************************************/ + +#include +#include +#include +#include "markdown_peg.h" + +#define TABSTOP 4 + +/* preformat_text - allocate and copy text buffer while + * performing tab expansion. */ +static GString *preformat_text(char *text) { + GString *buf; + char next_char; + int charstotab; + + int len = 0; + + buf = g_string_new(""); + + charstotab = TABSTOP; + while ((next_char = *text++) != '\0') { + switch (next_char) { + case '\t': + while (charstotab > 0) + g_string_append_c(buf, ' '), len++, charstotab--; + break; + case '\n': + g_string_append_c(buf, '\n'), len++, charstotab = TABSTOP; + break; + default: + g_string_append_c(buf, next_char), len++, charstotab--; + } + if (charstotab == 0) + charstotab = TABSTOP; + } + g_string_append(buf, "\n\n"); + return(buf); +} + +/* print_tree - print tree of elements, for debugging only. */ +static void print_tree(element * elt, int indent) { + int i; + char * key; + while (elt != NULL) { + for (i = 0; i < indent; i++) + fputc(' ', stderr); + switch (elt->key) { + case LIST: key = "LIST"; break; + case RAW: key = "RAW"; break; + case SPACE: key = "SPACE"; break; + case LINEBREAK: key = "LINEBREAK"; break; + case ELLIPSIS: key = "ELLIPSIS"; break; + case EMDASH: key = "EMDASH"; break; + case ENDASH: key = "ENDASH"; break; + case APOSTROPHE: key = "APOSTROPHE"; break; + case SINGLEQUOTED: key = "SINGLEQUOTED"; break; + case DOUBLEQUOTED: key = "DOUBLEQUOTED"; break; + case STR: key = "STR"; break; + case LINK: key = "LINK"; break; + case IMAGE: key = "IMAGE"; break; + case CODE: key = "CODE"; break; + case HTML: key = "HTML"; break; + case EMPH: key = "EMPH"; break; + case STRONG: key = "STRONG"; break; + case PLAIN: key = "PLAIN"; break; + case PARA: key = "PARA"; break; + case LISTITEM: key = "LISTITEM"; break; + case BULLETLIST: key = "BULLETLIST"; break; + case ORDEREDLIST: key = "ORDEREDLIST"; break; + case H1: key = "H1"; break; + case H2: key = "H2"; break; + case H3: key = "H3"; break; + case H4: key = "H4"; break; + case H5: key = "H5"; break; + case H6: key = "H6"; break; + case BLOCKQUOTE: key = "BLOCKQUOTE"; break; + case VERBATIM: key = "VERBATIM"; break; + case HTMLBLOCK: key = "HTMLBLOCK"; break; + case HRULE: key = "HRULE"; break; + case REFERENCE: key = "REFERENCE"; break; + case NOTE: key = "NOTE"; break; + default: key = "?"; + } + if ( elt->key == STR ) { + fprintf(stderr, "0x%p: %s '%s'\n", (void *)elt, key, elt->contents.str); + } else { + fprintf(stderr, "0x%p: %s\n", (void *)elt, key); + } + if (elt->children) + print_tree(elt->children, indent + 4); + elt = elt->next; + } +} + +/* process_raw_blocks - traverses an element list, replacing any RAW elements with + * the result of parsing them as markdown text, and recursing into the children + * of parent elements. The result should be a tree of elements without any RAWs. */ +static element * process_raw_blocks(element *input, int extensions, element *references, element *notes) { + element *current = NULL; + element *last_child = NULL; + char *contents; + current = input; + + while (current != NULL) { + if (current->key == RAW) { + /* \001 is used to indicate boundaries between nested lists when there + * is no blank line. We split the string by \001 and parse + * each chunk separately. */ + contents = strtok(current->contents.str, "\001"); + current->key = LIST; + current->children = parse_markdown(contents, extensions, references, notes); + last_child = current->children; + while ((contents = strtok(NULL, "\001"))) { + while (last_child->next != NULL) + last_child = last_child->next; + last_child->next = parse_markdown(contents, extensions, references, notes); + } + free(current->contents.str); + current->contents.str = NULL; + } + if (current->children != NULL) + current->children = process_raw_blocks(current->children, extensions, references, notes); + current = current->next; + } + return input; +} + +/* markdown_to_gstring - convert markdown text to the output format specified. + * Returns a GString, which must be freed after use using g_string_free(). */ +GString * markdown_to_g_string(char *text, int extensions, int output_format) { + element *result; + element *references; + element *notes; + GString *formatted_text; + GString *out; + out = g_string_new(""); + + formatted_text = preformat_text(text); + + references = parse_references(formatted_text->str, extensions); + notes = parse_notes(formatted_text->str, extensions, references); + result = parse_markdown(formatted_text->str, extensions, references, notes); + + result = process_raw_blocks(result, extensions, references, notes); + + g_string_free(formatted_text, TRUE); + + print_element_list(out, result, output_format, extensions); + + free_element_list(result); + free_element_list(references); + return out; +} + +/* markdown_to_string - convert markdown text to the output format specified. + * Returns a null-terminated string, which must be freed after use. */ +char * markdown_to_string(char *text, int extensions, int output_format) { + GString *out; + char *char_out; + out = markdown_to_g_string(text, extensions, output_format); + char_out = out->str; + g_string_free(out, FALSE); + return char_out; +} + +/* vim:set ts=4 sw=4: */ diff --git a/supportlibs/pegmarkdown/markdown_lib.h b/supportlibs/pegmarkdown/markdown_lib.h new file mode 100644 index 000000000..c13a567d3 --- /dev/null +++ b/supportlibs/pegmarkdown/markdown_lib.h @@ -0,0 +1,38 @@ +#ifndef MARKDOWN_LIB_H +#define MARKDOWN_LIB_H + +#include +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif + + +enum markdown_extensions { + EXT_SMART = 0x01, + EXT_NOTES = 0x02, + EXT_FILTER_HTML = 0x04, + EXT_FILTER_STYLES = 0x08 +}; + +enum markdown_formats { + HTML_FORMAT, + LATEX_FORMAT, + GROFF_MM_FORMAT, + ODF_FORMAT +}; + +GString * markdown_to_g_string(char *text, int extensions, int output_format); +char * markdown_to_string(char *text, int extensions, int output_format); + + +#ifdef __cplusplus +} +#endif + +/* vim: set ts=4 sw=4 : */ +#endif + diff --git a/supportlibs/pegmarkdown/markdown_output.c b/supportlibs/pegmarkdown/markdown_output.c new file mode 100644 index 000000000..99cbb6bb7 --- /dev/null +++ b/supportlibs/pegmarkdown/markdown_output.c @@ -0,0 +1,1121 @@ +/********************************************************************** + + markdown_output.c - functions for printing Elements parsed by + markdown_peg. + (c) 2008 John MacFarlane (jgm at berkeley dot edu). + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License or the MIT + license. See LICENSE for details. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + ***********************************************************************/ + +#include +#include +#include +#include +#include +#include +#include "markdown_peg.h" +#include "odf.h" + +static int extensions; +static int odf_type = 0; + +static void print_html_string(GString *out, char *str, bool obfuscate); +static void print_html_element_list(GString *out, element *list, bool obfuscate); +static void print_html_element(GString *out, element *elt, bool obfuscate); +static void print_latex_string(GString *out, char *str); +static void print_latex_element_list(GString *out, element *list); +static void print_latex_element(GString *out, element *elt); +static void print_groff_string(GString *out, char *str); +static void print_groff_mm_element_list(GString *out, element *list); +static void print_groff_mm_element(GString *out, element *elt, int count); +static void print_odf_code_string(GString *out, char *str); +static void print_odf_string(GString *out, char *str); +static void print_odf_element_list(GString *out, element *list); +static void print_odf_element(GString *out, element *elt); +static bool list_contains_key(element *list, int key); + +/********************************************************************** + + Utility functions for printing + + ***********************************************************************/ + +static int padded = 2; /* Number of newlines after last output. + Starts at 2 so no newlines are needed at start. + */ + +static GSList *endnotes = NULL; /* List of endnotes to print after main content. */ +static int notenumber = 0; /* Number of footnote. */ + +/* pad - add newlines if needed */ +static void pad(GString *out, int num) { + while (num-- > padded) + g_string_append_printf(out, "\n");; + padded = num; +} + +/* determine whether a certain element is contained within a given list */ +static bool list_contains_key(element *list, int key) { + element *step = NULL; + + step = list; + while ( step != NULL ) { + if (step->key == key) { + return TRUE; + } + if (step->children != NULL) { + if (list_contains_key(step->children, key)) { + return TRUE; + } + } + step = step->next; + } + return FALSE; +} + +/********************************************************************** + + Functions for printing Elements as HTML + + ***********************************************************************/ + +/* print_html_string - print string, escaping for HTML + * If obfuscate selected, convert characters to hex or decimal entities at random */ +static void print_html_string(GString *out, char *str, bool obfuscate) { + while (*str != '\0') { + switch (*str) { + case '&': + g_string_append_printf(out, "&"); + break; + case '<': + g_string_append_printf(out, "<"); + break; + case '>': + g_string_append_printf(out, ">"); + break; + case '"': + g_string_append_printf(out, """); + break; + default: + if (obfuscate) { + if (rand() % 2 == 0) + g_string_append_printf(out, "&#%d;", (int) *str); + else + g_string_append_printf(out, "&#x%x;", (unsigned int) *str); + } + else + g_string_append_c(out, *str); + } + str++; + } +} + +/* print_html_element_list - print a list of elements as HTML */ +static void print_html_element_list(GString *out, element *list, bool obfuscate) { + while (list != NULL) { + print_html_element(out, list, obfuscate); + list = list->next; + } +} + +/* add_endnote - add an endnote to global endnotes list. */ +static void add_endnote(element *elt) { + endnotes = g_slist_prepend(endnotes, elt); +} + +/* print_html_element - print an element as HTML */ +static void print_html_element(GString *out, element *elt, bool obfuscate) { + int lev; + switch (elt->key) { + case SPACE: + g_string_append_printf(out, "%s", elt->contents.str); + break; + case LINEBREAK: + g_string_append_printf(out, "
\n"); + break; + case STR: + print_html_string(out, elt->contents.str, obfuscate); + break; + case ELLIPSIS: + g_string_append_printf(out, "…"); + break; + case EMDASH: + g_string_append_printf(out, "—"); + break; + case ENDASH: + g_string_append_printf(out, "–"); + break; + case APOSTROPHE: + g_string_append_printf(out, "’"); + break; + case SINGLEQUOTED: + g_string_append_printf(out, "‘"); + print_html_element_list(out, elt->children, obfuscate); + g_string_append_printf(out, "’"); + break; + case DOUBLEQUOTED: + g_string_append_printf(out, "“"); + print_html_element_list(out, elt->children, obfuscate); + g_string_append_printf(out, "”"); + break; + case CODE: + g_string_append_printf(out, ""); + print_html_string(out, elt->contents.str, obfuscate); + g_string_append_printf(out, ""); + break; + case HTML: + g_string_append_printf(out, "%s", elt->contents.str); + break; + case LINK: + if (strstr(elt->contents.link->url, "mailto:") == elt->contents.link->url) + obfuscate = true; /* obfuscate mailto: links */ + g_string_append_printf(out, "contents.link->url, obfuscate); + g_string_append_printf(out, "\""); + if (strlen(elt->contents.link->title) > 0) { + g_string_append_printf(out, " title=\""); + print_html_string(out, elt->contents.link->title, obfuscate); + g_string_append_printf(out, "\""); + } + g_string_append_printf(out, ">"); + print_html_element_list(out, elt->contents.link->label, obfuscate); + g_string_append_printf(out, ""); + break; + case IMAGE: + g_string_append_printf(out, "contents.link->url, obfuscate); + g_string_append_printf(out, "\" alt=\""); + print_html_element_list(out, elt->contents.link->label, obfuscate); + g_string_append_printf(out, "\""); + if (strlen(elt->contents.link->title) > 0) { + g_string_append_printf(out, " title=\""); + print_html_string(out, elt->contents.link->title, obfuscate); + g_string_append_printf(out, "\""); + } + g_string_append_printf(out, " />"); + break; + case EMPH: + g_string_append_printf(out, ""); + print_html_element_list(out, elt->children, obfuscate); + g_string_append_printf(out, ""); + break; + case STRONG: + g_string_append_printf(out, ""); + print_html_element_list(out, elt->children, obfuscate); + g_string_append_printf(out, ""); + break; + case LIST: + print_html_element_list(out, elt->children, obfuscate); + break; + case RAW: + /* Shouldn't occur - these are handled by process_raw_blocks() */ + assert(elt->key != RAW); + break; + case H1: case H2: case H3: case H4: case H5: case H6: + lev = elt->key - H1 + 1; /* assumes H1 ... H6 are in order */ + pad(out, 2); + g_string_append_printf(out, "", lev); + print_html_element_list(out, elt->children, obfuscate); + g_string_append_printf(out, "", lev); + padded = 0; + break; + case PLAIN: + pad(out, 1); + print_html_element_list(out, elt->children, obfuscate); + padded = 0; + break; + case PARA: + pad(out, 2); + g_string_append_printf(out, "

"); + print_html_element_list(out, elt->children, obfuscate); + g_string_append_printf(out, "

"); + padded = 0; + break; + case HRULE: + pad(out, 2); + g_string_append_printf(out, "
"); + padded = 0; + break; + case HTMLBLOCK: + pad(out, 2); + g_string_append_printf(out, "%s", elt->contents.str); + padded = 0; + break; + case VERBATIM: + pad(out, 2); + g_string_append_printf(out, "%s", "
");
+        print_html_string(out, elt->contents.str, obfuscate);
+        g_string_append_printf(out, "%s", "
"); + padded = 0; + break; + case BULLETLIST: + pad(out, 2); + g_string_append_printf(out, "%s", "
    "); + padded = 0; + print_html_element_list(out, elt->children, obfuscate); + pad(out, 1); + g_string_append_printf(out, "%s", "
"); + padded = 0; + break; + case ORDEREDLIST: + pad(out, 2); + g_string_append_printf(out, "%s", "
    "); + padded = 0; + print_html_element_list(out, elt->children, obfuscate); + pad(out, 1); + g_string_append_printf(out, "
"); + padded = 0; + break; + case LISTITEM: + pad(out, 1); + g_string_append_printf(out, "
  • "); + padded = 2; + print_html_element_list(out, elt->children, obfuscate); + g_string_append_printf(out, "
  • "); + padded = 0; + break; + case BLOCKQUOTE: + pad(out, 2); + g_string_append_printf(out, "
    \n"); + padded = 2; + print_html_element_list(out, elt->children, obfuscate); + pad(out, 1); + g_string_append_printf(out, "
    "); + padded = 0; + break; + case REFERENCE: + /* Nonprinting */ + break; + case NOTE: + /* if contents.str == 0, then print note; else ignore, since this + * is a note block that has been incorporated into the notes list */ + if (elt->contents.str == 0) { + add_endnote(elt); + ++notenumber; + g_string_append_printf(out, "[%d]", + notenumber, notenumber, notenumber, notenumber); + } + break; + default: + fprintf(stderr, "print_html_element encountered unknown element key = %d\n", elt->key); + exit(EXIT_FAILURE); + } +} + +static void print_html_endnotes(GString *out) { + int counter = 0; + GSList *note; + element *note_elt; + if (endnotes == NULL) + return; + note = g_slist_reverse(endnotes); + g_string_append_printf(out, "
    \n
      "); + while (note != NULL) { + note_elt = note->data; + counter++; + pad(out, 1); + g_string_append_printf(out, "
    1. \n", counter); + padded = 2; + print_html_element_list(out, note_elt->children, false); + g_string_append_printf(out, " [back]", counter); + pad(out, 1); + g_string_append_printf(out, "
    2. "); + note = note->next; + } + pad(out, 1); + g_string_append_printf(out, "
    "); + g_slist_free(endnotes); +} + +/********************************************************************** + + Functions for printing Elements as LaTeX + + ***********************************************************************/ + +/* print_latex_string - print string, escaping for LaTeX */ +static void print_latex_string(GString *out, char *str) { + while (*str != '\0') { + switch (*str) { + case '{': case '}': case '$': case '%': + case '&': case '_': case '#': + g_string_append_printf(out, "\\%c", *str); + break; + case '^': + g_string_append_printf(out, "\\^{}"); + break; + case '\\': + g_string_append_printf(out, "\\textbackslash{}"); + break; + case '~': + g_string_append_printf(out, "\\ensuremath{\\sim}"); + break; + case '|': + g_string_append_printf(out, "\\textbar{}"); + break; + case '<': + g_string_append_printf(out, "\\textless{}"); + break; + case '>': + g_string_append_printf(out, "\\textgreater{}"); + break; + default: + g_string_append_c(out, *str); + } + str++; + } +} + +/* print_latex_element_list - print a list of elements as LaTeX */ +static void print_latex_element_list(GString *out, element *list) { + while (list != NULL) { + print_latex_element(out, list); + list = list->next; + } +} + +/* print_latex_element - print an element as LaTeX */ +static void print_latex_element(GString *out, element *elt) { + int lev; + int i; + switch (elt->key) { + case SPACE: + g_string_append_printf(out, "%s", elt->contents.str); + break; + case LINEBREAK: + g_string_append_printf(out, "\\\\\n"); + break; + case STR: + print_latex_string(out, elt->contents.str); + break; + case ELLIPSIS: + g_string_append_printf(out, "\\ldots{}"); + break; + case EMDASH: + g_string_append_printf(out, "---"); + break; + case ENDASH: + g_string_append_printf(out, "--"); + break; + case APOSTROPHE: + g_string_append_printf(out, "'"); + break; + case SINGLEQUOTED: + g_string_append_printf(out, "`"); + print_latex_element_list(out, elt->children); + g_string_append_printf(out, "'"); + break; + case DOUBLEQUOTED: + g_string_append_printf(out, "``"); + print_latex_element_list(out, elt->children); + g_string_append_printf(out, "''"); + break; + case CODE: + g_string_append_printf(out, "\\texttt{"); + print_latex_string(out, elt->contents.str); + g_string_append_printf(out, "}"); + break; + case HTML: + /* don't print HTML */ + break; + case LINK: + g_string_append_printf(out, "\\href{%s}{", elt->contents.link->url); + print_latex_element_list(out, elt->contents.link->label); + g_string_append_printf(out, "}"); + break; + case IMAGE: + g_string_append_printf(out, "\\includegraphics{%s}", elt->contents.link->url); + break; + case EMPH: + g_string_append_printf(out, "\\emph{"); + print_latex_element_list(out, elt->children); + g_string_append_printf(out, "}"); + break; + case STRONG: + g_string_append_printf(out, "\\textbf{"); + print_latex_element_list(out, elt->children); + g_string_append_printf(out, "}"); + break; + case LIST: + print_latex_element_list(out, elt->children); + break; + case RAW: + /* Shouldn't occur - these are handled by process_raw_blocks() */ + assert(elt->key != RAW); + break; + case H1: case H2: case H3: + pad(out, 2); + lev = elt->key - H1 + 1; /* assumes H1 ... H6 are in order */ + g_string_append_printf(out, "\\"); + for (i = elt->key; i > H1; i--) + g_string_append_printf(out, "sub"); + g_string_append_printf(out, "section{"); + print_latex_element_list(out, elt->children); + g_string_append_printf(out, "}"); + padded = 0; + break; + case H4: case H5: case H6: + pad(out, 2); + g_string_append_printf(out, "\\noindent\\textbf{"); + print_latex_element_list(out, elt->children); + g_string_append_printf(out, "}"); + padded = 0; + break; + case PLAIN: + pad(out, 1); + print_latex_element_list(out, elt->children); + padded = 0; + break; + case PARA: + pad(out, 2); + print_latex_element_list(out, elt->children); + padded = 0; + break; + case HRULE: + pad(out, 2); + g_string_append_printf(out, "\\begin{center}\\rule{3in}{0.4pt}\\end{center}\n"); + padded = 0; + break; + case HTMLBLOCK: + /* don't print HTML block */ + break; + case VERBATIM: + pad(out, 1); + g_string_append_printf(out, "\\begin{verbatim}\n"); + print_latex_string(out, elt->contents.str); + g_string_append_printf(out, "\n\\end{verbatim}"); + padded = 0; + break; + case BULLETLIST: + pad(out, 1); + g_string_append_printf(out, "\\begin{itemize}"); + padded = 0; + print_latex_element_list(out, elt->children); + pad(out, 1); + g_string_append_printf(out, "\\end{itemize}"); + padded = 0; + break; + case ORDEREDLIST: + pad(out, 1); + g_string_append_printf(out, "\\begin{enumerate}"); + padded = 0; + print_latex_element_list(out, elt->children); + pad(out, 1); + g_string_append_printf(out, "\\end{enumerate}"); + padded = 0; + break; + case LISTITEM: + pad(out, 1); + g_string_append_printf(out, "\\item "); + padded = 2; + print_latex_element_list(out, elt->children); + g_string_append_printf(out, "\n"); + break; + case BLOCKQUOTE: + pad(out, 1); + g_string_append_printf(out, "\\begin{quote}"); + padded = 0; + print_latex_element_list(out, elt->children); + pad(out, 1); + g_string_append_printf(out, "\\end{quote}"); + padded = 0; + break; + case NOTE: + /* if contents.str == 0, then print note; else ignore, since this + * is a note block that has been incorporated into the notes list */ + if (elt->contents.str == 0) { + g_string_append_printf(out, "\\footnote{"); + padded = 2; + print_latex_element_list(out, elt->children); + g_string_append_printf(out, "}"); + padded = 0; + } + break; + case REFERENCE: + /* Nonprinting */ + break; + default: + fprintf(stderr, "print_latex_element encountered unknown element key = %d\n", elt->key); + exit(EXIT_FAILURE); + } +} + +/********************************************************************** + + Functions for printing Elements as groff (mm macros) + + ***********************************************************************/ + +static bool in_list_item = false; /* True if we're parsing contents of a list item. */ + +/* print_groff_string - print string, escaping for groff */ +static void print_groff_string(GString *out, char *str) { + while (*str != '\0') { + switch (*str) { + case '\\': + g_string_append_printf(out, "\\e"); + break; + default: + g_string_append_c(out, *str); + } + str++; + } +} + +/* print_groff_mm_element_list - print a list of elements as groff ms */ +static void print_groff_mm_element_list(GString *out, element *list) { + int count = 1; + while (list != NULL) { + print_groff_mm_element(out, list, count); + list = list->next; + count++; + } +} + +/* print_groff_mm_element - print an element as groff ms */ +static void print_groff_mm_element(GString *out, element *elt, int count) { + int lev; + switch (elt->key) { + case SPACE: + g_string_append_printf(out, "%s", elt->contents.str); + padded = 0; + break; + case LINEBREAK: + pad(out, 1); + g_string_append_printf(out, ".br\n"); + padded = 0; + break; + case STR: + print_groff_string(out, elt->contents.str); + padded = 0; + break; + case ELLIPSIS: + g_string_append_printf(out, "..."); + break; + case EMDASH: + g_string_append_printf(out, "\\[em]"); + break; + case ENDASH: + g_string_append_printf(out, "\\[en]"); + break; + case APOSTROPHE: + g_string_append_printf(out, "'"); + break; + case SINGLEQUOTED: + g_string_append_printf(out, "`"); + print_groff_mm_element_list(out, elt->children); + g_string_append_printf(out, "'"); + break; + case DOUBLEQUOTED: + g_string_append_printf(out, "\\[lq]"); + print_groff_mm_element_list(out, elt->children); + g_string_append_printf(out, "\\[rq]"); + break; + case CODE: + g_string_append_printf(out, "\\fC"); + print_groff_string(out, elt->contents.str); + g_string_append_printf(out, "\\fR"); + padded = 0; + break; + case HTML: + /* don't print HTML */ + break; + case LINK: + print_groff_mm_element_list(out, elt->contents.link->label); + g_string_append_printf(out, " (%s)", elt->contents.link->url); + padded = 0; + break; + case IMAGE: + g_string_append_printf(out, "[IMAGE: "); + print_groff_mm_element_list(out, elt->contents.link->label); + g_string_append_printf(out, "]"); + padded = 0; + /* not supported */ + break; + case EMPH: + g_string_append_printf(out, "\\fI"); + print_groff_mm_element_list(out, elt->children); + g_string_append_printf(out, "\\fR"); + padded = 0; + break; + case STRONG: + g_string_append_printf(out, "\\fB"); + print_groff_mm_element_list(out, elt->children); + g_string_append_printf(out, "\\fR"); + padded = 0; + break; + case LIST: + print_groff_mm_element_list(out, elt->children); + padded = 0; + break; + case RAW: + /* Shouldn't occur - these are handled by process_raw_blocks() */ + assert(elt->key != RAW); + break; + case H1: case H2: case H3: case H4: case H5: case H6: + lev = elt->key - H1 + 1; + pad(out, 1); + g_string_append_printf(out, ".H %d \"", lev); + print_groff_mm_element_list(out, elt->children); + g_string_append_printf(out, "\""); + padded = 0; + break; + case PLAIN: + pad(out, 1); + print_groff_mm_element_list(out, elt->children); + padded = 0; + break; + case PARA: + pad(out, 1); + if (!in_list_item || count != 1) + g_string_append_printf(out, ".P\n"); + print_groff_mm_element_list(out, elt->children); + padded = 0; + break; + case HRULE: + pad(out, 1); + g_string_append_printf(out, "\\l'\\n(.lu*8u/10u'"); + padded = 0; + break; + case HTMLBLOCK: + /* don't print HTML block */ + break; + case VERBATIM: + pad(out, 1); + g_string_append_printf(out, ".VERBON 2\n"); + print_groff_string(out, elt->contents.str); + g_string_append_printf(out, ".VERBOFF"); + padded = 0; + break; + case BULLETLIST: + pad(out, 1); + g_string_append_printf(out, ".BL"); + padded = 0; + print_groff_mm_element_list(out, elt->children); + pad(out, 1); + g_string_append_printf(out, ".LE 1"); + padded = 0; + break; + case ORDEREDLIST: + pad(out, 1); + g_string_append_printf(out, ".AL"); + padded = 0; + print_groff_mm_element_list(out, elt->children); + pad(out, 1); + g_string_append_printf(out, ".LE 1"); + padded = 0; + break; + case LISTITEM: + pad(out, 1); + g_string_append_printf(out, ".LI\n"); + in_list_item = true; + padded = 2; + print_groff_mm_element_list(out, elt->children); + in_list_item = false; + break; + case BLOCKQUOTE: + pad(out, 1); + g_string_append_printf(out, ".DS I\n"); + padded = 2; + print_groff_mm_element_list(out, elt->children); + pad(out, 1); + g_string_append_printf(out, ".DE"); + padded = 0; + break; + case NOTE: + /* if contents.str == 0, then print note; else ignore, since this + * is a note block that has been incorporated into the notes list */ + if (elt->contents.str == 0) { + g_string_append_printf(out, "\\*F\n"); + g_string_append_printf(out, ".FS\n"); + padded = 2; + print_groff_mm_element_list(out, elt->children); + pad(out, 1); + g_string_append_printf(out, ".FE\n"); + padded = 1; + } + break; + case REFERENCE: + /* Nonprinting */ + break; + default: + fprintf(stderr, "print_groff_mm_element encountered unknown element key = %d\n", elt->key); + exit(EXIT_FAILURE); + } +} + +/********************************************************************** + + Functions for printing Elements as ODF + + ***********************************************************************/ + +/* print_odf_code_string - print string, escaping for HTML and saving newlines +*/ +static void print_odf_code_string(GString *out, char *str) { + char *tmp; + while (*str != '\0') { + switch (*str) { + case '&': + g_string_append_printf(out, "&"); + break; + case '<': + g_string_append_printf(out, "<"); + break; + case '>': + g_string_append_printf(out, ">"); + break; + case '"': + g_string_append_printf(out, """); + break; + case '\n': + g_string_append_printf(out, ""); + break; + case ' ': + tmp = str; + tmp++; + if (*tmp == ' ') { + tmp++; + if (*tmp == ' ') { + tmp++; + if (*tmp == ' ') { + g_string_append_printf(out, ""); + str = tmp; + } else { + g_string_append_printf(out, " "); + } + } else { + g_string_append_printf(out, " "); + } + } else { + g_string_append_printf(out, " "); + } + break; + default: + g_string_append_c(out, *str); + } + str++; + } +} + +/* print_odf_string - print string, escaping for HTML and saving newlines */ +static void print_odf_string(GString *out, char *str) { + char *tmp; + while (*str != '\0') { + switch (*str) { + case '&': + g_string_append_printf(out, "&"); + break; + case '<': + g_string_append_printf(out, "<"); + break; + case '>': + g_string_append_printf(out, ">"); + break; + case '"': + g_string_append_printf(out, """); + break; + case '\n': + tmp = str; + tmp--; + if (*tmp == ' ') { + tmp--; + if (*tmp == ' ') { + g_string_append_printf(out, ""); + } else { + g_string_append_printf(out, "\n"); + } + } else { + g_string_append_printf(out, "\n"); + } + break; + case ' ': + tmp = str; + tmp++; + if (*tmp == ' ') { + tmp++; + if (*tmp == ' ') { + tmp++; + if (*tmp == ' ') { + g_string_append_printf(out, ""); + str = tmp; + } else { + g_string_append_printf(out, " "); + } + } else { + g_string_append_printf(out, " "); + } + } else { + g_string_append_printf(out, " "); + } + break; + default: + g_string_append_c(out, *str); + } + str++; + } +} + +/* print_odf_element_list - print an element list as ODF */ +static void print_odf_element_list(GString *out, element *list) { + while (list != NULL) { + print_odf_element(out, list); + list = list->next; + } +} + +/* print_odf_element - print an element as ODF */ +static void print_odf_element(GString *out, element *elt) { + int lev; + int old_type = 0; + switch (elt->key) { + case SPACE: + g_string_append_printf(out, "%s", elt->contents.str); + break; + case LINEBREAK: + g_string_append_printf(out, ""); + break; + case STR: + print_html_string(out, elt->contents.str, 0); + break; + case ELLIPSIS: + g_string_append_printf(out, "…"); + break; + case EMDASH: + g_string_append_printf(out, "—"); + break; + case ENDASH: + g_string_append_printf(out, "–"); + break; + case APOSTROPHE: + g_string_append_printf(out, "’"); + break; + case SINGLEQUOTED: + g_string_append_printf(out, "‘"); + print_odf_element_list(out, elt->children); + g_string_append_printf(out, "’"); + break; + case DOUBLEQUOTED: + g_string_append_printf(out, "“"); + print_odf_element_list(out, elt->children); + g_string_append_printf(out, "”"); + break; + case CODE: + g_string_append_printf(out, ""); + print_html_string(out, elt->contents.str, 0); + g_string_append_printf(out, ""); + break; + case HTML: + break; + case LINK: + g_string_append_printf(out, "contents.link->url, 0); + g_string_append_printf(out, "\""); + if (strlen(elt->contents.link->title) > 0) { + g_string_append_printf(out, " office:name=\""); + print_html_string(out, elt->contents.link->title, 0); + g_string_append_printf(out, "\""); + } + g_string_append_printf(out, ">"); + print_odf_element_list(out, elt->contents.link->label); + g_string_append_printf(out, ""); + break; + case IMAGE: + g_string_append_printf(out, "\ncontents.link->url); + g_string_append_printf(out,"\" xlink:type=\"simple\" xlink:show=\"embed\" xlink:actuate=\"onLoad\" draw:filter-name=\"<All formats>\"/>\n"); + g_string_append_printf(out, "\n"); + break; + case EMPH: + g_string_append_printf(out, + ""); + print_odf_element_list(out, elt->children); + g_string_append_printf(out, ""); + break; + case STRONG: + g_string_append_printf(out, + ""); + print_odf_element_list(out, elt->children); + g_string_append_printf(out, ""); + break; + case LIST: + print_odf_element_list(out, elt->children); + break; + case RAW: + /* Shouldn't occur - these are handled by process_raw_blocks() */ + assert(elt->key != RAW); + break; + case H1: case H2: case H3: case H4: case H5: case H6: + lev = elt->key - H1 + 1; /* assumes H1 ... H6 are in order */ + g_string_append_printf(out, "", lev); + print_odf_element_list(out, elt->children); + g_string_append_printf(out, "\n"); + padded = 0; + break; + case PLAIN: + print_odf_element_list(out, elt->children); + padded = 0; + break; + case PARA: + g_string_append_printf(out, ""); + print_odf_element_list(out, elt->children); + g_string_append_printf(out, "\n"); + break; + case HRULE: + g_string_append_printf(out,"\n"); + break; + case HTMLBLOCK: + /* don't print HTML block */ + /* but do print HTML comments for raw ODF */ + if (strncmp(elt->contents.str,"" from end */ + elt->contents.str[strlen(elt->contents.str)-3] = '\0'; + g_string_append_printf(out, "%s", &elt->contents.str[4]); + } + break; + case VERBATIM: + old_type = odf_type; + odf_type = VERBATIM; + g_string_append_printf(out, ""); + print_odf_code_string(out, elt->contents.str); + g_string_append_printf(out, "\n"); + odf_type = old_type; + break; + case BULLETLIST: + if ((odf_type == BULLETLIST) || + (odf_type == ORDEREDLIST)) { + /* I think this was made unnecessary by another change. + Same for ORDEREDLIST below */ + /* g_string_append_printf(out, ""); */ + } + old_type = odf_type; + odf_type = BULLETLIST; + g_string_append_printf(out, "%s", ""); + print_odf_element_list(out, elt->children); + g_string_append_printf(out, "%s", ""); + odf_type = old_type; + break; + case ORDEREDLIST: + if ((odf_type == BULLETLIST) || + (odf_type == ORDEREDLIST)) { + /* g_string_append_printf(out, ""); */ + } + old_type = odf_type; + odf_type = ORDEREDLIST; + g_string_append_printf(out, "%s", "\n"); + print_odf_element_list(out, elt->children); + g_string_append_printf(out, "%s", "\n"); + odf_type = old_type; + break; + case LISTITEM: + g_string_append_printf(out, "\n"); + if (elt->children->children->key != PARA) { + g_string_append_printf(out, ""); + } + print_odf_element_list(out, elt->children); + + if ((list_contains_key(elt->children,BULLETLIST) || + (list_contains_key(elt->children,ORDEREDLIST)))) { + } else { + if (elt->children->children->key != PARA) { + g_string_append_printf(out, ""); + } + } + g_string_append_printf(out, "\n"); + break; + case BLOCKQUOTE: + old_type = odf_type; + odf_type = BLOCKQUOTE; + print_odf_element_list(out, elt->children); + odf_type = old_type; + break; + case REFERENCE: + break; + case NOTE: + old_type = odf_type; + odf_type = NOTE; + /* if contents.str == 0 then print; else ignore - like above */ + if (elt->contents.str == 0) { + g_string_append_printf(out, "\n"); + print_odf_element_list(out, elt->children); + g_string_append_printf(out, "\n\n"); + } + elt->children = NULL; + odf_type = old_type; + break; + break; default: + fprintf(stderr, "print_odf_element encountered unknown element key = %d\n", elt->key); + exit(EXIT_FAILURE); + } +} + +/********************************************************************** + + Parameterized function for printing an Element. + + ***********************************************************************/ + +void print_element_list(GString *out, element *elt, int format, int exts) { + /* Initialize globals */ + endnotes = NULL; + notenumber = 0; + + extensions = exts; + padded = 2; /* set padding to 2, so no extra blank lines at beginning */ + switch (format) { + case HTML_FORMAT: + print_html_element_list(out, elt, false); + if (endnotes != NULL) { + pad(out, 2); + print_html_endnotes(out); + } + break; + case LATEX_FORMAT: + print_latex_element_list(out, elt); + break; + case GROFF_MM_FORMAT: + print_groff_mm_element_list(out, elt); + break; + case ODF_FORMAT: + print_odf_header(out); + g_string_append_printf(out, "\n\n"); + if (elt != NULL) print_odf_element_list(out,elt); + print_odf_footer(out); + break; + default: + fprintf(stderr, "print_element - unknown format = %d\n", format); + exit(EXIT_FAILURE); + } +} diff --git a/supportlibs/pegmarkdown/markdown_parser.c b/supportlibs/pegmarkdown/markdown_parser.c new file mode 100644 index 000000000..582b35c3c --- /dev/null +++ b/supportlibs/pegmarkdown/markdown_parser.c @@ -0,0 +1,6665 @@ +/* A recursive-descent parser generated by peg 0.1.9 */ + +#include +#include +#include +#define YYRULECOUNT 237 + +/********************************************************************** + + markdown_parser.leg - markdown parser in C using a PEG grammar. + (c) 2008 John MacFarlane (jgm at berkeley dot edu). + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License or the MIT + license. See LICENSE for details. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + ***********************************************************************/ + +#include +#include +#include "markdown_peg.h" +#include "utility_functions.h" + + + +/********************************************************************** + + Definitions for leg parser generator. + YY_INPUT is the function the parser calls to get new input. + We take all new input from (static) charbuf. + + ***********************************************************************/ + + + +# define YYSTYPE element * +#ifdef __DEBUG__ +# define YY_DEBUG 1 +#endif + +#define YY_INPUT(buf, result, max_size) \ +{ \ + int yyc; \ + if (charbuf && *charbuf != '\0') { \ + yyc= *charbuf++; \ + } else { \ + yyc= EOF; \ + } \ + result= (EOF == yyc) ? 0 : (*(buf)= yyc, 1); \ +} + +#define YY_RULE(T) T + + +/********************************************************************** + + PEG grammar and parser actions for markdown syntax. + + ***********************************************************************/ + + +#ifndef YY_LOCAL +#define YY_LOCAL(T) static T +#endif +#ifndef YY_ACTION +#define YY_ACTION(T) static T +#endif +#ifndef YY_RULE +#define YY_RULE(T) static T +#endif +#ifndef YY_PARSE +#define YY_PARSE(T) T +#endif +#ifndef YYPARSE +#define YYPARSE yyparse +#endif +#ifndef YYPARSEFROM +#define YYPARSEFROM yyparsefrom +#endif +#ifndef YY_INPUT +#define YY_INPUT(buf, result, max_size) \ + { \ + int yyc= getchar(); \ + result= (EOF == yyc) ? 0 : (*(buf)= yyc, 1); \ + yyprintf((stderr, "<%c>", yyc)); \ + } +#endif +#ifndef YY_BEGIN +#define YY_BEGIN ( ctx->begin= ctx->pos, 1) +#endif +#ifndef YY_END +#define YY_END ( ctx->end= ctx->pos, 1) +#endif +#ifdef YY_DEBUG +# define yyprintf(args) fprintf args +#else +# define yyprintf(args) +#endif +#ifndef YYSTYPE +#define YYSTYPE int +#endif + +#ifndef YY_PART + +typedef struct _yycontext yycontext; +typedef void (*yyaction)(yycontext *ctx, char *yytext, int yyleng); +typedef struct _yythunk { int begin, end; yyaction action; struct _yythunk *next; } yythunk; + +struct _yycontext { + char *buf; + int buflen; + int pos; + int limit; + char *text; + int textlen; + int begin; + int end; + int textmax; + yythunk *thunks; + int thunkslen; + int thunkpos; + YYSTYPE yy; + YYSTYPE *val; + YYSTYPE *vals; + int valslen; +#ifdef YY_CTX_MEMBERS + YY_CTX_MEMBERS +#endif +}; + +#ifdef YY_CTX_LOCAL +#define YY_CTX_PARAM_ yycontext *yyctx, +#define YY_CTX_PARAM yycontext *yyctx +#define YY_CTX_ARG_ yyctx, +#define YY_CTX_ARG yyctx +#else +#define YY_CTX_PARAM_ +#define YY_CTX_PARAM +#define YY_CTX_ARG_ +#define YY_CTX_ARG +yycontext yyctx0; +yycontext *yyctx= &yyctx0; +#endif + +YY_LOCAL(int) yyrefill(yycontext *ctx) +{ + int yyn; + while (ctx->buflen - ctx->pos < 512) + { + ctx->buflen *= 2; + ctx->buf= (char *)realloc(ctx->buf, ctx->buflen); + } + YY_INPUT((ctx->buf + ctx->pos), yyn, (ctx->buflen - ctx->pos)); + if (!yyn) return 0; + ctx->limit += yyn; + return 1; +} + +YY_LOCAL(int) yymatchDot(yycontext *ctx) +{ + if (ctx->pos >= ctx->limit && !yyrefill(ctx)) return 0; + ++ctx->pos; + return 1; +} + +YY_LOCAL(int) yymatchChar(yycontext *ctx, int c) +{ + if (ctx->pos >= ctx->limit && !yyrefill(ctx)) return 0; + if ((unsigned char)ctx->buf[ctx->pos] == c) + { + ++ctx->pos; + yyprintf((stderr, " ok yymatchChar(ctx, %c) @ %s\n", c, ctx->buf+ctx->pos)); + return 1; + } + yyprintf((stderr, " fail yymatchChar(ctx, %c) @ %s\n", c, ctx->buf+ctx->pos)); + return 0; +} + +YY_LOCAL(int) yymatchString(yycontext *ctx, char *s) +{ + int yysav= ctx->pos; + while (*s) + { + if (ctx->pos >= ctx->limit && !yyrefill(ctx)) return 0; + if (ctx->buf[ctx->pos] != *s) + { + ctx->pos= yysav; + return 0; + } + ++s; + ++ctx->pos; + } + return 1; +} + +YY_LOCAL(int) yymatchClass(yycontext *ctx, unsigned char *bits) +{ + int c; + if (ctx->pos >= ctx->limit && !yyrefill(ctx)) return 0; + c= (unsigned char)ctx->buf[ctx->pos]; + if (bits[c >> 3] & (1 << (c & 7))) + { + ++ctx->pos; + yyprintf((stderr, " ok yymatchClass @ %s\n", ctx->buf+ctx->pos)); + return 1; + } + yyprintf((stderr, " fail yymatchClass @ %s\n", ctx->buf+ctx->pos)); + return 0; +} + +YY_LOCAL(void) yyDo(yycontext *ctx, yyaction action, int begin, int end) +{ + while (ctx->thunkpos >= ctx->thunkslen) + { + ctx->thunkslen *= 2; + ctx->thunks= (yythunk *)realloc(ctx->thunks, sizeof(yythunk) * ctx->thunkslen); + } + ctx->thunks[ctx->thunkpos].begin= begin; + ctx->thunks[ctx->thunkpos].end= end; + ctx->thunks[ctx->thunkpos].action= action; + ++ctx->thunkpos; +} + +YY_LOCAL(int) yyText(yycontext *ctx, int begin, int end) +{ + int yyleng= end - begin; + if (yyleng <= 0) + yyleng= 0; + else + { + while (ctx->textlen < (yyleng + 1)) + { + ctx->textlen *= 2; + ctx->text= (char *)realloc(ctx->text, ctx->textlen); + } + memcpy(ctx->text, ctx->buf + begin, yyleng); + } + ctx->text[yyleng]= '\0'; + return yyleng; +} + +YY_LOCAL(void) yyDone(yycontext *ctx) +{ + int pos; + for (pos= 0; pos < ctx->thunkpos; ++pos) + { + yythunk *thunk= &ctx->thunks[pos]; + int yyleng= thunk->end ? yyText(ctx, thunk->begin, thunk->end) : thunk->begin; + yyprintf((stderr, "DO [%d] %p %s\n", pos, thunk->action, ctx->text)); + thunk->action(ctx, ctx->text, yyleng); + } + ctx->thunkpos= 0; +} + +YY_LOCAL(void) yyCommit(yycontext *ctx) +{ + if ((ctx->limit -= ctx->pos)) + { + memmove(ctx->buf, ctx->buf + ctx->pos, ctx->limit); + } + ctx->begin -= ctx->pos; + ctx->end -= ctx->pos; + ctx->pos= ctx->thunkpos= 0; +} + +YY_LOCAL(int) yyAccept(yycontext *ctx, int tp0) +{ + if (tp0) + { + fprintf(stderr, "accept denied at %d\n", tp0); + return 0; + } + else + { + yyDone(ctx); + yyCommit(ctx); + } + return 1; +} + +YY_LOCAL(void) yyPush(yycontext *ctx, char *text, int count) { ctx->val += count; } +YY_LOCAL(void) yyPop(yycontext *ctx, char *text, int count) { ctx->val -= count; } +YY_LOCAL(void) yySet(yycontext *ctx, char *text, int count) { ctx->val[count]= ctx->yy; } + +#endif /* YY_PART */ + +#define YYACCEPT yyAccept(ctx, yythunkpos0) + +YY_RULE(int) yy_Notes(yycontext *ctx); /* 237 */ +YY_RULE(int) yy_RawNoteBlock(yycontext *ctx); /* 236 */ +YY_RULE(int) yy_RawNoteReference(yycontext *ctx); /* 235 */ +YY_RULE(int) yy_DoubleQuoteEnd(yycontext *ctx); /* 234 */ +YY_RULE(int) yy_DoubleQuoteStart(yycontext *ctx); /* 233 */ +YY_RULE(int) yy_SingleQuoteEnd(yycontext *ctx); /* 232 */ +YY_RULE(int) yy_SingleQuoteStart(yycontext *ctx); /* 231 */ +YY_RULE(int) yy_EnDash(yycontext *ctx); /* 230 */ +YY_RULE(int) yy_EmDash(yycontext *ctx); /* 229 */ +YY_RULE(int) yy_Apostrophe(yycontext *ctx); /* 228 */ +YY_RULE(int) yy_DoubleQuoted(yycontext *ctx); /* 227 */ +YY_RULE(int) yy_SingleQuoted(yycontext *ctx); /* 226 */ +YY_RULE(int) yy_Dash(yycontext *ctx); /* 225 */ +YY_RULE(int) yy_Ellipsis(yycontext *ctx); /* 224 */ +YY_RULE(int) yy_Digit(yycontext *ctx); /* 223 */ +YY_RULE(int) yy_ExtendedSpecialChar(yycontext *ctx); /* 222 */ +YY_RULE(int) yy_AlphanumericAscii(yycontext *ctx); /* 221 */ +YY_RULE(int) yy_Quoted(yycontext *ctx); /* 220 */ +YY_RULE(int) yy_HtmlTag(yycontext *ctx); /* 219 */ +YY_RULE(int) yy_Ticks5(yycontext *ctx); /* 218 */ +YY_RULE(int) yy_Ticks4(yycontext *ctx); /* 217 */ +YY_RULE(int) yy_Ticks3(yycontext *ctx); /* 216 */ +YY_RULE(int) yy_Ticks2(yycontext *ctx); /* 215 */ +YY_RULE(int) yy_Ticks1(yycontext *ctx); /* 214 */ +YY_RULE(int) yy_SkipBlock(yycontext *ctx); /* 213 */ +YY_RULE(int) yy_References(yycontext *ctx); /* 212 */ +YY_RULE(int) yy_EmptyTitle(yycontext *ctx); /* 211 */ +YY_RULE(int) yy_RefTitleParens(yycontext *ctx); /* 210 */ +YY_RULE(int) yy_RefTitleDouble(yycontext *ctx); /* 209 */ +YY_RULE(int) yy_RefTitleSingle(yycontext *ctx); /* 208 */ +YY_RULE(int) yy_RefTitle(yycontext *ctx); /* 207 */ +YY_RULE(int) yy_RefSrc(yycontext *ctx); /* 206 */ +YY_RULE(int) yy_AutoLinkEmail(yycontext *ctx); /* 205 */ +YY_RULE(int) yy_AutoLinkUrl(yycontext *ctx); /* 204 */ +YY_RULE(int) yy_TitleDouble(yycontext *ctx); /* 203 */ +YY_RULE(int) yy_TitleSingle(yycontext *ctx); /* 202 */ +YY_RULE(int) yy_Nonspacechar(yycontext *ctx); /* 201 */ +YY_RULE(int) yy_SourceContents(yycontext *ctx); /* 200 */ +YY_RULE(int) yy_Title(yycontext *ctx); /* 199 */ +YY_RULE(int) yy_Source(yycontext *ctx); /* 198 */ +YY_RULE(int) yy_Label(yycontext *ctx); /* 197 */ +YY_RULE(int) yy_ReferenceLinkSingle(yycontext *ctx); /* 196 */ +YY_RULE(int) yy_ReferenceLinkDouble(yycontext *ctx); /* 195 */ +YY_RULE(int) yy_AutoLink(yycontext *ctx); /* 194 */ +YY_RULE(int) yy_ReferenceLink(yycontext *ctx); /* 193 */ +YY_RULE(int) yy_ExplicitLink(yycontext *ctx); /* 192 */ +YY_RULE(int) yy_StrongUl(yycontext *ctx); /* 191 */ +YY_RULE(int) yy_StrongStar(yycontext *ctx); /* 190 */ +YY_RULE(int) yy_Whitespace(yycontext *ctx); /* 189 */ +YY_RULE(int) yy_EmphUl(yycontext *ctx); /* 188 */ +YY_RULE(int) yy_EmphStar(yycontext *ctx); /* 187 */ +YY_RULE(int) yy_StarLine(yycontext *ctx); /* 186 */ +YY_RULE(int) yy_UlLine(yycontext *ctx); /* 185 */ +YY_RULE(int) yy_SpecialChar(yycontext *ctx); /* 184 */ +YY_RULE(int) yy_Eof(yycontext *ctx); /* 183 */ +YY_RULE(int) yy_NormalEndline(yycontext *ctx); /* 182 */ +YY_RULE(int) yy_TerminalEndline(yycontext *ctx); /* 181 */ +YY_RULE(int) yy_LineBreak(yycontext *ctx); /* 180 */ +YY_RULE(int) yy_CharEntity(yycontext *ctx); /* 179 */ +YY_RULE(int) yy_DecEntity(yycontext *ctx); /* 178 */ +YY_RULE(int) yy_HexEntity(yycontext *ctx); /* 177 */ +YY_RULE(int) yy_AposChunk(yycontext *ctx); /* 176 */ +YY_RULE(int) yy_Alphanumeric(yycontext *ctx); /* 175 */ +YY_RULE(int) yy_StrChunk(yycontext *ctx); /* 174 */ +YY_RULE(int) yy_NormalChar(yycontext *ctx); /* 173 */ +YY_RULE(int) yy_Symbol(yycontext *ctx); /* 172 */ +YY_RULE(int) yy_Smart(yycontext *ctx); /* 171 */ +YY_RULE(int) yy_EscapedChar(yycontext *ctx); /* 170 */ +YY_RULE(int) yy_Entity(yycontext *ctx); /* 169 */ +YY_RULE(int) yy_RawHtml(yycontext *ctx); /* 168 */ +YY_RULE(int) yy_Code(yycontext *ctx); /* 167 */ +YY_RULE(int) yy_InlineNote(yycontext *ctx); /* 166 */ +YY_RULE(int) yy_NoteReference(yycontext *ctx); /* 165 */ +YY_RULE(int) yy_Link(yycontext *ctx); /* 164 */ +YY_RULE(int) yy_Image(yycontext *ctx); /* 163 */ +YY_RULE(int) yy_Emph(yycontext *ctx); /* 162 */ +YY_RULE(int) yy_Strong(yycontext *ctx); /* 161 */ +YY_RULE(int) yy_Space(yycontext *ctx); /* 160 */ +YY_RULE(int) yy_UlOrStarLine(yycontext *ctx); /* 159 */ +YY_RULE(int) yy_Str(yycontext *ctx); /* 158 */ +YY_RULE(int) yy_InStyleTags(yycontext *ctx); /* 157 */ +YY_RULE(int) yy_StyleClose(yycontext *ctx); /* 156 */ +YY_RULE(int) yy_StyleOpen(yycontext *ctx); /* 155 */ +YY_RULE(int) yy_HtmlBlockType(yycontext *ctx); /* 154 */ +YY_RULE(int) yy_HtmlBlockSelfClosing(yycontext *ctx); /* 153 */ +YY_RULE(int) yy_HtmlComment(yycontext *ctx); /* 152 */ +YY_RULE(int) yy_HtmlBlockInTags(yycontext *ctx); /* 151 */ +YY_RULE(int) yy_HtmlBlockScript(yycontext *ctx); /* 150 */ +YY_RULE(int) yy_HtmlBlockCloseScript(yycontext *ctx); /* 149 */ +YY_RULE(int) yy_HtmlBlockOpenScript(yycontext *ctx); /* 148 */ +YY_RULE(int) yy_HtmlBlockTr(yycontext *ctx); /* 147 */ +YY_RULE(int) yy_HtmlBlockCloseTr(yycontext *ctx); /* 146 */ +YY_RULE(int) yy_HtmlBlockOpenTr(yycontext *ctx); /* 145 */ +YY_RULE(int) yy_HtmlBlockThead(yycontext *ctx); /* 144 */ +YY_RULE(int) yy_HtmlBlockCloseThead(yycontext *ctx); /* 143 */ +YY_RULE(int) yy_HtmlBlockOpenThead(yycontext *ctx); /* 142 */ +YY_RULE(int) yy_HtmlBlockTh(yycontext *ctx); /* 141 */ +YY_RULE(int) yy_HtmlBlockCloseTh(yycontext *ctx); /* 140 */ +YY_RULE(int) yy_HtmlBlockOpenTh(yycontext *ctx); /* 139 */ +YY_RULE(int) yy_HtmlBlockTfoot(yycontext *ctx); /* 138 */ +YY_RULE(int) yy_HtmlBlockCloseTfoot(yycontext *ctx); /* 137 */ +YY_RULE(int) yy_HtmlBlockOpenTfoot(yycontext *ctx); /* 136 */ +YY_RULE(int) yy_HtmlBlockTd(yycontext *ctx); /* 135 */ +YY_RULE(int) yy_HtmlBlockCloseTd(yycontext *ctx); /* 134 */ +YY_RULE(int) yy_HtmlBlockOpenTd(yycontext *ctx); /* 133 */ +YY_RULE(int) yy_HtmlBlockTbody(yycontext *ctx); /* 132 */ +YY_RULE(int) yy_HtmlBlockCloseTbody(yycontext *ctx); /* 131 */ +YY_RULE(int) yy_HtmlBlockOpenTbody(yycontext *ctx); /* 130 */ +YY_RULE(int) yy_HtmlBlockLi(yycontext *ctx); /* 129 */ +YY_RULE(int) yy_HtmlBlockCloseLi(yycontext *ctx); /* 128 */ +YY_RULE(int) yy_HtmlBlockOpenLi(yycontext *ctx); /* 127 */ +YY_RULE(int) yy_HtmlBlockFrameset(yycontext *ctx); /* 126 */ +YY_RULE(int) yy_HtmlBlockCloseFrameset(yycontext *ctx); /* 125 */ +YY_RULE(int) yy_HtmlBlockOpenFrameset(yycontext *ctx); /* 124 */ +YY_RULE(int) yy_HtmlBlockDt(yycontext *ctx); /* 123 */ +YY_RULE(int) yy_HtmlBlockCloseDt(yycontext *ctx); /* 122 */ +YY_RULE(int) yy_HtmlBlockOpenDt(yycontext *ctx); /* 121 */ +YY_RULE(int) yy_HtmlBlockDd(yycontext *ctx); /* 120 */ +YY_RULE(int) yy_HtmlBlockCloseDd(yycontext *ctx); /* 119 */ +YY_RULE(int) yy_HtmlBlockOpenDd(yycontext *ctx); /* 118 */ +YY_RULE(int) yy_HtmlBlockUl(yycontext *ctx); /* 117 */ +YY_RULE(int) yy_HtmlBlockCloseUl(yycontext *ctx); /* 116 */ +YY_RULE(int) yy_HtmlBlockOpenUl(yycontext *ctx); /* 115 */ +YY_RULE(int) yy_HtmlBlockTable(yycontext *ctx); /* 114 */ +YY_RULE(int) yy_HtmlBlockCloseTable(yycontext *ctx); /* 113 */ +YY_RULE(int) yy_HtmlBlockOpenTable(yycontext *ctx); /* 112 */ +YY_RULE(int) yy_HtmlBlockPre(yycontext *ctx); /* 111 */ +YY_RULE(int) yy_HtmlBlockClosePre(yycontext *ctx); /* 110 */ +YY_RULE(int) yy_HtmlBlockOpenPre(yycontext *ctx); /* 109 */ +YY_RULE(int) yy_HtmlBlockP(yycontext *ctx); /* 108 */ +YY_RULE(int) yy_HtmlBlockCloseP(yycontext *ctx); /* 107 */ +YY_RULE(int) yy_HtmlBlockOpenP(yycontext *ctx); /* 106 */ +YY_RULE(int) yy_HtmlBlockOl(yycontext *ctx); /* 105 */ +YY_RULE(int) yy_HtmlBlockCloseOl(yycontext *ctx); /* 104 */ +YY_RULE(int) yy_HtmlBlockOpenOl(yycontext *ctx); /* 103 */ +YY_RULE(int) yy_HtmlBlockNoscript(yycontext *ctx); /* 102 */ +YY_RULE(int) yy_HtmlBlockCloseNoscript(yycontext *ctx); /* 101 */ +YY_RULE(int) yy_HtmlBlockOpenNoscript(yycontext *ctx); /* 100 */ +YY_RULE(int) yy_HtmlBlockNoframes(yycontext *ctx); /* 99 */ +YY_RULE(int) yy_HtmlBlockCloseNoframes(yycontext *ctx); /* 98 */ +YY_RULE(int) yy_HtmlBlockOpenNoframes(yycontext *ctx); /* 97 */ +YY_RULE(int) yy_HtmlBlockMenu(yycontext *ctx); /* 96 */ +YY_RULE(int) yy_HtmlBlockCloseMenu(yycontext *ctx); /* 95 */ +YY_RULE(int) yy_HtmlBlockOpenMenu(yycontext *ctx); /* 94 */ +YY_RULE(int) yy_HtmlBlockH6(yycontext *ctx); /* 93 */ +YY_RULE(int) yy_HtmlBlockCloseH6(yycontext *ctx); /* 92 */ +YY_RULE(int) yy_HtmlBlockOpenH6(yycontext *ctx); /* 91 */ +YY_RULE(int) yy_HtmlBlockH5(yycontext *ctx); /* 90 */ +YY_RULE(int) yy_HtmlBlockCloseH5(yycontext *ctx); /* 89 */ +YY_RULE(int) yy_HtmlBlockOpenH5(yycontext *ctx); /* 88 */ +YY_RULE(int) yy_HtmlBlockH4(yycontext *ctx); /* 87 */ +YY_RULE(int) yy_HtmlBlockCloseH4(yycontext *ctx); /* 86 */ +YY_RULE(int) yy_HtmlBlockOpenH4(yycontext *ctx); /* 85 */ +YY_RULE(int) yy_HtmlBlockH3(yycontext *ctx); /* 84 */ +YY_RULE(int) yy_HtmlBlockCloseH3(yycontext *ctx); /* 83 */ +YY_RULE(int) yy_HtmlBlockOpenH3(yycontext *ctx); /* 82 */ +YY_RULE(int) yy_HtmlBlockH2(yycontext *ctx); /* 81 */ +YY_RULE(int) yy_HtmlBlockCloseH2(yycontext *ctx); /* 80 */ +YY_RULE(int) yy_HtmlBlockOpenH2(yycontext *ctx); /* 79 */ +YY_RULE(int) yy_HtmlBlockH1(yycontext *ctx); /* 78 */ +YY_RULE(int) yy_HtmlBlockCloseH1(yycontext *ctx); /* 77 */ +YY_RULE(int) yy_HtmlBlockOpenH1(yycontext *ctx); /* 76 */ +YY_RULE(int) yy_HtmlBlockForm(yycontext *ctx); /* 75 */ +YY_RULE(int) yy_HtmlBlockCloseForm(yycontext *ctx); /* 74 */ +YY_RULE(int) yy_HtmlBlockOpenForm(yycontext *ctx); /* 73 */ +YY_RULE(int) yy_HtmlBlockFieldset(yycontext *ctx); /* 72 */ +YY_RULE(int) yy_HtmlBlockCloseFieldset(yycontext *ctx); /* 71 */ +YY_RULE(int) yy_HtmlBlockOpenFieldset(yycontext *ctx); /* 70 */ +YY_RULE(int) yy_HtmlBlockDl(yycontext *ctx); /* 69 */ +YY_RULE(int) yy_HtmlBlockCloseDl(yycontext *ctx); /* 68 */ +YY_RULE(int) yy_HtmlBlockOpenDl(yycontext *ctx); /* 67 */ +YY_RULE(int) yy_HtmlBlockDiv(yycontext *ctx); /* 66 */ +YY_RULE(int) yy_HtmlBlockCloseDiv(yycontext *ctx); /* 65 */ +YY_RULE(int) yy_HtmlBlockOpenDiv(yycontext *ctx); /* 64 */ +YY_RULE(int) yy_HtmlBlockDir(yycontext *ctx); /* 63 */ +YY_RULE(int) yy_HtmlBlockCloseDir(yycontext *ctx); /* 62 */ +YY_RULE(int) yy_HtmlBlockOpenDir(yycontext *ctx); /* 61 */ +YY_RULE(int) yy_HtmlBlockCenter(yycontext *ctx); /* 60 */ +YY_RULE(int) yy_HtmlBlockCloseCenter(yycontext *ctx); /* 59 */ +YY_RULE(int) yy_HtmlBlockOpenCenter(yycontext *ctx); /* 58 */ +YY_RULE(int) yy_HtmlBlockBlockquote(yycontext *ctx); /* 57 */ +YY_RULE(int) yy_HtmlBlockCloseBlockquote(yycontext *ctx); /* 56 */ +YY_RULE(int) yy_HtmlBlockOpenBlockquote(yycontext *ctx); /* 55 */ +YY_RULE(int) yy_HtmlBlockAddress(yycontext *ctx); /* 54 */ +YY_RULE(int) yy_HtmlBlockCloseAddress(yycontext *ctx); /* 53 */ +YY_RULE(int) yy_HtmlAttribute(yycontext *ctx); /* 52 */ +YY_RULE(int) yy_Spnl(yycontext *ctx); /* 51 */ +YY_RULE(int) yy_HtmlBlockOpenAddress(yycontext *ctx); /* 50 */ +YY_RULE(int) yy_OptionallyIndentedLine(yycontext *ctx); /* 49 */ +YY_RULE(int) yy_Indent(yycontext *ctx); /* 48 */ +YY_RULE(int) yy_ListBlockLine(yycontext *ctx); /* 47 */ +YY_RULE(int) yy_ListContinuationBlock(yycontext *ctx); /* 46 */ +YY_RULE(int) yy_ListBlock(yycontext *ctx); /* 45 */ +YY_RULE(int) yy_ListItem(yycontext *ctx); /* 44 */ +YY_RULE(int) yy_Enumerator(yycontext *ctx); /* 43 */ +YY_RULE(int) yy_ListItemTight(yycontext *ctx); /* 42 */ +YY_RULE(int) yy_ListLoose(yycontext *ctx); /* 41 */ +YY_RULE(int) yy_ListTight(yycontext *ctx); /* 40 */ +YY_RULE(int) yy_Spacechar(yycontext *ctx); /* 39 */ +YY_RULE(int) yy_Bullet(yycontext *ctx); /* 38 */ +YY_RULE(int) yy_VerbatimChunk(yycontext *ctx); /* 37 */ +YY_RULE(int) yy_IndentedLine(yycontext *ctx); /* 36 */ +YY_RULE(int) yy_NonblankIndentedLine(yycontext *ctx); /* 35 */ +YY_RULE(int) yy_Line(yycontext *ctx); /* 34 */ +YY_RULE(int) yy_BlockQuoteRaw(yycontext *ctx); /* 33 */ +YY_RULE(int) yy_Endline(yycontext *ctx); /* 32 */ +YY_RULE(int) yy_RawLine(yycontext *ctx); /* 31 */ +YY_RULE(int) yy_SetextBottom2(yycontext *ctx); /* 30 */ +YY_RULE(int) yy_SetextBottom1(yycontext *ctx); /* 29 */ +YY_RULE(int) yy_SetextHeading2(yycontext *ctx); /* 28 */ +YY_RULE(int) yy_SetextHeading1(yycontext *ctx); /* 27 */ +YY_RULE(int) yy_SetextHeading(yycontext *ctx); /* 26 */ +YY_RULE(int) yy_AtxHeading(yycontext *ctx); /* 25 */ +YY_RULE(int) yy_AtxStart(yycontext *ctx); /* 24 */ +YY_RULE(int) yy_Inline(yycontext *ctx); /* 23 */ +YY_RULE(int) yy_Sp(yycontext *ctx); /* 22 */ +YY_RULE(int) yy_Newline(yycontext *ctx); /* 21 */ +YY_RULE(int) yy_AtxInline(yycontext *ctx); /* 20 */ +YY_RULE(int) yy_Inlines(yycontext *ctx); /* 19 */ +YY_RULE(int) yy_NonindentSpace(yycontext *ctx); /* 18 */ +YY_RULE(int) yy_Plain(yycontext *ctx); /* 17 */ +YY_RULE(int) yy_Para(yycontext *ctx); /* 16 */ +YY_RULE(int) yy_StyleBlock(yycontext *ctx); /* 15 */ +YY_RULE(int) yy_HtmlBlock(yycontext *ctx); /* 14 */ +YY_RULE(int) yy_BulletList(yycontext *ctx); /* 13 */ +YY_RULE(int) yy_OrderedList(yycontext *ctx); /* 12 */ +YY_RULE(int) yy_Heading(yycontext *ctx); /* 11 */ +YY_RULE(int) yy_HorizontalRule(yycontext *ctx); /* 10 */ +YY_RULE(int) yy_Reference(yycontext *ctx); /* 9 */ +YY_RULE(int) yy_Note(yycontext *ctx); /* 8 */ +YY_RULE(int) yy_Verbatim(yycontext *ctx); /* 7 */ +YY_RULE(int) yy_BlockQuote(yycontext *ctx); /* 6 */ +YY_RULE(int) yy_BlankLine(yycontext *ctx); /* 5 */ +YY_RULE(int) yy_Block(yycontext *ctx); /* 4 */ +YY_RULE(int) yy_StartList(yycontext *ctx); /* 3 */ +YY_RULE(int) yy_BOM(yycontext *ctx); /* 2 */ +YY_RULE(int) yy_Doc(yycontext *ctx); /* 1 */ + +YY_ACTION(void) yy_3_RawNoteBlock(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_3_RawNoteBlock\n")); + yy = mk_str_from_list(a, true); + yy->key = RAW; + ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_2_RawNoteBlock(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_RawNoteBlock\n")); + a = cons(mk_str(yytext), a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_RawNoteBlock(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_RawNoteBlock\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_2_Notes(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_Notes\n")); + notes = reverse(a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_1_Notes(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Notes\n")); + a = cons(b, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_2_InlineNote(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_InlineNote\n")); + yy = mk_list(NOTE, a); + yy->contents.str = 0; ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_InlineNote(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_InlineNote\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_3_Note(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define ref ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_3_Note\n")); + yy = mk_list(NOTE, a); + yy->contents.str = strdup(ref->contents.str); + ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +#undef ref +} +YY_ACTION(void) yy_2_Note(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define ref ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_Note\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +#undef ref +} +YY_ACTION(void) yy_1_Note(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define ref ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Note\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +#undef ref +} +YY_ACTION(void) yy_1_RawNoteReference(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_RawNoteReference\n")); + yy = mk_str(yytext); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_NoteReference(yycontext *ctx, char *yytext, int yyleng) +{ +#define ref ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_NoteReference\n")); + element *match; + if (find_note(&match, ref->contents.str)) { + yy = mk_element(NOTE); + assert(match->children != NULL); + yy->children = match->children; + yy->contents.str = 0; + } else { + char *s; + s = malloc(strlen(ref->contents.str) + 4); + sprintf(s, "[^%s]", ref->contents.str); + yy = mk_str(s); + free(s); + } + ; +#undef yythunkpos +#undef yypos +#undef yy +#undef ref +} +YY_ACTION(void) yy_2_DoubleQuoted(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_DoubleQuoted\n")); + yy = mk_list(DOUBLEQUOTED, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_1_DoubleQuoted(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_DoubleQuoted\n")); + a = cons(b, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_2_SingleQuoted(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_SingleQuoted\n")); + yy = mk_list(SINGLEQUOTED, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_1_SingleQuoted(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_SingleQuoted\n")); + a = cons(b, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_1_EmDash(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_EmDash\n")); + yy = mk_element(EMDASH); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_EnDash(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_EnDash\n")); + yy = mk_element(ENDASH); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_Ellipsis(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Ellipsis\n")); + yy = mk_element(ELLIPSIS); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_Apostrophe(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Apostrophe\n")); + yy = mk_element(APOSTROPHE); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_Line(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Line\n")); + yy = mk_str(yytext); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_StartList(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_StartList\n")); + yy = NULL; ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_RawHtml(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_RawHtml\n")); + if (extension(EXT_FILTER_HTML)) { + yy = mk_list(LIST, NULL); + } else { + yy = mk_str(yytext); + yy->key = HTML; + } + ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_Code(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Code\n")); + yy = mk_str(yytext); yy->key = CODE; ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_2_References(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_References\n")); + references = reverse(a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_1_References(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_References\n")); + a = cons(b, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_1_RefTitle(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_RefTitle\n")); + yy = mk_str(yytext); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_RefSrc(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_RefSrc\n")); + yy = mk_str(yytext); + yy->key = HTML; ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_2_Label(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_Label\n")); + yy = mk_list(LIST, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_Label(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Label\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_Reference(yycontext *ctx, char *yytext, int yyleng) +{ +#define t ctx->val[-1] +#define s ctx->val[-2] +#define l ctx->val[-3] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Reference\n")); + yy = mk_link(l->children, s->contents.str, t->contents.str); + free_element(s); + free_element(t); + free(l); + yy->key = REFERENCE; ; +#undef yythunkpos +#undef yypos +#undef yy +#undef t +#undef s +#undef l +} +YY_ACTION(void) yy_1_AutoLinkEmail(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_AutoLinkEmail\n")); + char *mailto = malloc(strlen(yytext) + 8); + sprintf(mailto, "mailto:%s", yytext); + yy = mk_link(mk_str(yytext), mailto, ""); + free(mailto); + ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_AutoLinkUrl(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_AutoLinkUrl\n")); + yy = mk_link(mk_str(yytext), yytext, ""); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_Title(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Title\n")); + yy = mk_str(yytext); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_Source(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Source\n")); + yy = mk_str(yytext); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_ExplicitLink(yycontext *ctx, char *yytext, int yyleng) +{ +#define t ctx->val[-1] +#define s ctx->val[-2] +#define l ctx->val[-3] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_ExplicitLink\n")); + yy = mk_link(l->children, s->contents.str, t->contents.str); + free_element(s); + free_element(t); + free(l); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef t +#undef s +#undef l +} +YY_ACTION(void) yy_1_ReferenceLinkSingle(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_ReferenceLinkSingle\n")); + link match; + if (find_reference(&match, a->children)) { + yy = mk_link(a->children, match.url, match.title); + free(a); + } + else { + element *result; + result = mk_element(LIST); + result->children = cons(mk_str("["), cons(a, cons(mk_str("]"), mk_str(yytext)))); + yy = result; + } + ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_ReferenceLinkDouble(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_ReferenceLinkDouble\n")); + link match; + if (find_reference(&match, b->children)) { + yy = mk_link(a->children, match.url, match.title); + free(a); + free_element_list(b); + } else { + element *result; + result = mk_element(LIST); + result->children = cons(mk_str("["), cons(a, cons(mk_str("]"), cons(mk_str(yytext), + cons(mk_str("["), cons(b, mk_str("]"))))))); + yy = result; + } + ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_1_Image(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Image\n")); + if (yy->key == LINK) { + yy->key = IMAGE; + } else { + element *result; + result = yy; + yy->children = cons(mk_str("!"), result->children); + } ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_2_StrongUl(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_StrongUl\n")); + yy = mk_list(STRONG, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_1_StrongUl(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_StrongUl\n")); + a = cons(b, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_2_StrongStar(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_StrongStar\n")); + yy = mk_list(STRONG, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_1_StrongStar(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_StrongStar\n")); + a = cons(b, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_3_EmphUl(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_3_EmphUl\n")); + yy = mk_list(EMPH, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_2_EmphUl(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_EmphUl\n")); + a = cons(b, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_1_EmphUl(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_EmphUl\n")); + a = cons(b, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_3_EmphStar(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_3_EmphStar\n")); + yy = mk_list(EMPH, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_2_EmphStar(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_EmphStar\n")); + a = cons(b, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_1_EmphStar(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_EmphStar\n")); + a = cons(b, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_1_UlOrStarLine(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_UlOrStarLine\n")); + yy = mk_str(yytext); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_Symbol(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Symbol\n")); + yy = mk_str(yytext); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_LineBreak(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_LineBreak\n")); + yy = mk_element(LINEBREAK); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_TerminalEndline(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_TerminalEndline\n")); + yy = NULL; ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_NormalEndline(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_NormalEndline\n")); + yy = mk_str("\n"); + yy->key = SPACE; ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_Entity(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Entity\n")); + yy = mk_str(yytext); yy->key = HTML; ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_EscapedChar(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_EscapedChar\n")); + yy = mk_str(yytext); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_AposChunk(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_AposChunk\n")); + yy = mk_element(APOSTROPHE); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_StrChunk(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_StrChunk\n")); + yy = mk_str(yytext); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_3_Str(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_3_Str\n")); + if (a->next == NULL) { yy = a; } else { yy = mk_list(LIST, a); } ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_2_Str(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_Str\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_Str(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Str\n")); + a = cons(mk_str(yytext), a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_Space(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Space\n")); + yy = mk_str(" "); + yy->key = SPACE; ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_3_Inlines(yycontext *ctx, char *yytext, int yyleng) +{ +#define c ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_3_Inlines\n")); + yy = mk_list(LIST, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef c +#undef a +} +YY_ACTION(void) yy_2_Inlines(yycontext *ctx, char *yytext, int yyleng) +{ +#define c ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_Inlines\n")); + a = cons(c, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef c +#undef a +} +YY_ACTION(void) yy_1_Inlines(yycontext *ctx, char *yytext, int yyleng) +{ +#define c ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Inlines\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef c +#undef a +} +YY_ACTION(void) yy_1_StyleBlock(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_StyleBlock\n")); + if (extension(EXT_FILTER_STYLES)) { + yy = mk_list(LIST, NULL); + } else { + yy = mk_str(yytext); + yy->key = HTMLBLOCK; + } + ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_HtmlBlock(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_HtmlBlock\n")); + if (extension(EXT_FILTER_HTML)) { + yy = mk_list(LIST, NULL); + } else { + yy = mk_str(yytext); + yy->key = HTMLBLOCK; + } + ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_OrderedList(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_OrderedList\n")); + yy->key = ORDEREDLIST; ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_3_ListContinuationBlock(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_3_ListContinuationBlock\n")); + yy = mk_str_from_list(a, false); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_2_ListContinuationBlock(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_ListContinuationBlock\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_ListContinuationBlock(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_ListContinuationBlock\n")); + if (strlen(yytext) == 0) + a = cons(mk_str("\001"), a); /* block separator */ + else + a = cons(mk_str(yytext), a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_3_ListBlock(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_3_ListBlock\n")); + yy = mk_str_from_list(a, false); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_2_ListBlock(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_ListBlock\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_ListBlock(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_ListBlock\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_3_ListItemTight(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_3_ListItemTight\n")); + element *raw; + raw = mk_str_from_list(a, false); + raw->key = RAW; + yy = mk_element(LISTITEM); + yy->children = raw; + ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_2_ListItemTight(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_ListItemTight\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_ListItemTight(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_ListItemTight\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_3_ListItem(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_3_ListItem\n")); + element *raw; + raw = mk_str_from_list(a, false); + raw->key = RAW; + yy = mk_element(LISTITEM); + yy->children = raw; + ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_2_ListItem(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_ListItem\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_ListItem(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_ListItem\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_2_ListLoose(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_ListLoose\n")); + yy = mk_list(LIST, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_1_ListLoose(yycontext *ctx, char *yytext, int yyleng) +{ +#define b ctx->val[-1] +#define a ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_ListLoose\n")); + element *li; + li = b->children; + li->contents.str = realloc(li->contents.str, strlen(li->contents.str) + 3); + strcat(li->contents.str, "\n\n"); /* In loose list, \n\n added to end of each element */ + a = cons(b, a); + ; +#undef yythunkpos +#undef yypos +#undef yy +#undef b +#undef a +} +YY_ACTION(void) yy_2_ListTight(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_ListTight\n")); + yy = mk_list(LIST, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_ListTight(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_ListTight\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_BulletList(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_BulletList\n")); + yy->key = BULLETLIST; ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_HorizontalRule(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_HorizontalRule\n")); + yy = mk_element(HRULE); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_2_Verbatim(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_Verbatim\n")); + yy = mk_str_from_list(a, false); + yy->key = VERBATIM; ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_Verbatim(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Verbatim\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_3_VerbatimChunk(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_3_VerbatimChunk\n")); + yy = mk_str_from_list(a, false); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_2_VerbatimChunk(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_VerbatimChunk\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_VerbatimChunk(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_VerbatimChunk\n")); + a = cons(mk_str("\n"), a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_4_BlockQuoteRaw(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_4_BlockQuoteRaw\n")); + yy = mk_str_from_list(a, true); + yy->key = RAW; + ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_3_BlockQuoteRaw(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_3_BlockQuoteRaw\n")); + a = cons(mk_str("\n"), a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_2_BlockQuoteRaw(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_BlockQuoteRaw\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_BlockQuoteRaw(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_BlockQuoteRaw\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_BlockQuote(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_BlockQuote\n")); + yy = mk_element(BLOCKQUOTE); + yy->children = a; + ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_2_SetextHeading2(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_SetextHeading2\n")); + yy = mk_list(H2, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_SetextHeading2(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_SetextHeading2\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_2_SetextHeading1(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_SetextHeading1\n")); + yy = mk_list(H1, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_SetextHeading1(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_SetextHeading1\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_2_AtxHeading(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define s ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_AtxHeading\n")); + yy = mk_list(s->key, a); + free(s); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +#undef s +} +YY_ACTION(void) yy_1_AtxHeading(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define s ctx->val[-2] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_AtxHeading\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +#undef s +} +YY_ACTION(void) yy_1_AtxStart(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_AtxStart\n")); + yy = mk_element(H1 + (strlen(yytext) - 1)); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_Plain(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Plain\n")); + yy = a; yy->key = PLAIN; ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_Para(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Para\n")); + yy = a; yy->key = PARA; ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_2_Doc(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_Doc\n")); + parse_result = reverse(a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} +YY_ACTION(void) yy_1_Doc(yycontext *ctx, char *yytext, int yyleng) +{ +#define a ctx->val[-1] +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_Doc\n")); + a = cons(yy, a); ; +#undef yythunkpos +#undef yypos +#undef yy +#undef a +} + +YY_RULE(int) yy_Notes(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 2, 0); + yyprintf((stderr, "%s\n", "Notes")); if (!yy_StartList(ctx)) goto l1; yyDo(ctx, yySet, -2, 0); + l2:; + { int yypos3= ctx->pos, yythunkpos3= ctx->thunkpos; + { int yypos4= ctx->pos, yythunkpos4= ctx->thunkpos; if (!yy_Note(ctx)) goto l5; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_Notes, ctx->begin, ctx->end); goto l4; + l5:; ctx->pos= yypos4; ctx->thunkpos= yythunkpos4; if (!yy_SkipBlock(ctx)) goto l3; + } + l4:; goto l2; + l3:; ctx->pos= yypos3; ctx->thunkpos= yythunkpos3; + } yyDo(ctx, yy_2_Notes, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Notes", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 2, 0); + return 1; + l1:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Notes", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_RawNoteBlock(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "RawNoteBlock")); if (!yy_StartList(ctx)) goto l6; yyDo(ctx, yySet, -1, 0); + { int yypos9= ctx->pos, yythunkpos9= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l9; goto l6; + l9:; ctx->pos= yypos9; ctx->thunkpos= yythunkpos9; + } if (!yy_OptionallyIndentedLine(ctx)) goto l6; yyDo(ctx, yy_1_RawNoteBlock, ctx->begin, ctx->end); + l7:; + { int yypos8= ctx->pos, yythunkpos8= ctx->thunkpos; + { int yypos10= ctx->pos, yythunkpos10= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l10; goto l8; + l10:; ctx->pos= yypos10; ctx->thunkpos= yythunkpos10; + } if (!yy_OptionallyIndentedLine(ctx)) goto l8; yyDo(ctx, yy_1_RawNoteBlock, ctx->begin, ctx->end); goto l7; + l8:; ctx->pos= yypos8; ctx->thunkpos= yythunkpos8; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l6; + l11:; + { int yypos12= ctx->pos, yythunkpos12= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l12; goto l11; + l12:; ctx->pos= yypos12; ctx->thunkpos= yythunkpos12; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l6; yyDo(ctx, yy_2_RawNoteBlock, ctx->begin, ctx->end); yyDo(ctx, yy_3_RawNoteBlock, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "RawNoteBlock", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l6:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "RawNoteBlock", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_RawNoteReference(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "RawNoteReference")); if (!yymatchString(ctx, "[^")) goto l13; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l13; + { int yypos16= ctx->pos, yythunkpos16= ctx->thunkpos; if (!yy_Newline(ctx)) goto l16; goto l13; + l16:; ctx->pos= yypos16; ctx->thunkpos= yythunkpos16; + } + { int yypos17= ctx->pos, yythunkpos17= ctx->thunkpos; if (!yymatchChar(ctx, ']')) goto l17; goto l13; + l17:; ctx->pos= yypos17; ctx->thunkpos= yythunkpos17; + } if (!yymatchDot(ctx)) goto l13; + l14:; + { int yypos15= ctx->pos, yythunkpos15= ctx->thunkpos; + { int yypos18= ctx->pos, yythunkpos18= ctx->thunkpos; if (!yy_Newline(ctx)) goto l18; goto l15; + l18:; ctx->pos= yypos18; ctx->thunkpos= yythunkpos18; + } + { int yypos19= ctx->pos, yythunkpos19= ctx->thunkpos; if (!yymatchChar(ctx, ']')) goto l19; goto l15; + l19:; ctx->pos= yypos19; ctx->thunkpos= yythunkpos19; + } if (!yymatchDot(ctx)) goto l15; goto l14; + l15:; ctx->pos= yypos15; ctx->thunkpos= yythunkpos15; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l13; if (!yymatchChar(ctx, ']')) goto l13; yyDo(ctx, yy_1_RawNoteReference, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "RawNoteReference", ctx->buf+ctx->pos)); + return 1; + l13:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "RawNoteReference", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_DoubleQuoteEnd(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "DoubleQuoteEnd")); if (!yymatchChar(ctx, '"')) goto l20; + yyprintf((stderr, " ok %s @ %s\n", "DoubleQuoteEnd", ctx->buf+ctx->pos)); + return 1; + l20:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "DoubleQuoteEnd", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_DoubleQuoteStart(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "DoubleQuoteStart")); if (!yymatchChar(ctx, '"')) goto l21; + yyprintf((stderr, " ok %s @ %s\n", "DoubleQuoteStart", ctx->buf+ctx->pos)); + return 1; + l21:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "DoubleQuoteStart", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_SingleQuoteEnd(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "SingleQuoteEnd")); if (!yymatchChar(ctx, '\'')) goto l22; + { int yypos23= ctx->pos, yythunkpos23= ctx->thunkpos; if (!yy_Alphanumeric(ctx)) goto l23; goto l22; + l23:; ctx->pos= yypos23; ctx->thunkpos= yythunkpos23; + } + yyprintf((stderr, " ok %s @ %s\n", "SingleQuoteEnd", ctx->buf+ctx->pos)); + return 1; + l22:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "SingleQuoteEnd", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_SingleQuoteStart(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "SingleQuoteStart")); if (!yymatchChar(ctx, '\'')) goto l24; + { int yypos25= ctx->pos, yythunkpos25= ctx->thunkpos; + { int yypos26= ctx->pos, yythunkpos26= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l27; goto l26; + l27:; ctx->pos= yypos26; ctx->thunkpos= yythunkpos26; if (!yy_Newline(ctx)) goto l25; + } + l26:; goto l24; + l25:; ctx->pos= yypos25; ctx->thunkpos= yythunkpos25; + } + yyprintf((stderr, " ok %s @ %s\n", "SingleQuoteStart", ctx->buf+ctx->pos)); + return 1; + l24:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "SingleQuoteStart", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_EnDash(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "EnDash")); if (!yymatchChar(ctx, '-')) goto l28; + { int yypos29= ctx->pos, yythunkpos29= ctx->thunkpos; if (!yy_Digit(ctx)) goto l28; ctx->pos= yypos29; ctx->thunkpos= yythunkpos29; + } yyDo(ctx, yy_1_EnDash, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "EnDash", ctx->buf+ctx->pos)); + return 1; + l28:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "EnDash", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_EmDash(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "EmDash")); + { int yypos31= ctx->pos, yythunkpos31= ctx->thunkpos; if (!yymatchString(ctx, "---")) goto l32; goto l31; + l32:; ctx->pos= yypos31; ctx->thunkpos= yythunkpos31; if (!yymatchString(ctx, "--")) goto l30; + } + l31:; yyDo(ctx, yy_1_EmDash, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "EmDash", ctx->buf+ctx->pos)); + return 1; + l30:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "EmDash", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Apostrophe(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Apostrophe")); if (!yymatchChar(ctx, '\'')) goto l33; yyDo(ctx, yy_1_Apostrophe, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Apostrophe", ctx->buf+ctx->pos)); + return 1; + l33:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Apostrophe", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_DoubleQuoted(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 2, 0); + yyprintf((stderr, "%s\n", "DoubleQuoted")); if (!yy_DoubleQuoteStart(ctx)) goto l34; if (!yy_StartList(ctx)) goto l34; yyDo(ctx, yySet, -2, 0); + { int yypos37= ctx->pos, yythunkpos37= ctx->thunkpos; if (!yy_DoubleQuoteEnd(ctx)) goto l37; goto l34; + l37:; ctx->pos= yypos37; ctx->thunkpos= yythunkpos37; + } if (!yy_Inline(ctx)) goto l34; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_DoubleQuoted, ctx->begin, ctx->end); + l35:; + { int yypos36= ctx->pos, yythunkpos36= ctx->thunkpos; + { int yypos38= ctx->pos, yythunkpos38= ctx->thunkpos; if (!yy_DoubleQuoteEnd(ctx)) goto l38; goto l36; + l38:; ctx->pos= yypos38; ctx->thunkpos= yythunkpos38; + } if (!yy_Inline(ctx)) goto l36; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_DoubleQuoted, ctx->begin, ctx->end); goto l35; + l36:; ctx->pos= yypos36; ctx->thunkpos= yythunkpos36; + } if (!yy_DoubleQuoteEnd(ctx)) goto l34; yyDo(ctx, yy_2_DoubleQuoted, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "DoubleQuoted", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 2, 0); + return 1; + l34:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "DoubleQuoted", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_SingleQuoted(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 2, 0); + yyprintf((stderr, "%s\n", "SingleQuoted")); if (!yy_SingleQuoteStart(ctx)) goto l39; if (!yy_StartList(ctx)) goto l39; yyDo(ctx, yySet, -2, 0); + { int yypos42= ctx->pos, yythunkpos42= ctx->thunkpos; if (!yy_SingleQuoteEnd(ctx)) goto l42; goto l39; + l42:; ctx->pos= yypos42; ctx->thunkpos= yythunkpos42; + } if (!yy_Inline(ctx)) goto l39; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_SingleQuoted, ctx->begin, ctx->end); + l40:; + { int yypos41= ctx->pos, yythunkpos41= ctx->thunkpos; + { int yypos43= ctx->pos, yythunkpos43= ctx->thunkpos; if (!yy_SingleQuoteEnd(ctx)) goto l43; goto l41; + l43:; ctx->pos= yypos43; ctx->thunkpos= yythunkpos43; + } if (!yy_Inline(ctx)) goto l41; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_SingleQuoted, ctx->begin, ctx->end); goto l40; + l41:; ctx->pos= yypos41; ctx->thunkpos= yythunkpos41; + } if (!yy_SingleQuoteEnd(ctx)) goto l39; yyDo(ctx, yy_2_SingleQuoted, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "SingleQuoted", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 2, 0); + return 1; + l39:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "SingleQuoted", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Dash(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Dash")); + { int yypos45= ctx->pos, yythunkpos45= ctx->thunkpos; if (!yy_EmDash(ctx)) goto l46; goto l45; + l46:; ctx->pos= yypos45; ctx->thunkpos= yythunkpos45; if (!yy_EnDash(ctx)) goto l44; + } + l45:; + yyprintf((stderr, " ok %s @ %s\n", "Dash", ctx->buf+ctx->pos)); + return 1; + l44:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Dash", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Ellipsis(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Ellipsis")); + { int yypos48= ctx->pos, yythunkpos48= ctx->thunkpos; if (!yymatchString(ctx, "...")) goto l49; goto l48; + l49:; ctx->pos= yypos48; ctx->thunkpos= yythunkpos48; if (!yymatchString(ctx, ". . .")) goto l47; + } + l48:; yyDo(ctx, yy_1_Ellipsis, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Ellipsis", ctx->buf+ctx->pos)); + return 1; + l47:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Ellipsis", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Digit(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Digit")); if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\377\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l50; + yyprintf((stderr, " ok %s @ %s\n", "Digit", ctx->buf+ctx->pos)); + return 1; + l50:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Digit", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_ExtendedSpecialChar(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "ExtendedSpecialChar")); + { int yypos52= ctx->pos, yythunkpos52= ctx->thunkpos; yyText(ctx, ctx->begin, ctx->end); if (!( extension(EXT_SMART) )) goto l53; + { int yypos54= ctx->pos, yythunkpos54= ctx->thunkpos; if (!yymatchChar(ctx, '.')) goto l55; goto l54; + l55:; ctx->pos= yypos54; ctx->thunkpos= yythunkpos54; if (!yymatchChar(ctx, '-')) goto l56; goto l54; + l56:; ctx->pos= yypos54; ctx->thunkpos= yythunkpos54; if (!yymatchChar(ctx, '\'')) goto l57; goto l54; + l57:; ctx->pos= yypos54; ctx->thunkpos= yythunkpos54; if (!yymatchChar(ctx, '"')) goto l53; + } + l54:; goto l52; + l53:; ctx->pos= yypos52; ctx->thunkpos= yythunkpos52; yyText(ctx, ctx->begin, ctx->end); if (!( extension(EXT_NOTES) )) goto l51; if (!yymatchChar(ctx, '^')) goto l51; + } + l52:; + yyprintf((stderr, " ok %s @ %s\n", "ExtendedSpecialChar", ctx->buf+ctx->pos)); + return 1; + l51:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "ExtendedSpecialChar", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_AlphanumericAscii(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "AlphanumericAscii")); if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\377\003\376\377\377\007\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l58; + yyprintf((stderr, " ok %s @ %s\n", "AlphanumericAscii", ctx->buf+ctx->pos)); + return 1; + l58:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "AlphanumericAscii", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Quoted(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Quoted")); + { int yypos60= ctx->pos, yythunkpos60= ctx->thunkpos; if (!yymatchChar(ctx, '"')) goto l61; + l62:; + { int yypos63= ctx->pos, yythunkpos63= ctx->thunkpos; + { int yypos64= ctx->pos, yythunkpos64= ctx->thunkpos; if (!yymatchChar(ctx, '"')) goto l64; goto l63; + l64:; ctx->pos= yypos64; ctx->thunkpos= yythunkpos64; + } if (!yymatchDot(ctx)) goto l63; goto l62; + l63:; ctx->pos= yypos63; ctx->thunkpos= yythunkpos63; + } if (!yymatchChar(ctx, '"')) goto l61; goto l60; + l61:; ctx->pos= yypos60; ctx->thunkpos= yythunkpos60; if (!yymatchChar(ctx, '\'')) goto l59; + l65:; + { int yypos66= ctx->pos, yythunkpos66= ctx->thunkpos; + { int yypos67= ctx->pos, yythunkpos67= ctx->thunkpos; if (!yymatchChar(ctx, '\'')) goto l67; goto l66; + l67:; ctx->pos= yypos67; ctx->thunkpos= yythunkpos67; + } if (!yymatchDot(ctx)) goto l66; goto l65; + l66:; ctx->pos= yypos66; ctx->thunkpos= yythunkpos66; + } if (!yymatchChar(ctx, '\'')) goto l59; + } + l60:; + yyprintf((stderr, " ok %s @ %s\n", "Quoted", ctx->buf+ctx->pos)); + return 1; + l59:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Quoted", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlTag(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlTag")); if (!yymatchChar(ctx, '<')) goto l68; if (!yy_Spnl(ctx)) goto l68; + { int yypos69= ctx->pos, yythunkpos69= ctx->thunkpos; if (!yymatchChar(ctx, '/')) goto l69; goto l70; + l69:; ctx->pos= yypos69; ctx->thunkpos= yythunkpos69; + } + l70:; if (!yy_AlphanumericAscii(ctx)) goto l68; + l71:; + { int yypos72= ctx->pos, yythunkpos72= ctx->thunkpos; if (!yy_AlphanumericAscii(ctx)) goto l72; goto l71; + l72:; ctx->pos= yypos72; ctx->thunkpos= yythunkpos72; + } if (!yy_Spnl(ctx)) goto l68; + l73:; + { int yypos74= ctx->pos, yythunkpos74= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l74; goto l73; + l74:; ctx->pos= yypos74; ctx->thunkpos= yythunkpos74; + } + { int yypos75= ctx->pos, yythunkpos75= ctx->thunkpos; if (!yymatchChar(ctx, '/')) goto l75; goto l76; + l75:; ctx->pos= yypos75; ctx->thunkpos= yythunkpos75; + } + l76:; if (!yy_Spnl(ctx)) goto l68; if (!yymatchChar(ctx, '>')) goto l68; + yyprintf((stderr, " ok %s @ %s\n", "HtmlTag", ctx->buf+ctx->pos)); + return 1; + l68:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlTag", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Ticks5(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Ticks5")); if (!yymatchString(ctx, "`````")) goto l77; + { int yypos78= ctx->pos, yythunkpos78= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l78; goto l77; + l78:; ctx->pos= yypos78; ctx->thunkpos= yythunkpos78; + } + yyprintf((stderr, " ok %s @ %s\n", "Ticks5", ctx->buf+ctx->pos)); + return 1; + l77:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Ticks5", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Ticks4(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Ticks4")); if (!yymatchString(ctx, "````")) goto l79; + { int yypos80= ctx->pos, yythunkpos80= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l80; goto l79; + l80:; ctx->pos= yypos80; ctx->thunkpos= yythunkpos80; + } + yyprintf((stderr, " ok %s @ %s\n", "Ticks4", ctx->buf+ctx->pos)); + return 1; + l79:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Ticks4", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Ticks3(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Ticks3")); if (!yymatchString(ctx, "```")) goto l81; + { int yypos82= ctx->pos, yythunkpos82= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l82; goto l81; + l82:; ctx->pos= yypos82; ctx->thunkpos= yythunkpos82; + } + yyprintf((stderr, " ok %s @ %s\n", "Ticks3", ctx->buf+ctx->pos)); + return 1; + l81:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Ticks3", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Ticks2(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Ticks2")); if (!yymatchString(ctx, "``")) goto l83; + { int yypos84= ctx->pos, yythunkpos84= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l84; goto l83; + l84:; ctx->pos= yypos84; ctx->thunkpos= yythunkpos84; + } + yyprintf((stderr, " ok %s @ %s\n", "Ticks2", ctx->buf+ctx->pos)); + return 1; + l83:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Ticks2", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Ticks1(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Ticks1")); if (!yymatchChar(ctx, '`')) goto l85; + { int yypos86= ctx->pos, yythunkpos86= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l86; goto l85; + l86:; ctx->pos= yypos86; ctx->thunkpos= yythunkpos86; + } + yyprintf((stderr, " ok %s @ %s\n", "Ticks1", ctx->buf+ctx->pos)); + return 1; + l85:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Ticks1", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_SkipBlock(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "SkipBlock")); + { int yypos88= ctx->pos, yythunkpos88= ctx->thunkpos; if (!yy_HtmlBlock(ctx)) goto l89; goto l88; + l89:; ctx->pos= yypos88; ctx->thunkpos= yythunkpos88; + { int yypos93= ctx->pos, yythunkpos93= ctx->thunkpos; if (!yymatchChar(ctx, '#')) goto l93; goto l90; + l93:; ctx->pos= yypos93; ctx->thunkpos= yythunkpos93; + } + { int yypos94= ctx->pos, yythunkpos94= ctx->thunkpos; if (!yy_SetextBottom1(ctx)) goto l94; goto l90; + l94:; ctx->pos= yypos94; ctx->thunkpos= yythunkpos94; + } + { int yypos95= ctx->pos, yythunkpos95= ctx->thunkpos; if (!yy_SetextBottom2(ctx)) goto l95; goto l90; + l95:; ctx->pos= yypos95; ctx->thunkpos= yythunkpos95; + } + { int yypos96= ctx->pos, yythunkpos96= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l96; goto l90; + l96:; ctx->pos= yypos96; ctx->thunkpos= yythunkpos96; + } if (!yy_RawLine(ctx)) goto l90; + l91:; + { int yypos92= ctx->pos, yythunkpos92= ctx->thunkpos; + { int yypos97= ctx->pos, yythunkpos97= ctx->thunkpos; if (!yymatchChar(ctx, '#')) goto l97; goto l92; + l97:; ctx->pos= yypos97; ctx->thunkpos= yythunkpos97; + } + { int yypos98= ctx->pos, yythunkpos98= ctx->thunkpos; if (!yy_SetextBottom1(ctx)) goto l98; goto l92; + l98:; ctx->pos= yypos98; ctx->thunkpos= yythunkpos98; + } + { int yypos99= ctx->pos, yythunkpos99= ctx->thunkpos; if (!yy_SetextBottom2(ctx)) goto l99; goto l92; + l99:; ctx->pos= yypos99; ctx->thunkpos= yythunkpos99; + } + { int yypos100= ctx->pos, yythunkpos100= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l100; goto l92; + l100:; ctx->pos= yypos100; ctx->thunkpos= yythunkpos100; + } if (!yy_RawLine(ctx)) goto l92; goto l91; + l92:; ctx->pos= yypos92; ctx->thunkpos= yythunkpos92; + } + l101:; + { int yypos102= ctx->pos, yythunkpos102= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l102; goto l101; + l102:; ctx->pos= yypos102; ctx->thunkpos= yythunkpos102; + } goto l88; + l90:; ctx->pos= yypos88; ctx->thunkpos= yythunkpos88; if (!yy_BlankLine(ctx)) goto l103; + l104:; + { int yypos105= ctx->pos, yythunkpos105= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l105; goto l104; + l105:; ctx->pos= yypos105; ctx->thunkpos= yythunkpos105; + } goto l88; + l103:; ctx->pos= yypos88; ctx->thunkpos= yythunkpos88; if (!yy_RawLine(ctx)) goto l87; + } + l88:; + yyprintf((stderr, " ok %s @ %s\n", "SkipBlock", ctx->buf+ctx->pos)); + return 1; + l87:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "SkipBlock", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_References(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 2, 0); + yyprintf((stderr, "%s\n", "References")); if (!yy_StartList(ctx)) goto l106; yyDo(ctx, yySet, -2, 0); + l107:; + { int yypos108= ctx->pos, yythunkpos108= ctx->thunkpos; + { int yypos109= ctx->pos, yythunkpos109= ctx->thunkpos; if (!yy_Reference(ctx)) goto l110; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_References, ctx->begin, ctx->end); goto l109; + l110:; ctx->pos= yypos109; ctx->thunkpos= yythunkpos109; if (!yy_SkipBlock(ctx)) goto l108; + } + l109:; goto l107; + l108:; ctx->pos= yypos108; ctx->thunkpos= yythunkpos108; + } yyDo(ctx, yy_2_References, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "References", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 2, 0); + return 1; + l106:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "References", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_EmptyTitle(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "EmptyTitle")); yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l111; if (!yymatchString(ctx, "")) goto l111; yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l111; + yyprintf((stderr, " ok %s @ %s\n", "EmptyTitle", ctx->buf+ctx->pos)); + return 1; + l111:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "EmptyTitle", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_RefTitleParens(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "RefTitleParens")); if (!yy_Spnl(ctx)) goto l112; if (!yymatchChar(ctx, '(')) goto l112; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l112; + l113:; + { int yypos114= ctx->pos, yythunkpos114= ctx->thunkpos; + { int yypos115= ctx->pos, yythunkpos115= ctx->thunkpos; + { int yypos116= ctx->pos, yythunkpos116= ctx->thunkpos; if (!yymatchChar(ctx, ')')) goto l117; if (!yy_Sp(ctx)) goto l117; if (!yy_Newline(ctx)) goto l117; goto l116; + l117:; ctx->pos= yypos116; ctx->thunkpos= yythunkpos116; if (!yy_Newline(ctx)) goto l115; + } + l116:; goto l114; + l115:; ctx->pos= yypos115; ctx->thunkpos= yythunkpos115; + } if (!yymatchDot(ctx)) goto l114; goto l113; + l114:; ctx->pos= yypos114; ctx->thunkpos= yythunkpos114; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l112; if (!yymatchChar(ctx, ')')) goto l112; + yyprintf((stderr, " ok %s @ %s\n", "RefTitleParens", ctx->buf+ctx->pos)); + return 1; + l112:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "RefTitleParens", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_RefTitleDouble(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "RefTitleDouble")); if (!yy_Spnl(ctx)) goto l118; if (!yymatchChar(ctx, '"')) goto l118; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l118; + l119:; + { int yypos120= ctx->pos, yythunkpos120= ctx->thunkpos; + { int yypos121= ctx->pos, yythunkpos121= ctx->thunkpos; + { int yypos122= ctx->pos, yythunkpos122= ctx->thunkpos; if (!yymatchChar(ctx, '"')) goto l123; if (!yy_Sp(ctx)) goto l123; if (!yy_Newline(ctx)) goto l123; goto l122; + l123:; ctx->pos= yypos122; ctx->thunkpos= yythunkpos122; if (!yy_Newline(ctx)) goto l121; + } + l122:; goto l120; + l121:; ctx->pos= yypos121; ctx->thunkpos= yythunkpos121; + } if (!yymatchDot(ctx)) goto l120; goto l119; + l120:; ctx->pos= yypos120; ctx->thunkpos= yythunkpos120; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l118; if (!yymatchChar(ctx, '"')) goto l118; + yyprintf((stderr, " ok %s @ %s\n", "RefTitleDouble", ctx->buf+ctx->pos)); + return 1; + l118:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "RefTitleDouble", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_RefTitleSingle(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "RefTitleSingle")); if (!yy_Spnl(ctx)) goto l124; if (!yymatchChar(ctx, '\'')) goto l124; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l124; + l125:; + { int yypos126= ctx->pos, yythunkpos126= ctx->thunkpos; + { int yypos127= ctx->pos, yythunkpos127= ctx->thunkpos; + { int yypos128= ctx->pos, yythunkpos128= ctx->thunkpos; if (!yymatchChar(ctx, '\'')) goto l129; if (!yy_Sp(ctx)) goto l129; if (!yy_Newline(ctx)) goto l129; goto l128; + l129:; ctx->pos= yypos128; ctx->thunkpos= yythunkpos128; if (!yy_Newline(ctx)) goto l127; + } + l128:; goto l126; + l127:; ctx->pos= yypos127; ctx->thunkpos= yythunkpos127; + } if (!yymatchDot(ctx)) goto l126; goto l125; + l126:; ctx->pos= yypos126; ctx->thunkpos= yythunkpos126; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l124; if (!yymatchChar(ctx, '\'')) goto l124; + yyprintf((stderr, " ok %s @ %s\n", "RefTitleSingle", ctx->buf+ctx->pos)); + return 1; + l124:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "RefTitleSingle", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_RefTitle(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "RefTitle")); + { int yypos131= ctx->pos, yythunkpos131= ctx->thunkpos; if (!yy_RefTitleSingle(ctx)) goto l132; goto l131; + l132:; ctx->pos= yypos131; ctx->thunkpos= yythunkpos131; if (!yy_RefTitleDouble(ctx)) goto l133; goto l131; + l133:; ctx->pos= yypos131; ctx->thunkpos= yythunkpos131; if (!yy_RefTitleParens(ctx)) goto l134; goto l131; + l134:; ctx->pos= yypos131; ctx->thunkpos= yythunkpos131; if (!yy_EmptyTitle(ctx)) goto l130; + } + l131:; yyDo(ctx, yy_1_RefTitle, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "RefTitle", ctx->buf+ctx->pos)); + return 1; + l130:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "RefTitle", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_RefSrc(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "RefSrc")); yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l135; if (!yy_Nonspacechar(ctx)) goto l135; + l136:; + { int yypos137= ctx->pos, yythunkpos137= ctx->thunkpos; if (!yy_Nonspacechar(ctx)) goto l137; goto l136; + l137:; ctx->pos= yypos137; ctx->thunkpos= yythunkpos137; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l135; yyDo(ctx, yy_1_RefSrc, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "RefSrc", ctx->buf+ctx->pos)); + return 1; + l135:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "RefSrc", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_AutoLinkEmail(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "AutoLinkEmail")); if (!yymatchChar(ctx, '<')) goto l138; + { int yypos139= ctx->pos, yythunkpos139= ctx->thunkpos; if (!yymatchString(ctx, "mailto:")) goto l139; goto l140; + l139:; ctx->pos= yypos139; ctx->thunkpos= yythunkpos139; + } + l140:; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l138; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\062\350\377\003\376\377\377\207\376\377\377\107\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l138; + l141:; + { int yypos142= ctx->pos, yythunkpos142= ctx->thunkpos; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\062\350\377\003\376\377\377\207\376\377\377\107\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l142; goto l141; + l142:; ctx->pos= yypos142; ctx->thunkpos= yythunkpos142; + } if (!yymatchChar(ctx, '@')) goto l138; + { int yypos145= ctx->pos, yythunkpos145= ctx->thunkpos; if (!yy_Newline(ctx)) goto l145; goto l138; + l145:; ctx->pos= yypos145; ctx->thunkpos= yythunkpos145; + } + { int yypos146= ctx->pos, yythunkpos146= ctx->thunkpos; if (!yymatchChar(ctx, '>')) goto l146; goto l138; + l146:; ctx->pos= yypos146; ctx->thunkpos= yythunkpos146; + } if (!yymatchDot(ctx)) goto l138; + l143:; + { int yypos144= ctx->pos, yythunkpos144= ctx->thunkpos; + { int yypos147= ctx->pos, yythunkpos147= ctx->thunkpos; if (!yy_Newline(ctx)) goto l147; goto l144; + l147:; ctx->pos= yypos147; ctx->thunkpos= yythunkpos147; + } + { int yypos148= ctx->pos, yythunkpos148= ctx->thunkpos; if (!yymatchChar(ctx, '>')) goto l148; goto l144; + l148:; ctx->pos= yypos148; ctx->thunkpos= yythunkpos148; + } if (!yymatchDot(ctx)) goto l144; goto l143; + l144:; ctx->pos= yypos144; ctx->thunkpos= yythunkpos144; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l138; if (!yymatchChar(ctx, '>')) goto l138; yyDo(ctx, yy_1_AutoLinkEmail, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "AutoLinkEmail", ctx->buf+ctx->pos)); + return 1; + l138:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "AutoLinkEmail", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_AutoLinkUrl(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "AutoLinkUrl")); if (!yymatchChar(ctx, '<')) goto l149; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l149; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\000\000\376\377\377\007\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l149; + l150:; + { int yypos151= ctx->pos, yythunkpos151= ctx->thunkpos; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\000\000\376\377\377\007\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l151; goto l150; + l151:; ctx->pos= yypos151; ctx->thunkpos= yythunkpos151; + } if (!yymatchString(ctx, "://")) goto l149; + { int yypos154= ctx->pos, yythunkpos154= ctx->thunkpos; if (!yy_Newline(ctx)) goto l154; goto l149; + l154:; ctx->pos= yypos154; ctx->thunkpos= yythunkpos154; + } + { int yypos155= ctx->pos, yythunkpos155= ctx->thunkpos; if (!yymatchChar(ctx, '>')) goto l155; goto l149; + l155:; ctx->pos= yypos155; ctx->thunkpos= yythunkpos155; + } if (!yymatchDot(ctx)) goto l149; + l152:; + { int yypos153= ctx->pos, yythunkpos153= ctx->thunkpos; + { int yypos156= ctx->pos, yythunkpos156= ctx->thunkpos; if (!yy_Newline(ctx)) goto l156; goto l153; + l156:; ctx->pos= yypos156; ctx->thunkpos= yythunkpos156; + } + { int yypos157= ctx->pos, yythunkpos157= ctx->thunkpos; if (!yymatchChar(ctx, '>')) goto l157; goto l153; + l157:; ctx->pos= yypos157; ctx->thunkpos= yythunkpos157; + } if (!yymatchDot(ctx)) goto l153; goto l152; + l153:; ctx->pos= yypos153; ctx->thunkpos= yythunkpos153; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l149; if (!yymatchChar(ctx, '>')) goto l149; yyDo(ctx, yy_1_AutoLinkUrl, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "AutoLinkUrl", ctx->buf+ctx->pos)); + return 1; + l149:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "AutoLinkUrl", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_TitleDouble(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "TitleDouble")); if (!yymatchChar(ctx, '"')) goto l158; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l158; + l159:; + { int yypos160= ctx->pos, yythunkpos160= ctx->thunkpos; + { int yypos161= ctx->pos, yythunkpos161= ctx->thunkpos; if (!yymatchChar(ctx, '"')) goto l161; if (!yy_Sp(ctx)) goto l161; + { int yypos162= ctx->pos, yythunkpos162= ctx->thunkpos; if (!yymatchChar(ctx, ')')) goto l163; goto l162; + l163:; ctx->pos= yypos162; ctx->thunkpos= yythunkpos162; if (!yy_Newline(ctx)) goto l161; + } + l162:; goto l160; + l161:; ctx->pos= yypos161; ctx->thunkpos= yythunkpos161; + } if (!yymatchDot(ctx)) goto l160; goto l159; + l160:; ctx->pos= yypos160; ctx->thunkpos= yythunkpos160; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l158; if (!yymatchChar(ctx, '"')) goto l158; + yyprintf((stderr, " ok %s @ %s\n", "TitleDouble", ctx->buf+ctx->pos)); + return 1; + l158:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "TitleDouble", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_TitleSingle(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "TitleSingle")); if (!yymatchChar(ctx, '\'')) goto l164; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l164; + l165:; + { int yypos166= ctx->pos, yythunkpos166= ctx->thunkpos; + { int yypos167= ctx->pos, yythunkpos167= ctx->thunkpos; if (!yymatchChar(ctx, '\'')) goto l167; if (!yy_Sp(ctx)) goto l167; + { int yypos168= ctx->pos, yythunkpos168= ctx->thunkpos; if (!yymatchChar(ctx, ')')) goto l169; goto l168; + l169:; ctx->pos= yypos168; ctx->thunkpos= yythunkpos168; if (!yy_Newline(ctx)) goto l167; + } + l168:; goto l166; + l167:; ctx->pos= yypos167; ctx->thunkpos= yythunkpos167; + } if (!yymatchDot(ctx)) goto l166; goto l165; + l166:; ctx->pos= yypos166; ctx->thunkpos= yythunkpos166; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l164; if (!yymatchChar(ctx, '\'')) goto l164; + yyprintf((stderr, " ok %s @ %s\n", "TitleSingle", ctx->buf+ctx->pos)); + return 1; + l164:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "TitleSingle", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Nonspacechar(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Nonspacechar")); + { int yypos171= ctx->pos, yythunkpos171= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l171; goto l170; + l171:; ctx->pos= yypos171; ctx->thunkpos= yythunkpos171; + } + { int yypos172= ctx->pos, yythunkpos172= ctx->thunkpos; if (!yy_Newline(ctx)) goto l172; goto l170; + l172:; ctx->pos= yypos172; ctx->thunkpos= yythunkpos172; + } if (!yymatchDot(ctx)) goto l170; + yyprintf((stderr, " ok %s @ %s\n", "Nonspacechar", ctx->buf+ctx->pos)); + return 1; + l170:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Nonspacechar", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_SourceContents(yycontext *ctx) +{ + yyprintf((stderr, "%s\n", "SourceContents")); + l174:; + { int yypos175= ctx->pos, yythunkpos175= ctx->thunkpos; + { int yypos176= ctx->pos, yythunkpos176= ctx->thunkpos; + { int yypos180= ctx->pos, yythunkpos180= ctx->thunkpos; if (!yymatchChar(ctx, '(')) goto l180; goto l177; + l180:; ctx->pos= yypos180; ctx->thunkpos= yythunkpos180; + } + { int yypos181= ctx->pos, yythunkpos181= ctx->thunkpos; if (!yymatchChar(ctx, ')')) goto l181; goto l177; + l181:; ctx->pos= yypos181; ctx->thunkpos= yythunkpos181; + } + { int yypos182= ctx->pos, yythunkpos182= ctx->thunkpos; if (!yymatchChar(ctx, '>')) goto l182; goto l177; + l182:; ctx->pos= yypos182; ctx->thunkpos= yythunkpos182; + } if (!yy_Nonspacechar(ctx)) goto l177; + l178:; + { int yypos179= ctx->pos, yythunkpos179= ctx->thunkpos; + { int yypos183= ctx->pos, yythunkpos183= ctx->thunkpos; if (!yymatchChar(ctx, '(')) goto l183; goto l179; + l183:; ctx->pos= yypos183; ctx->thunkpos= yythunkpos183; + } + { int yypos184= ctx->pos, yythunkpos184= ctx->thunkpos; if (!yymatchChar(ctx, ')')) goto l184; goto l179; + l184:; ctx->pos= yypos184; ctx->thunkpos= yythunkpos184; + } + { int yypos185= ctx->pos, yythunkpos185= ctx->thunkpos; if (!yymatchChar(ctx, '>')) goto l185; goto l179; + l185:; ctx->pos= yypos185; ctx->thunkpos= yythunkpos185; + } if (!yy_Nonspacechar(ctx)) goto l179; goto l178; + l179:; ctx->pos= yypos179; ctx->thunkpos= yythunkpos179; + } goto l176; + l177:; ctx->pos= yypos176; ctx->thunkpos= yythunkpos176; if (!yymatchChar(ctx, '(')) goto l175; if (!yy_SourceContents(ctx)) goto l175; if (!yymatchChar(ctx, ')')) goto l175; + } + l176:; goto l174; + l175:; ctx->pos= yypos175; ctx->thunkpos= yythunkpos175; + } + yyprintf((stderr, " ok %s @ %s\n", "SourceContents", ctx->buf+ctx->pos)); + return 1; +} +YY_RULE(int) yy_Title(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Title")); + { int yypos187= ctx->pos, yythunkpos187= ctx->thunkpos; if (!yy_TitleSingle(ctx)) goto l188; goto l187; + l188:; ctx->pos= yypos187; ctx->thunkpos= yythunkpos187; if (!yy_TitleDouble(ctx)) goto l189; goto l187; + l189:; ctx->pos= yypos187; ctx->thunkpos= yythunkpos187; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l186; if (!yymatchString(ctx, "")) goto l186; yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l186; + } + l187:; yyDo(ctx, yy_1_Title, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Title", ctx->buf+ctx->pos)); + return 1; + l186:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Title", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Source(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Source")); + { int yypos191= ctx->pos, yythunkpos191= ctx->thunkpos; if (!yymatchChar(ctx, '<')) goto l192; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l192; if (!yy_SourceContents(ctx)) goto l192; yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l192; if (!yymatchChar(ctx, '>')) goto l192; goto l191; + l192:; ctx->pos= yypos191; ctx->thunkpos= yythunkpos191; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l190; if (!yy_SourceContents(ctx)) goto l190; yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l190; + } + l191:; yyDo(ctx, yy_1_Source, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Source", ctx->buf+ctx->pos)); + return 1; + l190:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Source", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Label(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "Label")); if (!yymatchChar(ctx, '[')) goto l193; + { int yypos194= ctx->pos, yythunkpos194= ctx->thunkpos; + { int yypos196= ctx->pos, yythunkpos196= ctx->thunkpos; if (!yymatchChar(ctx, '^')) goto l196; goto l195; + l196:; ctx->pos= yypos196; ctx->thunkpos= yythunkpos196; + } yyText(ctx, ctx->begin, ctx->end); if (!( extension(EXT_NOTES) )) goto l195; goto l194; + l195:; ctx->pos= yypos194; ctx->thunkpos= yythunkpos194; + { int yypos197= ctx->pos, yythunkpos197= ctx->thunkpos; if (!yymatchDot(ctx)) goto l193; ctx->pos= yypos197; ctx->thunkpos= yythunkpos197; + } yyText(ctx, ctx->begin, ctx->end); if (!( !extension(EXT_NOTES) )) goto l193; + } + l194:; if (!yy_StartList(ctx)) goto l193; yyDo(ctx, yySet, -1, 0); + l198:; + { int yypos199= ctx->pos, yythunkpos199= ctx->thunkpos; + { int yypos200= ctx->pos, yythunkpos200= ctx->thunkpos; if (!yymatchChar(ctx, ']')) goto l200; goto l199; + l200:; ctx->pos= yypos200; ctx->thunkpos= yythunkpos200; + } if (!yy_Inline(ctx)) goto l199; yyDo(ctx, yy_1_Label, ctx->begin, ctx->end); goto l198; + l199:; ctx->pos= yypos199; ctx->thunkpos= yythunkpos199; + } if (!yymatchChar(ctx, ']')) goto l193; yyDo(ctx, yy_2_Label, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Label", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l193:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Label", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_ReferenceLinkSingle(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "ReferenceLinkSingle")); if (!yy_Label(ctx)) goto l201; yyDo(ctx, yySet, -1, 0); yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l201; + { int yypos202= ctx->pos, yythunkpos202= ctx->thunkpos; if (!yy_Spnl(ctx)) goto l202; if (!yymatchString(ctx, "[]")) goto l202; goto l203; + l202:; ctx->pos= yypos202; ctx->thunkpos= yythunkpos202; + } + l203:; yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l201; yyDo(ctx, yy_1_ReferenceLinkSingle, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "ReferenceLinkSingle", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l201:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "ReferenceLinkSingle", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_ReferenceLinkDouble(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 2, 0); + yyprintf((stderr, "%s\n", "ReferenceLinkDouble")); if (!yy_Label(ctx)) goto l204; yyDo(ctx, yySet, -2, 0); yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l204; if (!yy_Spnl(ctx)) goto l204; yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l204; + { int yypos205= ctx->pos, yythunkpos205= ctx->thunkpos; if (!yymatchString(ctx, "[]")) goto l205; goto l204; + l205:; ctx->pos= yypos205; ctx->thunkpos= yythunkpos205; + } if (!yy_Label(ctx)) goto l204; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_ReferenceLinkDouble, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "ReferenceLinkDouble", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 2, 0); + return 1; + l204:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "ReferenceLinkDouble", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_AutoLink(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "AutoLink")); + { int yypos207= ctx->pos, yythunkpos207= ctx->thunkpos; if (!yy_AutoLinkUrl(ctx)) goto l208; goto l207; + l208:; ctx->pos= yypos207; ctx->thunkpos= yythunkpos207; if (!yy_AutoLinkEmail(ctx)) goto l206; + } + l207:; + yyprintf((stderr, " ok %s @ %s\n", "AutoLink", ctx->buf+ctx->pos)); + return 1; + l206:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "AutoLink", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_ReferenceLink(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "ReferenceLink")); + { int yypos210= ctx->pos, yythunkpos210= ctx->thunkpos; if (!yy_ReferenceLinkDouble(ctx)) goto l211; goto l210; + l211:; ctx->pos= yypos210; ctx->thunkpos= yythunkpos210; if (!yy_ReferenceLinkSingle(ctx)) goto l209; + } + l210:; + yyprintf((stderr, " ok %s @ %s\n", "ReferenceLink", ctx->buf+ctx->pos)); + return 1; + l209:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "ReferenceLink", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_ExplicitLink(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 3, 0); + yyprintf((stderr, "%s\n", "ExplicitLink")); if (!yy_Label(ctx)) goto l212; yyDo(ctx, yySet, -3, 0); if (!yymatchChar(ctx, '(')) goto l212; if (!yy_Sp(ctx)) goto l212; if (!yy_Source(ctx)) goto l212; yyDo(ctx, yySet, -2, 0); if (!yy_Spnl(ctx)) goto l212; if (!yy_Title(ctx)) goto l212; yyDo(ctx, yySet, -1, 0); if (!yy_Sp(ctx)) goto l212; if (!yymatchChar(ctx, ')')) goto l212; yyDo(ctx, yy_1_ExplicitLink, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "ExplicitLink", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 3, 0); + return 1; + l212:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "ExplicitLink", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_StrongUl(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 2, 0); + yyprintf((stderr, "%s\n", "StrongUl")); if (!yymatchString(ctx, "__")) goto l213; + { int yypos214= ctx->pos, yythunkpos214= ctx->thunkpos; if (!yy_Whitespace(ctx)) goto l214; goto l213; + l214:; ctx->pos= yypos214; ctx->thunkpos= yythunkpos214; + } if (!yy_StartList(ctx)) goto l213; yyDo(ctx, yySet, -2, 0); + { int yypos217= ctx->pos, yythunkpos217= ctx->thunkpos; if (!yymatchString(ctx, "__")) goto l217; goto l213; + l217:; ctx->pos= yypos217; ctx->thunkpos= yythunkpos217; + } if (!yy_Inline(ctx)) goto l213; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_StrongUl, ctx->begin, ctx->end); + l215:; + { int yypos216= ctx->pos, yythunkpos216= ctx->thunkpos; + { int yypos218= ctx->pos, yythunkpos218= ctx->thunkpos; if (!yymatchString(ctx, "__")) goto l218; goto l216; + l218:; ctx->pos= yypos218; ctx->thunkpos= yythunkpos218; + } if (!yy_Inline(ctx)) goto l216; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_StrongUl, ctx->begin, ctx->end); goto l215; + l216:; ctx->pos= yypos216; ctx->thunkpos= yythunkpos216; + } if (!yymatchString(ctx, "__")) goto l213; yyDo(ctx, yy_2_StrongUl, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "StrongUl", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 2, 0); + return 1; + l213:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "StrongUl", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_StrongStar(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 2, 0); + yyprintf((stderr, "%s\n", "StrongStar")); if (!yymatchString(ctx, "**")) goto l219; + { int yypos220= ctx->pos, yythunkpos220= ctx->thunkpos; if (!yy_Whitespace(ctx)) goto l220; goto l219; + l220:; ctx->pos= yypos220; ctx->thunkpos= yythunkpos220; + } if (!yy_StartList(ctx)) goto l219; yyDo(ctx, yySet, -2, 0); + { int yypos223= ctx->pos, yythunkpos223= ctx->thunkpos; if (!yymatchString(ctx, "**")) goto l223; goto l219; + l223:; ctx->pos= yypos223; ctx->thunkpos= yythunkpos223; + } if (!yy_Inline(ctx)) goto l219; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_StrongStar, ctx->begin, ctx->end); + l221:; + { int yypos222= ctx->pos, yythunkpos222= ctx->thunkpos; + { int yypos224= ctx->pos, yythunkpos224= ctx->thunkpos; if (!yymatchString(ctx, "**")) goto l224; goto l222; + l224:; ctx->pos= yypos224; ctx->thunkpos= yythunkpos224; + } if (!yy_Inline(ctx)) goto l222; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_StrongStar, ctx->begin, ctx->end); goto l221; + l222:; ctx->pos= yypos222; ctx->thunkpos= yythunkpos222; + } if (!yymatchString(ctx, "**")) goto l219; yyDo(ctx, yy_2_StrongStar, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "StrongStar", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 2, 0); + return 1; + l219:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "StrongStar", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Whitespace(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Whitespace")); + { int yypos226= ctx->pos, yythunkpos226= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l227; goto l226; + l227:; ctx->pos= yypos226; ctx->thunkpos= yythunkpos226; if (!yy_Newline(ctx)) goto l225; + } + l226:; + yyprintf((stderr, " ok %s @ %s\n", "Whitespace", ctx->buf+ctx->pos)); + return 1; + l225:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Whitespace", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_EmphUl(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 2, 0); + yyprintf((stderr, "%s\n", "EmphUl")); if (!yymatchChar(ctx, '_')) goto l228; + { int yypos229= ctx->pos, yythunkpos229= ctx->thunkpos; if (!yy_Whitespace(ctx)) goto l229; goto l228; + l229:; ctx->pos= yypos229; ctx->thunkpos= yythunkpos229; + } if (!yy_StartList(ctx)) goto l228; yyDo(ctx, yySet, -2, 0); + { int yypos232= ctx->pos, yythunkpos232= ctx->thunkpos; + { int yypos234= ctx->pos, yythunkpos234= ctx->thunkpos; if (!yymatchChar(ctx, '_')) goto l234; goto l233; + l234:; ctx->pos= yypos234; ctx->thunkpos= yythunkpos234; + } if (!yy_Inline(ctx)) goto l233; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_EmphUl, ctx->begin, ctx->end); goto l232; + l233:; ctx->pos= yypos232; ctx->thunkpos= yythunkpos232; if (!yy_StrongUl(ctx)) goto l228; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_2_EmphUl, ctx->begin, ctx->end); + } + l232:; + l230:; + { int yypos231= ctx->pos, yythunkpos231= ctx->thunkpos; + { int yypos235= ctx->pos, yythunkpos235= ctx->thunkpos; + { int yypos237= ctx->pos, yythunkpos237= ctx->thunkpos; if (!yymatchChar(ctx, '_')) goto l237; goto l236; + l237:; ctx->pos= yypos237; ctx->thunkpos= yythunkpos237; + } if (!yy_Inline(ctx)) goto l236; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_EmphUl, ctx->begin, ctx->end); goto l235; + l236:; ctx->pos= yypos235; ctx->thunkpos= yythunkpos235; if (!yy_StrongUl(ctx)) goto l231; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_2_EmphUl, ctx->begin, ctx->end); + } + l235:; goto l230; + l231:; ctx->pos= yypos231; ctx->thunkpos= yythunkpos231; + } if (!yymatchChar(ctx, '_')) goto l228; yyDo(ctx, yy_3_EmphUl, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "EmphUl", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 2, 0); + return 1; + l228:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "EmphUl", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_EmphStar(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 2, 0); + yyprintf((stderr, "%s\n", "EmphStar")); if (!yymatchChar(ctx, '*')) goto l238; + { int yypos239= ctx->pos, yythunkpos239= ctx->thunkpos; if (!yy_Whitespace(ctx)) goto l239; goto l238; + l239:; ctx->pos= yypos239; ctx->thunkpos= yythunkpos239; + } if (!yy_StartList(ctx)) goto l238; yyDo(ctx, yySet, -2, 0); + { int yypos242= ctx->pos, yythunkpos242= ctx->thunkpos; + { int yypos244= ctx->pos, yythunkpos244= ctx->thunkpos; if (!yymatchChar(ctx, '*')) goto l244; goto l243; + l244:; ctx->pos= yypos244; ctx->thunkpos= yythunkpos244; + } if (!yy_Inline(ctx)) goto l243; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_EmphStar, ctx->begin, ctx->end); goto l242; + l243:; ctx->pos= yypos242; ctx->thunkpos= yythunkpos242; if (!yy_StrongStar(ctx)) goto l238; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_2_EmphStar, ctx->begin, ctx->end); + } + l242:; + l240:; + { int yypos241= ctx->pos, yythunkpos241= ctx->thunkpos; + { int yypos245= ctx->pos, yythunkpos245= ctx->thunkpos; + { int yypos247= ctx->pos, yythunkpos247= ctx->thunkpos; if (!yymatchChar(ctx, '*')) goto l247; goto l246; + l247:; ctx->pos= yypos247; ctx->thunkpos= yythunkpos247; + } if (!yy_Inline(ctx)) goto l246; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_EmphStar, ctx->begin, ctx->end); goto l245; + l246:; ctx->pos= yypos245; ctx->thunkpos= yythunkpos245; if (!yy_StrongStar(ctx)) goto l241; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_2_EmphStar, ctx->begin, ctx->end); + } + l245:; goto l240; + l241:; ctx->pos= yypos241; ctx->thunkpos= yythunkpos241; + } if (!yymatchChar(ctx, '*')) goto l238; yyDo(ctx, yy_3_EmphStar, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "EmphStar", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 2, 0); + return 1; + l238:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "EmphStar", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_StarLine(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "StarLine")); + { int yypos249= ctx->pos, yythunkpos249= ctx->thunkpos; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l250; if (!yymatchString(ctx, "****")) goto l250; + l251:; + { int yypos252= ctx->pos, yythunkpos252= ctx->thunkpos; if (!yymatchChar(ctx, '*')) goto l252; goto l251; + l252:; ctx->pos= yypos252; ctx->thunkpos= yythunkpos252; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l250; goto l249; + l250:; ctx->pos= yypos249; ctx->thunkpos= yythunkpos249; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l248; if (!yy_Spacechar(ctx)) goto l248; if (!yymatchChar(ctx, '*')) goto l248; + l253:; + { int yypos254= ctx->pos, yythunkpos254= ctx->thunkpos; if (!yymatchChar(ctx, '*')) goto l254; goto l253; + l254:; ctx->pos= yypos254; ctx->thunkpos= yythunkpos254; + } + { int yypos255= ctx->pos, yythunkpos255= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l248; ctx->pos= yypos255; ctx->thunkpos= yythunkpos255; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l248; + } + l249:; + yyprintf((stderr, " ok %s @ %s\n", "StarLine", ctx->buf+ctx->pos)); + return 1; + l248:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "StarLine", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_UlLine(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "UlLine")); + { int yypos257= ctx->pos, yythunkpos257= ctx->thunkpos; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l258; if (!yymatchString(ctx, "____")) goto l258; + l259:; + { int yypos260= ctx->pos, yythunkpos260= ctx->thunkpos; if (!yymatchChar(ctx, '_')) goto l260; goto l259; + l260:; ctx->pos= yypos260; ctx->thunkpos= yythunkpos260; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l258; goto l257; + l258:; ctx->pos= yypos257; ctx->thunkpos= yythunkpos257; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l256; if (!yy_Spacechar(ctx)) goto l256; if (!yymatchChar(ctx, '_')) goto l256; + l261:; + { int yypos262= ctx->pos, yythunkpos262= ctx->thunkpos; if (!yymatchChar(ctx, '_')) goto l262; goto l261; + l262:; ctx->pos= yypos262; ctx->thunkpos= yythunkpos262; + } + { int yypos263= ctx->pos, yythunkpos263= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l256; ctx->pos= yypos263; ctx->thunkpos= yythunkpos263; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l256; + } + l257:; + yyprintf((stderr, " ok %s @ %s\n", "UlLine", ctx->buf+ctx->pos)); + return 1; + l256:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "UlLine", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_SpecialChar(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "SpecialChar")); + { int yypos265= ctx->pos, yythunkpos265= ctx->thunkpos; if (!yymatchChar(ctx, '*')) goto l266; goto l265; + l266:; ctx->pos= yypos265; ctx->thunkpos= yythunkpos265; if (!yymatchChar(ctx, '_')) goto l267; goto l265; + l267:; ctx->pos= yypos265; ctx->thunkpos= yythunkpos265; if (!yymatchChar(ctx, '`')) goto l268; goto l265; + l268:; ctx->pos= yypos265; ctx->thunkpos= yythunkpos265; if (!yymatchChar(ctx, '&')) goto l269; goto l265; + l269:; ctx->pos= yypos265; ctx->thunkpos= yythunkpos265; if (!yymatchChar(ctx, '[')) goto l270; goto l265; + l270:; ctx->pos= yypos265; ctx->thunkpos= yythunkpos265; if (!yymatchChar(ctx, ']')) goto l271; goto l265; + l271:; ctx->pos= yypos265; ctx->thunkpos= yythunkpos265; if (!yymatchChar(ctx, '(')) goto l272; goto l265; + l272:; ctx->pos= yypos265; ctx->thunkpos= yythunkpos265; if (!yymatchChar(ctx, ')')) goto l273; goto l265; + l273:; ctx->pos= yypos265; ctx->thunkpos= yythunkpos265; if (!yymatchChar(ctx, '<')) goto l274; goto l265; + l274:; ctx->pos= yypos265; ctx->thunkpos= yythunkpos265; if (!yymatchChar(ctx, '!')) goto l275; goto l265; + l275:; ctx->pos= yypos265; ctx->thunkpos= yythunkpos265; if (!yymatchChar(ctx, '#')) goto l276; goto l265; + l276:; ctx->pos= yypos265; ctx->thunkpos= yythunkpos265; if (!yymatchChar(ctx, '\\')) goto l277; goto l265; + l277:; ctx->pos= yypos265; ctx->thunkpos= yythunkpos265; if (!yymatchChar(ctx, '\'')) goto l278; goto l265; + l278:; ctx->pos= yypos265; ctx->thunkpos= yythunkpos265; if (!yymatchChar(ctx, '"')) goto l279; goto l265; + l279:; ctx->pos= yypos265; ctx->thunkpos= yythunkpos265; if (!yy_ExtendedSpecialChar(ctx)) goto l264; + } + l265:; + yyprintf((stderr, " ok %s @ %s\n", "SpecialChar", ctx->buf+ctx->pos)); + return 1; + l264:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "SpecialChar", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Eof(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Eof")); + { int yypos281= ctx->pos, yythunkpos281= ctx->thunkpos; if (!yymatchDot(ctx)) goto l281; goto l280; + l281:; ctx->pos= yypos281; ctx->thunkpos= yythunkpos281; + } + yyprintf((stderr, " ok %s @ %s\n", "Eof", ctx->buf+ctx->pos)); + return 1; + l280:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Eof", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_NormalEndline(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "NormalEndline")); if (!yy_Sp(ctx)) goto l282; if (!yy_Newline(ctx)) goto l282; + { int yypos283= ctx->pos, yythunkpos283= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l283; goto l282; + l283:; ctx->pos= yypos283; ctx->thunkpos= yythunkpos283; + } + { int yypos284= ctx->pos, yythunkpos284= ctx->thunkpos; if (!yymatchChar(ctx, '>')) goto l284; goto l282; + l284:; ctx->pos= yypos284; ctx->thunkpos= yythunkpos284; + } + { int yypos285= ctx->pos, yythunkpos285= ctx->thunkpos; if (!yy_AtxStart(ctx)) goto l285; goto l282; + l285:; ctx->pos= yypos285; ctx->thunkpos= yythunkpos285; + } + { int yypos286= ctx->pos, yythunkpos286= ctx->thunkpos; if (!yy_Line(ctx)) goto l286; + { int yypos287= ctx->pos, yythunkpos287= ctx->thunkpos; if (!yymatchChar(ctx, '=')) goto l288; + l289:; + { int yypos290= ctx->pos, yythunkpos290= ctx->thunkpos; if (!yymatchChar(ctx, '=')) goto l290; goto l289; + l290:; ctx->pos= yypos290; ctx->thunkpos= yythunkpos290; + } goto l287; + l288:; ctx->pos= yypos287; ctx->thunkpos= yythunkpos287; if (!yymatchChar(ctx, '-')) goto l286; + l291:; + { int yypos292= ctx->pos, yythunkpos292= ctx->thunkpos; if (!yymatchChar(ctx, '-')) goto l292; goto l291; + l292:; ctx->pos= yypos292; ctx->thunkpos= yythunkpos292; + } + } + l287:; if (!yy_Newline(ctx)) goto l286; goto l282; + l286:; ctx->pos= yypos286; ctx->thunkpos= yythunkpos286; + } yyDo(ctx, yy_1_NormalEndline, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "NormalEndline", ctx->buf+ctx->pos)); + return 1; + l282:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "NormalEndline", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_TerminalEndline(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "TerminalEndline")); if (!yy_Sp(ctx)) goto l293; if (!yy_Newline(ctx)) goto l293; if (!yy_Eof(ctx)) goto l293; yyDo(ctx, yy_1_TerminalEndline, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "TerminalEndline", ctx->buf+ctx->pos)); + return 1; + l293:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "TerminalEndline", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_LineBreak(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "LineBreak")); if (!yymatchString(ctx, " ")) goto l294; if (!yy_NormalEndline(ctx)) goto l294; yyDo(ctx, yy_1_LineBreak, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "LineBreak", ctx->buf+ctx->pos)); + return 1; + l294:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "LineBreak", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_CharEntity(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "CharEntity")); yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l295; if (!yymatchChar(ctx, '&')) goto l295; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\377\003\376\377\377\007\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l295; + l296:; + { int yypos297= ctx->pos, yythunkpos297= ctx->thunkpos; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\377\003\376\377\377\007\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l297; goto l296; + l297:; ctx->pos= yypos297; ctx->thunkpos= yythunkpos297; + } if (!yymatchChar(ctx, ';')) goto l295; yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l295; + yyprintf((stderr, " ok %s @ %s\n", "CharEntity", ctx->buf+ctx->pos)); + return 1; + l295:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "CharEntity", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_DecEntity(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "DecEntity")); yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l298; if (!yymatchChar(ctx, '&')) goto l298; if (!yymatchChar(ctx, '#')) goto l298; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\377\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l298; + l299:; + { int yypos300= ctx->pos, yythunkpos300= ctx->thunkpos; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\377\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l300; goto l299; + l300:; ctx->pos= yypos300; ctx->thunkpos= yythunkpos300; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l298; if (!yymatchChar(ctx, ';')) goto l298; yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l298; + yyprintf((stderr, " ok %s @ %s\n", "DecEntity", ctx->buf+ctx->pos)); + return 1; + l298:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "DecEntity", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HexEntity(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HexEntity")); yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l301; if (!yymatchChar(ctx, '&')) goto l301; if (!yymatchChar(ctx, '#')) goto l301; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l301; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\377\003\176\000\000\000\176\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l301; + l302:; + { int yypos303= ctx->pos, yythunkpos303= ctx->thunkpos; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\377\003\176\000\000\000\176\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l303; goto l302; + l303:; ctx->pos= yypos303; ctx->thunkpos= yythunkpos303; + } if (!yymatchChar(ctx, ';')) goto l301; yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l301; + yyprintf((stderr, " ok %s @ %s\n", "HexEntity", ctx->buf+ctx->pos)); + return 1; + l301:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HexEntity", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_AposChunk(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "AposChunk")); yyText(ctx, ctx->begin, ctx->end); if (!( extension(EXT_SMART) )) goto l304; if (!yymatchChar(ctx, '\'')) goto l304; + { int yypos305= ctx->pos, yythunkpos305= ctx->thunkpos; if (!yy_Alphanumeric(ctx)) goto l304; ctx->pos= yypos305; ctx->thunkpos= yythunkpos305; + } yyDo(ctx, yy_1_AposChunk, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "AposChunk", ctx->buf+ctx->pos)); + return 1; + l304:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "AposChunk", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Alphanumeric(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Alphanumeric")); + { int yypos307= ctx->pos, yythunkpos307= ctx->thunkpos; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\377\003\376\377\377\007\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l308; goto l307; + l308:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\200")) goto l309; goto l307; + l309:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\201")) goto l310; goto l307; + l310:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\202")) goto l311; goto l307; + l311:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\203")) goto l312; goto l307; + l312:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\204")) goto l313; goto l307; + l313:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\205")) goto l314; goto l307; + l314:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\206")) goto l315; goto l307; + l315:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\207")) goto l316; goto l307; + l316:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\210")) goto l317; goto l307; + l317:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\211")) goto l318; goto l307; + l318:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\212")) goto l319; goto l307; + l319:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\213")) goto l320; goto l307; + l320:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\214")) goto l321; goto l307; + l321:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\215")) goto l322; goto l307; + l322:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\216")) goto l323; goto l307; + l323:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\217")) goto l324; goto l307; + l324:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\220")) goto l325; goto l307; + l325:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\221")) goto l326; goto l307; + l326:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\222")) goto l327; goto l307; + l327:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\223")) goto l328; goto l307; + l328:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\224")) goto l329; goto l307; + l329:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\225")) goto l330; goto l307; + l330:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\226")) goto l331; goto l307; + l331:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\227")) goto l332; goto l307; + l332:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\230")) goto l333; goto l307; + l333:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\231")) goto l334; goto l307; + l334:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\232")) goto l335; goto l307; + l335:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\233")) goto l336; goto l307; + l336:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\234")) goto l337; goto l307; + l337:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\235")) goto l338; goto l307; + l338:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\236")) goto l339; goto l307; + l339:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\237")) goto l340; goto l307; + l340:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\240")) goto l341; goto l307; + l341:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\241")) goto l342; goto l307; + l342:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\242")) goto l343; goto l307; + l343:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\243")) goto l344; goto l307; + l344:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\244")) goto l345; goto l307; + l345:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\245")) goto l346; goto l307; + l346:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\246")) goto l347; goto l307; + l347:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\247")) goto l348; goto l307; + l348:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\250")) goto l349; goto l307; + l349:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\251")) goto l350; goto l307; + l350:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\252")) goto l351; goto l307; + l351:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\253")) goto l352; goto l307; + l352:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\254")) goto l353; goto l307; + l353:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\255")) goto l354; goto l307; + l354:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\256")) goto l355; goto l307; + l355:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\257")) goto l356; goto l307; + l356:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\260")) goto l357; goto l307; + l357:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\261")) goto l358; goto l307; + l358:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\262")) goto l359; goto l307; + l359:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\263")) goto l360; goto l307; + l360:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\264")) goto l361; goto l307; + l361:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\265")) goto l362; goto l307; + l362:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\266")) goto l363; goto l307; + l363:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\267")) goto l364; goto l307; + l364:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\270")) goto l365; goto l307; + l365:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\271")) goto l366; goto l307; + l366:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\272")) goto l367; goto l307; + l367:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\273")) goto l368; goto l307; + l368:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\274")) goto l369; goto l307; + l369:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\275")) goto l370; goto l307; + l370:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\276")) goto l371; goto l307; + l371:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\277")) goto l372; goto l307; + l372:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\300")) goto l373; goto l307; + l373:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\301")) goto l374; goto l307; + l374:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\302")) goto l375; goto l307; + l375:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\303")) goto l376; goto l307; + l376:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\304")) goto l377; goto l307; + l377:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\305")) goto l378; goto l307; + l378:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\306")) goto l379; goto l307; + l379:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\307")) goto l380; goto l307; + l380:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\310")) goto l381; goto l307; + l381:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\311")) goto l382; goto l307; + l382:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\312")) goto l383; goto l307; + l383:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\313")) goto l384; goto l307; + l384:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\314")) goto l385; goto l307; + l385:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\315")) goto l386; goto l307; + l386:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\316")) goto l387; goto l307; + l387:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\317")) goto l388; goto l307; + l388:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\320")) goto l389; goto l307; + l389:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\321")) goto l390; goto l307; + l390:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\322")) goto l391; goto l307; + l391:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\323")) goto l392; goto l307; + l392:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\324")) goto l393; goto l307; + l393:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\325")) goto l394; goto l307; + l394:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\326")) goto l395; goto l307; + l395:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\327")) goto l396; goto l307; + l396:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\330")) goto l397; goto l307; + l397:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\331")) goto l398; goto l307; + l398:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\332")) goto l399; goto l307; + l399:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\333")) goto l400; goto l307; + l400:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\334")) goto l401; goto l307; + l401:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\335")) goto l402; goto l307; + l402:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\336")) goto l403; goto l307; + l403:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\337")) goto l404; goto l307; + l404:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\340")) goto l405; goto l307; + l405:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\341")) goto l406; goto l307; + l406:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\342")) goto l407; goto l307; + l407:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\343")) goto l408; goto l307; + l408:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\344")) goto l409; goto l307; + l409:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\345")) goto l410; goto l307; + l410:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\346")) goto l411; goto l307; + l411:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\347")) goto l412; goto l307; + l412:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\350")) goto l413; goto l307; + l413:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\351")) goto l414; goto l307; + l414:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\352")) goto l415; goto l307; + l415:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\353")) goto l416; goto l307; + l416:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\354")) goto l417; goto l307; + l417:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\355")) goto l418; goto l307; + l418:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\356")) goto l419; goto l307; + l419:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\357")) goto l420; goto l307; + l420:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\360")) goto l421; goto l307; + l421:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\361")) goto l422; goto l307; + l422:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\362")) goto l423; goto l307; + l423:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\363")) goto l424; goto l307; + l424:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\364")) goto l425; goto l307; + l425:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\365")) goto l426; goto l307; + l426:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\366")) goto l427; goto l307; + l427:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\367")) goto l428; goto l307; + l428:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\370")) goto l429; goto l307; + l429:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\371")) goto l430; goto l307; + l430:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\372")) goto l431; goto l307; + l431:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\373")) goto l432; goto l307; + l432:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\374")) goto l433; goto l307; + l433:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\375")) goto l434; goto l307; + l434:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\376")) goto l435; goto l307; + l435:; ctx->pos= yypos307; ctx->thunkpos= yythunkpos307; if (!yymatchString(ctx, "\377")) goto l306; + } + l307:; + yyprintf((stderr, " ok %s @ %s\n", "Alphanumeric", ctx->buf+ctx->pos)); + return 1; + l306:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Alphanumeric", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_StrChunk(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "StrChunk")); + { int yypos437= ctx->pos, yythunkpos437= ctx->thunkpos; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l438; + { int yypos441= ctx->pos, yythunkpos441= ctx->thunkpos; if (!yy_NormalChar(ctx)) goto l442; goto l441; + l442:; ctx->pos= yypos441; ctx->thunkpos= yythunkpos441; if (!yymatchChar(ctx, '_')) goto l438; + l443:; + { int yypos444= ctx->pos, yythunkpos444= ctx->thunkpos; if (!yymatchChar(ctx, '_')) goto l444; goto l443; + l444:; ctx->pos= yypos444; ctx->thunkpos= yythunkpos444; + } + { int yypos445= ctx->pos, yythunkpos445= ctx->thunkpos; if (!yy_Alphanumeric(ctx)) goto l438; ctx->pos= yypos445; ctx->thunkpos= yythunkpos445; + } + } + l441:; + l439:; + { int yypos440= ctx->pos, yythunkpos440= ctx->thunkpos; + { int yypos446= ctx->pos, yythunkpos446= ctx->thunkpos; if (!yy_NormalChar(ctx)) goto l447; goto l446; + l447:; ctx->pos= yypos446; ctx->thunkpos= yythunkpos446; if (!yymatchChar(ctx, '_')) goto l440; + l448:; + { int yypos449= ctx->pos, yythunkpos449= ctx->thunkpos; if (!yymatchChar(ctx, '_')) goto l449; goto l448; + l449:; ctx->pos= yypos449; ctx->thunkpos= yythunkpos449; + } + { int yypos450= ctx->pos, yythunkpos450= ctx->thunkpos; if (!yy_Alphanumeric(ctx)) goto l440; ctx->pos= yypos450; ctx->thunkpos= yythunkpos450; + } + } + l446:; goto l439; + l440:; ctx->pos= yypos440; ctx->thunkpos= yythunkpos440; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l438; yyDo(ctx, yy_1_StrChunk, ctx->begin, ctx->end); goto l437; + l438:; ctx->pos= yypos437; ctx->thunkpos= yythunkpos437; if (!yy_AposChunk(ctx)) goto l436; + } + l437:; + yyprintf((stderr, " ok %s @ %s\n", "StrChunk", ctx->buf+ctx->pos)); + return 1; + l436:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "StrChunk", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_NormalChar(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "NormalChar")); + { int yypos452= ctx->pos, yythunkpos452= ctx->thunkpos; + { int yypos453= ctx->pos, yythunkpos453= ctx->thunkpos; if (!yy_SpecialChar(ctx)) goto l454; goto l453; + l454:; ctx->pos= yypos453; ctx->thunkpos= yythunkpos453; if (!yy_Spacechar(ctx)) goto l455; goto l453; + l455:; ctx->pos= yypos453; ctx->thunkpos= yythunkpos453; if (!yy_Newline(ctx)) goto l452; + } + l453:; goto l451; + l452:; ctx->pos= yypos452; ctx->thunkpos= yythunkpos452; + } if (!yymatchDot(ctx)) goto l451; + yyprintf((stderr, " ok %s @ %s\n", "NormalChar", ctx->buf+ctx->pos)); + return 1; + l451:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "NormalChar", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Symbol(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Symbol")); yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l456; if (!yy_SpecialChar(ctx)) goto l456; yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l456; yyDo(ctx, yy_1_Symbol, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Symbol", ctx->buf+ctx->pos)); + return 1; + l456:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Symbol", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Smart(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Smart")); yyText(ctx, ctx->begin, ctx->end); if (!( extension(EXT_SMART) )) goto l457; + { int yypos458= ctx->pos, yythunkpos458= ctx->thunkpos; if (!yy_Ellipsis(ctx)) goto l459; goto l458; + l459:; ctx->pos= yypos458; ctx->thunkpos= yythunkpos458; if (!yy_Dash(ctx)) goto l460; goto l458; + l460:; ctx->pos= yypos458; ctx->thunkpos= yythunkpos458; if (!yy_SingleQuoted(ctx)) goto l461; goto l458; + l461:; ctx->pos= yypos458; ctx->thunkpos= yythunkpos458; if (!yy_DoubleQuoted(ctx)) goto l462; goto l458; + l462:; ctx->pos= yypos458; ctx->thunkpos= yythunkpos458; if (!yy_Apostrophe(ctx)) goto l457; + } + l458:; + yyprintf((stderr, " ok %s @ %s\n", "Smart", ctx->buf+ctx->pos)); + return 1; + l457:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Smart", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_EscapedChar(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "EscapedChar")); if (!yymatchChar(ctx, '\\')) goto l463; + { int yypos464= ctx->pos, yythunkpos464= ctx->thunkpos; if (!yy_Newline(ctx)) goto l464; goto l463; + l464:; ctx->pos= yypos464; ctx->thunkpos= yythunkpos464; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l463; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\012\157\000\120\000\000\000\270\001\000\000\070\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l463; yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l463; yyDo(ctx, yy_1_EscapedChar, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "EscapedChar", ctx->buf+ctx->pos)); + return 1; + l463:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "EscapedChar", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Entity(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Entity")); + { int yypos466= ctx->pos, yythunkpos466= ctx->thunkpos; if (!yy_HexEntity(ctx)) goto l467; goto l466; + l467:; ctx->pos= yypos466; ctx->thunkpos= yythunkpos466; if (!yy_DecEntity(ctx)) goto l468; goto l466; + l468:; ctx->pos= yypos466; ctx->thunkpos= yythunkpos466; if (!yy_CharEntity(ctx)) goto l465; + } + l466:; yyDo(ctx, yy_1_Entity, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Entity", ctx->buf+ctx->pos)); + return 1; + l465:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Entity", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_RawHtml(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "RawHtml")); yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l469; + { int yypos470= ctx->pos, yythunkpos470= ctx->thunkpos; if (!yy_HtmlComment(ctx)) goto l471; goto l470; + l471:; ctx->pos= yypos470; ctx->thunkpos= yythunkpos470; if (!yy_HtmlBlockScript(ctx)) goto l472; goto l470; + l472:; ctx->pos= yypos470; ctx->thunkpos= yythunkpos470; if (!yy_HtmlTag(ctx)) goto l469; + } + l470:; yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l469; yyDo(ctx, yy_1_RawHtml, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "RawHtml", ctx->buf+ctx->pos)); + return 1; + l469:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "RawHtml", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Code(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Code")); + { int yypos474= ctx->pos, yythunkpos474= ctx->thunkpos; if (!yy_Ticks1(ctx)) goto l475; if (!yy_Sp(ctx)) goto l475; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l475; + { int yypos478= ctx->pos, yythunkpos478= ctx->thunkpos; + { int yypos482= ctx->pos, yythunkpos482= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l482; goto l479; + l482:; ctx->pos= yypos482; ctx->thunkpos= yythunkpos482; + } if (!yy_Nonspacechar(ctx)) goto l479; + l480:; + { int yypos481= ctx->pos, yythunkpos481= ctx->thunkpos; + { int yypos483= ctx->pos, yythunkpos483= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l483; goto l481; + l483:; ctx->pos= yypos483; ctx->thunkpos= yythunkpos483; + } if (!yy_Nonspacechar(ctx)) goto l481; goto l480; + l481:; ctx->pos= yypos481; ctx->thunkpos= yythunkpos481; + } goto l478; + l479:; ctx->pos= yypos478; ctx->thunkpos= yythunkpos478; + { int yypos485= ctx->pos, yythunkpos485= ctx->thunkpos; if (!yy_Ticks1(ctx)) goto l485; goto l484; + l485:; ctx->pos= yypos485; ctx->thunkpos= yythunkpos485; + } if (!yymatchChar(ctx, '`')) goto l484; + l486:; + { int yypos487= ctx->pos, yythunkpos487= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l487; goto l486; + l487:; ctx->pos= yypos487; ctx->thunkpos= yythunkpos487; + } goto l478; + l484:; ctx->pos= yypos478; ctx->thunkpos= yythunkpos478; + { int yypos488= ctx->pos, yythunkpos488= ctx->thunkpos; if (!yy_Sp(ctx)) goto l488; if (!yy_Ticks1(ctx)) goto l488; goto l475; + l488:; ctx->pos= yypos488; ctx->thunkpos= yythunkpos488; + } + { int yypos489= ctx->pos, yythunkpos489= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l490; goto l489; + l490:; ctx->pos= yypos489; ctx->thunkpos= yythunkpos489; if (!yy_Newline(ctx)) goto l475; + { int yypos491= ctx->pos, yythunkpos491= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l491; goto l475; + l491:; ctx->pos= yypos491; ctx->thunkpos= yythunkpos491; + } + } + l489:; + } + l478:; + l476:; + { int yypos477= ctx->pos, yythunkpos477= ctx->thunkpos; + { int yypos492= ctx->pos, yythunkpos492= ctx->thunkpos; + { int yypos496= ctx->pos, yythunkpos496= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l496; goto l493; + l496:; ctx->pos= yypos496; ctx->thunkpos= yythunkpos496; + } if (!yy_Nonspacechar(ctx)) goto l493; + l494:; + { int yypos495= ctx->pos, yythunkpos495= ctx->thunkpos; + { int yypos497= ctx->pos, yythunkpos497= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l497; goto l495; + l497:; ctx->pos= yypos497; ctx->thunkpos= yythunkpos497; + } if (!yy_Nonspacechar(ctx)) goto l495; goto l494; + l495:; ctx->pos= yypos495; ctx->thunkpos= yythunkpos495; + } goto l492; + l493:; ctx->pos= yypos492; ctx->thunkpos= yythunkpos492; + { int yypos499= ctx->pos, yythunkpos499= ctx->thunkpos; if (!yy_Ticks1(ctx)) goto l499; goto l498; + l499:; ctx->pos= yypos499; ctx->thunkpos= yythunkpos499; + } if (!yymatchChar(ctx, '`')) goto l498; + l500:; + { int yypos501= ctx->pos, yythunkpos501= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l501; goto l500; + l501:; ctx->pos= yypos501; ctx->thunkpos= yythunkpos501; + } goto l492; + l498:; ctx->pos= yypos492; ctx->thunkpos= yythunkpos492; + { int yypos502= ctx->pos, yythunkpos502= ctx->thunkpos; if (!yy_Sp(ctx)) goto l502; if (!yy_Ticks1(ctx)) goto l502; goto l477; + l502:; ctx->pos= yypos502; ctx->thunkpos= yythunkpos502; + } + { int yypos503= ctx->pos, yythunkpos503= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l504; goto l503; + l504:; ctx->pos= yypos503; ctx->thunkpos= yythunkpos503; if (!yy_Newline(ctx)) goto l477; + { int yypos505= ctx->pos, yythunkpos505= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l505; goto l477; + l505:; ctx->pos= yypos505; ctx->thunkpos= yythunkpos505; + } + } + l503:; + } + l492:; goto l476; + l477:; ctx->pos= yypos477; ctx->thunkpos= yythunkpos477; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l475; if (!yy_Sp(ctx)) goto l475; if (!yy_Ticks1(ctx)) goto l475; goto l474; + l475:; ctx->pos= yypos474; ctx->thunkpos= yythunkpos474; if (!yy_Ticks2(ctx)) goto l506; if (!yy_Sp(ctx)) goto l506; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l506; + { int yypos509= ctx->pos, yythunkpos509= ctx->thunkpos; + { int yypos513= ctx->pos, yythunkpos513= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l513; goto l510; + l513:; ctx->pos= yypos513; ctx->thunkpos= yythunkpos513; + } if (!yy_Nonspacechar(ctx)) goto l510; + l511:; + { int yypos512= ctx->pos, yythunkpos512= ctx->thunkpos; + { int yypos514= ctx->pos, yythunkpos514= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l514; goto l512; + l514:; ctx->pos= yypos514; ctx->thunkpos= yythunkpos514; + } if (!yy_Nonspacechar(ctx)) goto l512; goto l511; + l512:; ctx->pos= yypos512; ctx->thunkpos= yythunkpos512; + } goto l509; + l510:; ctx->pos= yypos509; ctx->thunkpos= yythunkpos509; + { int yypos516= ctx->pos, yythunkpos516= ctx->thunkpos; if (!yy_Ticks2(ctx)) goto l516; goto l515; + l516:; ctx->pos= yypos516; ctx->thunkpos= yythunkpos516; + } if (!yymatchChar(ctx, '`')) goto l515; + l517:; + { int yypos518= ctx->pos, yythunkpos518= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l518; goto l517; + l518:; ctx->pos= yypos518; ctx->thunkpos= yythunkpos518; + } goto l509; + l515:; ctx->pos= yypos509; ctx->thunkpos= yythunkpos509; + { int yypos519= ctx->pos, yythunkpos519= ctx->thunkpos; if (!yy_Sp(ctx)) goto l519; if (!yy_Ticks2(ctx)) goto l519; goto l506; + l519:; ctx->pos= yypos519; ctx->thunkpos= yythunkpos519; + } + { int yypos520= ctx->pos, yythunkpos520= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l521; goto l520; + l521:; ctx->pos= yypos520; ctx->thunkpos= yythunkpos520; if (!yy_Newline(ctx)) goto l506; + { int yypos522= ctx->pos, yythunkpos522= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l522; goto l506; + l522:; ctx->pos= yypos522; ctx->thunkpos= yythunkpos522; + } + } + l520:; + } + l509:; + l507:; + { int yypos508= ctx->pos, yythunkpos508= ctx->thunkpos; + { int yypos523= ctx->pos, yythunkpos523= ctx->thunkpos; + { int yypos527= ctx->pos, yythunkpos527= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l527; goto l524; + l527:; ctx->pos= yypos527; ctx->thunkpos= yythunkpos527; + } if (!yy_Nonspacechar(ctx)) goto l524; + l525:; + { int yypos526= ctx->pos, yythunkpos526= ctx->thunkpos; + { int yypos528= ctx->pos, yythunkpos528= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l528; goto l526; + l528:; ctx->pos= yypos528; ctx->thunkpos= yythunkpos528; + } if (!yy_Nonspacechar(ctx)) goto l526; goto l525; + l526:; ctx->pos= yypos526; ctx->thunkpos= yythunkpos526; + } goto l523; + l524:; ctx->pos= yypos523; ctx->thunkpos= yythunkpos523; + { int yypos530= ctx->pos, yythunkpos530= ctx->thunkpos; if (!yy_Ticks2(ctx)) goto l530; goto l529; + l530:; ctx->pos= yypos530; ctx->thunkpos= yythunkpos530; + } if (!yymatchChar(ctx, '`')) goto l529; + l531:; + { int yypos532= ctx->pos, yythunkpos532= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l532; goto l531; + l532:; ctx->pos= yypos532; ctx->thunkpos= yythunkpos532; + } goto l523; + l529:; ctx->pos= yypos523; ctx->thunkpos= yythunkpos523; + { int yypos533= ctx->pos, yythunkpos533= ctx->thunkpos; if (!yy_Sp(ctx)) goto l533; if (!yy_Ticks2(ctx)) goto l533; goto l508; + l533:; ctx->pos= yypos533; ctx->thunkpos= yythunkpos533; + } + { int yypos534= ctx->pos, yythunkpos534= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l535; goto l534; + l535:; ctx->pos= yypos534; ctx->thunkpos= yythunkpos534; if (!yy_Newline(ctx)) goto l508; + { int yypos536= ctx->pos, yythunkpos536= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l536; goto l508; + l536:; ctx->pos= yypos536; ctx->thunkpos= yythunkpos536; + } + } + l534:; + } + l523:; goto l507; + l508:; ctx->pos= yypos508; ctx->thunkpos= yythunkpos508; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l506; if (!yy_Sp(ctx)) goto l506; if (!yy_Ticks2(ctx)) goto l506; goto l474; + l506:; ctx->pos= yypos474; ctx->thunkpos= yythunkpos474; if (!yy_Ticks3(ctx)) goto l537; if (!yy_Sp(ctx)) goto l537; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l537; + { int yypos540= ctx->pos, yythunkpos540= ctx->thunkpos; + { int yypos544= ctx->pos, yythunkpos544= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l544; goto l541; + l544:; ctx->pos= yypos544; ctx->thunkpos= yythunkpos544; + } if (!yy_Nonspacechar(ctx)) goto l541; + l542:; + { int yypos543= ctx->pos, yythunkpos543= ctx->thunkpos; + { int yypos545= ctx->pos, yythunkpos545= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l545; goto l543; + l545:; ctx->pos= yypos545; ctx->thunkpos= yythunkpos545; + } if (!yy_Nonspacechar(ctx)) goto l543; goto l542; + l543:; ctx->pos= yypos543; ctx->thunkpos= yythunkpos543; + } goto l540; + l541:; ctx->pos= yypos540; ctx->thunkpos= yythunkpos540; + { int yypos547= ctx->pos, yythunkpos547= ctx->thunkpos; if (!yy_Ticks3(ctx)) goto l547; goto l546; + l547:; ctx->pos= yypos547; ctx->thunkpos= yythunkpos547; + } if (!yymatchChar(ctx, '`')) goto l546; + l548:; + { int yypos549= ctx->pos, yythunkpos549= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l549; goto l548; + l549:; ctx->pos= yypos549; ctx->thunkpos= yythunkpos549; + } goto l540; + l546:; ctx->pos= yypos540; ctx->thunkpos= yythunkpos540; + { int yypos550= ctx->pos, yythunkpos550= ctx->thunkpos; if (!yy_Sp(ctx)) goto l550; if (!yy_Ticks3(ctx)) goto l550; goto l537; + l550:; ctx->pos= yypos550; ctx->thunkpos= yythunkpos550; + } + { int yypos551= ctx->pos, yythunkpos551= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l552; goto l551; + l552:; ctx->pos= yypos551; ctx->thunkpos= yythunkpos551; if (!yy_Newline(ctx)) goto l537; + { int yypos553= ctx->pos, yythunkpos553= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l553; goto l537; + l553:; ctx->pos= yypos553; ctx->thunkpos= yythunkpos553; + } + } + l551:; + } + l540:; + l538:; + { int yypos539= ctx->pos, yythunkpos539= ctx->thunkpos; + { int yypos554= ctx->pos, yythunkpos554= ctx->thunkpos; + { int yypos558= ctx->pos, yythunkpos558= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l558; goto l555; + l558:; ctx->pos= yypos558; ctx->thunkpos= yythunkpos558; + } if (!yy_Nonspacechar(ctx)) goto l555; + l556:; + { int yypos557= ctx->pos, yythunkpos557= ctx->thunkpos; + { int yypos559= ctx->pos, yythunkpos559= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l559; goto l557; + l559:; ctx->pos= yypos559; ctx->thunkpos= yythunkpos559; + } if (!yy_Nonspacechar(ctx)) goto l557; goto l556; + l557:; ctx->pos= yypos557; ctx->thunkpos= yythunkpos557; + } goto l554; + l555:; ctx->pos= yypos554; ctx->thunkpos= yythunkpos554; + { int yypos561= ctx->pos, yythunkpos561= ctx->thunkpos; if (!yy_Ticks3(ctx)) goto l561; goto l560; + l561:; ctx->pos= yypos561; ctx->thunkpos= yythunkpos561; + } if (!yymatchChar(ctx, '`')) goto l560; + l562:; + { int yypos563= ctx->pos, yythunkpos563= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l563; goto l562; + l563:; ctx->pos= yypos563; ctx->thunkpos= yythunkpos563; + } goto l554; + l560:; ctx->pos= yypos554; ctx->thunkpos= yythunkpos554; + { int yypos564= ctx->pos, yythunkpos564= ctx->thunkpos; if (!yy_Sp(ctx)) goto l564; if (!yy_Ticks3(ctx)) goto l564; goto l539; + l564:; ctx->pos= yypos564; ctx->thunkpos= yythunkpos564; + } + { int yypos565= ctx->pos, yythunkpos565= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l566; goto l565; + l566:; ctx->pos= yypos565; ctx->thunkpos= yythunkpos565; if (!yy_Newline(ctx)) goto l539; + { int yypos567= ctx->pos, yythunkpos567= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l567; goto l539; + l567:; ctx->pos= yypos567; ctx->thunkpos= yythunkpos567; + } + } + l565:; + } + l554:; goto l538; + l539:; ctx->pos= yypos539; ctx->thunkpos= yythunkpos539; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l537; if (!yy_Sp(ctx)) goto l537; if (!yy_Ticks3(ctx)) goto l537; goto l474; + l537:; ctx->pos= yypos474; ctx->thunkpos= yythunkpos474; if (!yy_Ticks4(ctx)) goto l568; if (!yy_Sp(ctx)) goto l568; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l568; + { int yypos571= ctx->pos, yythunkpos571= ctx->thunkpos; + { int yypos575= ctx->pos, yythunkpos575= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l575; goto l572; + l575:; ctx->pos= yypos575; ctx->thunkpos= yythunkpos575; + } if (!yy_Nonspacechar(ctx)) goto l572; + l573:; + { int yypos574= ctx->pos, yythunkpos574= ctx->thunkpos; + { int yypos576= ctx->pos, yythunkpos576= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l576; goto l574; + l576:; ctx->pos= yypos576; ctx->thunkpos= yythunkpos576; + } if (!yy_Nonspacechar(ctx)) goto l574; goto l573; + l574:; ctx->pos= yypos574; ctx->thunkpos= yythunkpos574; + } goto l571; + l572:; ctx->pos= yypos571; ctx->thunkpos= yythunkpos571; + { int yypos578= ctx->pos, yythunkpos578= ctx->thunkpos; if (!yy_Ticks4(ctx)) goto l578; goto l577; + l578:; ctx->pos= yypos578; ctx->thunkpos= yythunkpos578; + } if (!yymatchChar(ctx, '`')) goto l577; + l579:; + { int yypos580= ctx->pos, yythunkpos580= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l580; goto l579; + l580:; ctx->pos= yypos580; ctx->thunkpos= yythunkpos580; + } goto l571; + l577:; ctx->pos= yypos571; ctx->thunkpos= yythunkpos571; + { int yypos581= ctx->pos, yythunkpos581= ctx->thunkpos; if (!yy_Sp(ctx)) goto l581; if (!yy_Ticks4(ctx)) goto l581; goto l568; + l581:; ctx->pos= yypos581; ctx->thunkpos= yythunkpos581; + } + { int yypos582= ctx->pos, yythunkpos582= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l583; goto l582; + l583:; ctx->pos= yypos582; ctx->thunkpos= yythunkpos582; if (!yy_Newline(ctx)) goto l568; + { int yypos584= ctx->pos, yythunkpos584= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l584; goto l568; + l584:; ctx->pos= yypos584; ctx->thunkpos= yythunkpos584; + } + } + l582:; + } + l571:; + l569:; + { int yypos570= ctx->pos, yythunkpos570= ctx->thunkpos; + { int yypos585= ctx->pos, yythunkpos585= ctx->thunkpos; + { int yypos589= ctx->pos, yythunkpos589= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l589; goto l586; + l589:; ctx->pos= yypos589; ctx->thunkpos= yythunkpos589; + } if (!yy_Nonspacechar(ctx)) goto l586; + l587:; + { int yypos588= ctx->pos, yythunkpos588= ctx->thunkpos; + { int yypos590= ctx->pos, yythunkpos590= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l590; goto l588; + l590:; ctx->pos= yypos590; ctx->thunkpos= yythunkpos590; + } if (!yy_Nonspacechar(ctx)) goto l588; goto l587; + l588:; ctx->pos= yypos588; ctx->thunkpos= yythunkpos588; + } goto l585; + l586:; ctx->pos= yypos585; ctx->thunkpos= yythunkpos585; + { int yypos592= ctx->pos, yythunkpos592= ctx->thunkpos; if (!yy_Ticks4(ctx)) goto l592; goto l591; + l592:; ctx->pos= yypos592; ctx->thunkpos= yythunkpos592; + } if (!yymatchChar(ctx, '`')) goto l591; + l593:; + { int yypos594= ctx->pos, yythunkpos594= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l594; goto l593; + l594:; ctx->pos= yypos594; ctx->thunkpos= yythunkpos594; + } goto l585; + l591:; ctx->pos= yypos585; ctx->thunkpos= yythunkpos585; + { int yypos595= ctx->pos, yythunkpos595= ctx->thunkpos; if (!yy_Sp(ctx)) goto l595; if (!yy_Ticks4(ctx)) goto l595; goto l570; + l595:; ctx->pos= yypos595; ctx->thunkpos= yythunkpos595; + } + { int yypos596= ctx->pos, yythunkpos596= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l597; goto l596; + l597:; ctx->pos= yypos596; ctx->thunkpos= yythunkpos596; if (!yy_Newline(ctx)) goto l570; + { int yypos598= ctx->pos, yythunkpos598= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l598; goto l570; + l598:; ctx->pos= yypos598; ctx->thunkpos= yythunkpos598; + } + } + l596:; + } + l585:; goto l569; + l570:; ctx->pos= yypos570; ctx->thunkpos= yythunkpos570; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l568; if (!yy_Sp(ctx)) goto l568; if (!yy_Ticks4(ctx)) goto l568; goto l474; + l568:; ctx->pos= yypos474; ctx->thunkpos= yythunkpos474; if (!yy_Ticks5(ctx)) goto l473; if (!yy_Sp(ctx)) goto l473; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l473; + { int yypos601= ctx->pos, yythunkpos601= ctx->thunkpos; + { int yypos605= ctx->pos, yythunkpos605= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l605; goto l602; + l605:; ctx->pos= yypos605; ctx->thunkpos= yythunkpos605; + } if (!yy_Nonspacechar(ctx)) goto l602; + l603:; + { int yypos604= ctx->pos, yythunkpos604= ctx->thunkpos; + { int yypos606= ctx->pos, yythunkpos606= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l606; goto l604; + l606:; ctx->pos= yypos606; ctx->thunkpos= yythunkpos606; + } if (!yy_Nonspacechar(ctx)) goto l604; goto l603; + l604:; ctx->pos= yypos604; ctx->thunkpos= yythunkpos604; + } goto l601; + l602:; ctx->pos= yypos601; ctx->thunkpos= yythunkpos601; + { int yypos608= ctx->pos, yythunkpos608= ctx->thunkpos; if (!yy_Ticks5(ctx)) goto l608; goto l607; + l608:; ctx->pos= yypos608; ctx->thunkpos= yythunkpos608; + } if (!yymatchChar(ctx, '`')) goto l607; + l609:; + { int yypos610= ctx->pos, yythunkpos610= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l610; goto l609; + l610:; ctx->pos= yypos610; ctx->thunkpos= yythunkpos610; + } goto l601; + l607:; ctx->pos= yypos601; ctx->thunkpos= yythunkpos601; + { int yypos611= ctx->pos, yythunkpos611= ctx->thunkpos; if (!yy_Sp(ctx)) goto l611; if (!yy_Ticks5(ctx)) goto l611; goto l473; + l611:; ctx->pos= yypos611; ctx->thunkpos= yythunkpos611; + } + { int yypos612= ctx->pos, yythunkpos612= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l613; goto l612; + l613:; ctx->pos= yypos612; ctx->thunkpos= yythunkpos612; if (!yy_Newline(ctx)) goto l473; + { int yypos614= ctx->pos, yythunkpos614= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l614; goto l473; + l614:; ctx->pos= yypos614; ctx->thunkpos= yythunkpos614; + } + } + l612:; + } + l601:; + l599:; + { int yypos600= ctx->pos, yythunkpos600= ctx->thunkpos; + { int yypos615= ctx->pos, yythunkpos615= ctx->thunkpos; + { int yypos619= ctx->pos, yythunkpos619= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l619; goto l616; + l619:; ctx->pos= yypos619; ctx->thunkpos= yythunkpos619; + } if (!yy_Nonspacechar(ctx)) goto l616; + l617:; + { int yypos618= ctx->pos, yythunkpos618= ctx->thunkpos; + { int yypos620= ctx->pos, yythunkpos620= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l620; goto l618; + l620:; ctx->pos= yypos620; ctx->thunkpos= yythunkpos620; + } if (!yy_Nonspacechar(ctx)) goto l618; goto l617; + l618:; ctx->pos= yypos618; ctx->thunkpos= yythunkpos618; + } goto l615; + l616:; ctx->pos= yypos615; ctx->thunkpos= yythunkpos615; + { int yypos622= ctx->pos, yythunkpos622= ctx->thunkpos; if (!yy_Ticks5(ctx)) goto l622; goto l621; + l622:; ctx->pos= yypos622; ctx->thunkpos= yythunkpos622; + } if (!yymatchChar(ctx, '`')) goto l621; + l623:; + { int yypos624= ctx->pos, yythunkpos624= ctx->thunkpos; if (!yymatchChar(ctx, '`')) goto l624; goto l623; + l624:; ctx->pos= yypos624; ctx->thunkpos= yythunkpos624; + } goto l615; + l621:; ctx->pos= yypos615; ctx->thunkpos= yythunkpos615; + { int yypos625= ctx->pos, yythunkpos625= ctx->thunkpos; if (!yy_Sp(ctx)) goto l625; if (!yy_Ticks5(ctx)) goto l625; goto l600; + l625:; ctx->pos= yypos625; ctx->thunkpos= yythunkpos625; + } + { int yypos626= ctx->pos, yythunkpos626= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l627; goto l626; + l627:; ctx->pos= yypos626; ctx->thunkpos= yythunkpos626; if (!yy_Newline(ctx)) goto l600; + { int yypos628= ctx->pos, yythunkpos628= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l628; goto l600; + l628:; ctx->pos= yypos628; ctx->thunkpos= yythunkpos628; + } + } + l626:; + } + l615:; goto l599; + l600:; ctx->pos= yypos600; ctx->thunkpos= yythunkpos600; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l473; if (!yy_Sp(ctx)) goto l473; if (!yy_Ticks5(ctx)) goto l473; + } + l474:; yyDo(ctx, yy_1_Code, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Code", ctx->buf+ctx->pos)); + return 1; + l473:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Code", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_InlineNote(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "InlineNote")); yyText(ctx, ctx->begin, ctx->end); if (!( extension(EXT_NOTES) )) goto l629; if (!yymatchString(ctx, "^[")) goto l629; if (!yy_StartList(ctx)) goto l629; yyDo(ctx, yySet, -1, 0); + { int yypos632= ctx->pos, yythunkpos632= ctx->thunkpos; if (!yymatchChar(ctx, ']')) goto l632; goto l629; + l632:; ctx->pos= yypos632; ctx->thunkpos= yythunkpos632; + } if (!yy_Inline(ctx)) goto l629; yyDo(ctx, yy_1_InlineNote, ctx->begin, ctx->end); + l630:; + { int yypos631= ctx->pos, yythunkpos631= ctx->thunkpos; + { int yypos633= ctx->pos, yythunkpos633= ctx->thunkpos; if (!yymatchChar(ctx, ']')) goto l633; goto l631; + l633:; ctx->pos= yypos633; ctx->thunkpos= yythunkpos633; + } if (!yy_Inline(ctx)) goto l631; yyDo(ctx, yy_1_InlineNote, ctx->begin, ctx->end); goto l630; + l631:; ctx->pos= yypos631; ctx->thunkpos= yythunkpos631; + } if (!yymatchChar(ctx, ']')) goto l629; yyDo(ctx, yy_2_InlineNote, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "InlineNote", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l629:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "InlineNote", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_NoteReference(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "NoteReference")); yyText(ctx, ctx->begin, ctx->end); if (!( extension(EXT_NOTES) )) goto l634; if (!yy_RawNoteReference(ctx)) goto l634; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_NoteReference, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "NoteReference", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l634:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "NoteReference", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Link(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Link")); + { int yypos636= ctx->pos, yythunkpos636= ctx->thunkpos; if (!yy_ExplicitLink(ctx)) goto l637; goto l636; + l637:; ctx->pos= yypos636; ctx->thunkpos= yythunkpos636; if (!yy_ReferenceLink(ctx)) goto l638; goto l636; + l638:; ctx->pos= yypos636; ctx->thunkpos= yythunkpos636; if (!yy_AutoLink(ctx)) goto l635; + } + l636:; + yyprintf((stderr, " ok %s @ %s\n", "Link", ctx->buf+ctx->pos)); + return 1; + l635:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Link", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Image(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Image")); if (!yymatchChar(ctx, '!')) goto l639; + { int yypos640= ctx->pos, yythunkpos640= ctx->thunkpos; if (!yy_ExplicitLink(ctx)) goto l641; goto l640; + l641:; ctx->pos= yypos640; ctx->thunkpos= yythunkpos640; if (!yy_ReferenceLink(ctx)) goto l639; + } + l640:; yyDo(ctx, yy_1_Image, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Image", ctx->buf+ctx->pos)); + return 1; + l639:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Image", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Emph(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Emph")); + { int yypos643= ctx->pos, yythunkpos643= ctx->thunkpos; if (!yy_EmphStar(ctx)) goto l644; goto l643; + l644:; ctx->pos= yypos643; ctx->thunkpos= yythunkpos643; if (!yy_EmphUl(ctx)) goto l642; + } + l643:; + yyprintf((stderr, " ok %s @ %s\n", "Emph", ctx->buf+ctx->pos)); + return 1; + l642:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Emph", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Strong(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Strong")); + { int yypos646= ctx->pos, yythunkpos646= ctx->thunkpos; if (!yy_StrongStar(ctx)) goto l647; goto l646; + l647:; ctx->pos= yypos646; ctx->thunkpos= yythunkpos646; if (!yy_StrongUl(ctx)) goto l645; + } + l646:; + yyprintf((stderr, " ok %s @ %s\n", "Strong", ctx->buf+ctx->pos)); + return 1; + l645:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Strong", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Space(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Space")); if (!yy_Spacechar(ctx)) goto l648; + l649:; + { int yypos650= ctx->pos, yythunkpos650= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l650; goto l649; + l650:; ctx->pos= yypos650; ctx->thunkpos= yythunkpos650; + } yyDo(ctx, yy_1_Space, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Space", ctx->buf+ctx->pos)); + return 1; + l648:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Space", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_UlOrStarLine(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "UlOrStarLine")); + { int yypos652= ctx->pos, yythunkpos652= ctx->thunkpos; if (!yy_UlLine(ctx)) goto l653; goto l652; + l653:; ctx->pos= yypos652; ctx->thunkpos= yythunkpos652; if (!yy_StarLine(ctx)) goto l651; + } + l652:; yyDo(ctx, yy_1_UlOrStarLine, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "UlOrStarLine", ctx->buf+ctx->pos)); + return 1; + l651:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "UlOrStarLine", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Str(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "Str")); if (!yy_StartList(ctx)) goto l654; yyDo(ctx, yySet, -1, 0); yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l654; if (!yy_NormalChar(ctx)) goto l654; + l655:; + { int yypos656= ctx->pos, yythunkpos656= ctx->thunkpos; if (!yy_NormalChar(ctx)) goto l656; goto l655; + l656:; ctx->pos= yypos656; ctx->thunkpos= yythunkpos656; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l654; yyDo(ctx, yy_1_Str, ctx->begin, ctx->end); + l657:; + { int yypos658= ctx->pos, yythunkpos658= ctx->thunkpos; if (!yy_StrChunk(ctx)) goto l658; yyDo(ctx, yy_2_Str, ctx->begin, ctx->end); goto l657; + l658:; ctx->pos= yypos658; ctx->thunkpos= yythunkpos658; + } yyDo(ctx, yy_3_Str, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Str", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l654:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Str", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_InStyleTags(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "InStyleTags")); if (!yy_StyleOpen(ctx)) goto l659; + l660:; + { int yypos661= ctx->pos, yythunkpos661= ctx->thunkpos; + { int yypos662= ctx->pos, yythunkpos662= ctx->thunkpos; if (!yy_StyleClose(ctx)) goto l662; goto l661; + l662:; ctx->pos= yypos662; ctx->thunkpos= yythunkpos662; + } if (!yymatchDot(ctx)) goto l661; goto l660; + l661:; ctx->pos= yypos661; ctx->thunkpos= yythunkpos661; + } if (!yy_StyleClose(ctx)) goto l659; + yyprintf((stderr, " ok %s @ %s\n", "InStyleTags", ctx->buf+ctx->pos)); + return 1; + l659:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "InStyleTags", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_StyleClose(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "StyleClose")); if (!yymatchChar(ctx, '<')) goto l663; if (!yy_Spnl(ctx)) goto l663; if (!yymatchChar(ctx, '/')) goto l663; + { int yypos664= ctx->pos, yythunkpos664= ctx->thunkpos; if (!yymatchString(ctx, "style")) goto l665; goto l664; + l665:; ctx->pos= yypos664; ctx->thunkpos= yythunkpos664; if (!yymatchString(ctx, "STYLE")) goto l663; + } + l664:; if (!yy_Spnl(ctx)) goto l663; if (!yymatchChar(ctx, '>')) goto l663; + yyprintf((stderr, " ok %s @ %s\n", "StyleClose", ctx->buf+ctx->pos)); + return 1; + l663:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "StyleClose", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_StyleOpen(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "StyleOpen")); if (!yymatchChar(ctx, '<')) goto l666; if (!yy_Spnl(ctx)) goto l666; + { int yypos667= ctx->pos, yythunkpos667= ctx->thunkpos; if (!yymatchString(ctx, "style")) goto l668; goto l667; + l668:; ctx->pos= yypos667; ctx->thunkpos= yythunkpos667; if (!yymatchString(ctx, "STYLE")) goto l666; + } + l667:; if (!yy_Spnl(ctx)) goto l666; + l669:; + { int yypos670= ctx->pos, yythunkpos670= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l670; goto l669; + l670:; ctx->pos= yypos670; ctx->thunkpos= yythunkpos670; + } if (!yymatchChar(ctx, '>')) goto l666; + yyprintf((stderr, " ok %s @ %s\n", "StyleOpen", ctx->buf+ctx->pos)); + return 1; + l666:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "StyleOpen", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockType(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockType")); + { int yypos672= ctx->pos, yythunkpos672= ctx->thunkpos; if (!yymatchString(ctx, "address")) goto l673; goto l672; + l673:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "blockquote")) goto l674; goto l672; + l674:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "center")) goto l675; goto l672; + l675:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "dir")) goto l676; goto l672; + l676:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "div")) goto l677; goto l672; + l677:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "dl")) goto l678; goto l672; + l678:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "fieldset")) goto l679; goto l672; + l679:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "form")) goto l680; goto l672; + l680:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "h1")) goto l681; goto l672; + l681:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "h2")) goto l682; goto l672; + l682:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "h3")) goto l683; goto l672; + l683:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "h4")) goto l684; goto l672; + l684:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "h5")) goto l685; goto l672; + l685:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "h6")) goto l686; goto l672; + l686:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "hr")) goto l687; goto l672; + l687:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "isindex")) goto l688; goto l672; + l688:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "menu")) goto l689; goto l672; + l689:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "noframes")) goto l690; goto l672; + l690:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "noscript")) goto l691; goto l672; + l691:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "ol")) goto l692; goto l672; + l692:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchChar(ctx, 'p')) goto l693; goto l672; + l693:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "pre")) goto l694; goto l672; + l694:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "table")) goto l695; goto l672; + l695:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "ul")) goto l696; goto l672; + l696:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "dd")) goto l697; goto l672; + l697:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "dt")) goto l698; goto l672; + l698:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "frameset")) goto l699; goto l672; + l699:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "li")) goto l700; goto l672; + l700:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "tbody")) goto l701; goto l672; + l701:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "td")) goto l702; goto l672; + l702:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "tfoot")) goto l703; goto l672; + l703:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "th")) goto l704; goto l672; + l704:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "thead")) goto l705; goto l672; + l705:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "tr")) goto l706; goto l672; + l706:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "script")) goto l707; goto l672; + l707:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "ADDRESS")) goto l708; goto l672; + l708:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "BLOCKQUOTE")) goto l709; goto l672; + l709:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "CENTER")) goto l710; goto l672; + l710:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "DIR")) goto l711; goto l672; + l711:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "DIV")) goto l712; goto l672; + l712:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "DL")) goto l713; goto l672; + l713:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "FIELDSET")) goto l714; goto l672; + l714:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "FORM")) goto l715; goto l672; + l715:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "H1")) goto l716; goto l672; + l716:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "H2")) goto l717; goto l672; + l717:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "H3")) goto l718; goto l672; + l718:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "H4")) goto l719; goto l672; + l719:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "H5")) goto l720; goto l672; + l720:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "H6")) goto l721; goto l672; + l721:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "HR")) goto l722; goto l672; + l722:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "ISINDEX")) goto l723; goto l672; + l723:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "MENU")) goto l724; goto l672; + l724:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "NOFRAMES")) goto l725; goto l672; + l725:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "NOSCRIPT")) goto l726; goto l672; + l726:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "OL")) goto l727; goto l672; + l727:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchChar(ctx, 'P')) goto l728; goto l672; + l728:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "PRE")) goto l729; goto l672; + l729:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "TABLE")) goto l730; goto l672; + l730:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "UL")) goto l731; goto l672; + l731:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "DD")) goto l732; goto l672; + l732:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "DT")) goto l733; goto l672; + l733:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "FRAMESET")) goto l734; goto l672; + l734:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "LI")) goto l735; goto l672; + l735:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "TBODY")) goto l736; goto l672; + l736:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "TD")) goto l737; goto l672; + l737:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "TFOOT")) goto l738; goto l672; + l738:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "TH")) goto l739; goto l672; + l739:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "THEAD")) goto l740; goto l672; + l740:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "TR")) goto l741; goto l672; + l741:; ctx->pos= yypos672; ctx->thunkpos= yythunkpos672; if (!yymatchString(ctx, "SCRIPT")) goto l671; + } + l672:; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockType", ctx->buf+ctx->pos)); + return 1; + l671:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockType", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockSelfClosing(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockSelfClosing")); if (!yymatchChar(ctx, '<')) goto l742; if (!yy_Spnl(ctx)) goto l742; if (!yy_HtmlBlockType(ctx)) goto l742; if (!yy_Spnl(ctx)) goto l742; + l743:; + { int yypos744= ctx->pos, yythunkpos744= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l744; goto l743; + l744:; ctx->pos= yypos744; ctx->thunkpos= yythunkpos744; + } if (!yymatchChar(ctx, '/')) goto l742; if (!yy_Spnl(ctx)) goto l742; if (!yymatchChar(ctx, '>')) goto l742; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockSelfClosing", ctx->buf+ctx->pos)); + return 1; + l742:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockSelfClosing", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlComment(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlComment")); if (!yymatchString(ctx, "")) goto l748; goto l747; + l748:; ctx->pos= yypos748; ctx->thunkpos= yythunkpos748; + } if (!yymatchDot(ctx)) goto l747; goto l746; + l747:; ctx->pos= yypos747; ctx->thunkpos= yythunkpos747; + } if (!yymatchString(ctx, "-->")) goto l745; + yyprintf((stderr, " ok %s @ %s\n", "HtmlComment", ctx->buf+ctx->pos)); + return 1; + l745:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlComment", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockInTags(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockInTags")); + { int yypos750= ctx->pos, yythunkpos750= ctx->thunkpos; if (!yy_HtmlBlockAddress(ctx)) goto l751; goto l750; + l751:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockBlockquote(ctx)) goto l752; goto l750; + l752:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockCenter(ctx)) goto l753; goto l750; + l753:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockDir(ctx)) goto l754; goto l750; + l754:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockDiv(ctx)) goto l755; goto l750; + l755:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockDl(ctx)) goto l756; goto l750; + l756:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockFieldset(ctx)) goto l757; goto l750; + l757:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockForm(ctx)) goto l758; goto l750; + l758:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockH1(ctx)) goto l759; goto l750; + l759:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockH2(ctx)) goto l760; goto l750; + l760:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockH3(ctx)) goto l761; goto l750; + l761:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockH4(ctx)) goto l762; goto l750; + l762:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockH5(ctx)) goto l763; goto l750; + l763:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockH6(ctx)) goto l764; goto l750; + l764:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockMenu(ctx)) goto l765; goto l750; + l765:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockNoframes(ctx)) goto l766; goto l750; + l766:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockNoscript(ctx)) goto l767; goto l750; + l767:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockOl(ctx)) goto l768; goto l750; + l768:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockP(ctx)) goto l769; goto l750; + l769:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockPre(ctx)) goto l770; goto l750; + l770:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockTable(ctx)) goto l771; goto l750; + l771:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockUl(ctx)) goto l772; goto l750; + l772:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockDd(ctx)) goto l773; goto l750; + l773:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockDt(ctx)) goto l774; goto l750; + l774:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockFrameset(ctx)) goto l775; goto l750; + l775:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockLi(ctx)) goto l776; goto l750; + l776:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockTbody(ctx)) goto l777; goto l750; + l777:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockTd(ctx)) goto l778; goto l750; + l778:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockTfoot(ctx)) goto l779; goto l750; + l779:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockTh(ctx)) goto l780; goto l750; + l780:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockThead(ctx)) goto l781; goto l750; + l781:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockTr(ctx)) goto l782; goto l750; + l782:; ctx->pos= yypos750; ctx->thunkpos= yythunkpos750; if (!yy_HtmlBlockScript(ctx)) goto l749; + } + l750:; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockInTags", ctx->buf+ctx->pos)); + return 1; + l749:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockInTags", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockScript(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockScript")); if (!yy_HtmlBlockOpenScript(ctx)) goto l783; + l784:; + { int yypos785= ctx->pos, yythunkpos785= ctx->thunkpos; + { int yypos786= ctx->pos, yythunkpos786= ctx->thunkpos; if (!yy_HtmlBlockCloseScript(ctx)) goto l786; goto l785; + l786:; ctx->pos= yypos786; ctx->thunkpos= yythunkpos786; + } if (!yymatchDot(ctx)) goto l785; goto l784; + l785:; ctx->pos= yypos785; ctx->thunkpos= yythunkpos785; + } if (!yy_HtmlBlockCloseScript(ctx)) goto l783; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockScript", ctx->buf+ctx->pos)); + return 1; + l783:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockScript", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseScript(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseScript")); if (!yymatchChar(ctx, '<')) goto l787; if (!yy_Spnl(ctx)) goto l787; if (!yymatchChar(ctx, '/')) goto l787; + { int yypos788= ctx->pos, yythunkpos788= ctx->thunkpos; if (!yymatchString(ctx, "script")) goto l789; goto l788; + l789:; ctx->pos= yypos788; ctx->thunkpos= yythunkpos788; if (!yymatchString(ctx, "SCRIPT")) goto l787; + } + l788:; if (!yy_Spnl(ctx)) goto l787; if (!yymatchChar(ctx, '>')) goto l787; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseScript", ctx->buf+ctx->pos)); + return 1; + l787:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseScript", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenScript(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenScript")); if (!yymatchChar(ctx, '<')) goto l790; if (!yy_Spnl(ctx)) goto l790; + { int yypos791= ctx->pos, yythunkpos791= ctx->thunkpos; if (!yymatchString(ctx, "script")) goto l792; goto l791; + l792:; ctx->pos= yypos791; ctx->thunkpos= yythunkpos791; if (!yymatchString(ctx, "SCRIPT")) goto l790; + } + l791:; if (!yy_Spnl(ctx)) goto l790; + l793:; + { int yypos794= ctx->pos, yythunkpos794= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l794; goto l793; + l794:; ctx->pos= yypos794; ctx->thunkpos= yythunkpos794; + } if (!yymatchChar(ctx, '>')) goto l790; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenScript", ctx->buf+ctx->pos)); + return 1; + l790:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenScript", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockTr(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockTr")); if (!yy_HtmlBlockOpenTr(ctx)) goto l795; + l796:; + { int yypos797= ctx->pos, yythunkpos797= ctx->thunkpos; + { int yypos798= ctx->pos, yythunkpos798= ctx->thunkpos; if (!yy_HtmlBlockTr(ctx)) goto l799; goto l798; + l799:; ctx->pos= yypos798; ctx->thunkpos= yythunkpos798; + { int yypos800= ctx->pos, yythunkpos800= ctx->thunkpos; if (!yy_HtmlBlockCloseTr(ctx)) goto l800; goto l797; + l800:; ctx->pos= yypos800; ctx->thunkpos= yythunkpos800; + } if (!yymatchDot(ctx)) goto l797; + } + l798:; goto l796; + l797:; ctx->pos= yypos797; ctx->thunkpos= yythunkpos797; + } if (!yy_HtmlBlockCloseTr(ctx)) goto l795; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockTr", ctx->buf+ctx->pos)); + return 1; + l795:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockTr", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseTr(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseTr")); if (!yymatchChar(ctx, '<')) goto l801; if (!yy_Spnl(ctx)) goto l801; if (!yymatchChar(ctx, '/')) goto l801; + { int yypos802= ctx->pos, yythunkpos802= ctx->thunkpos; if (!yymatchString(ctx, "tr")) goto l803; goto l802; + l803:; ctx->pos= yypos802; ctx->thunkpos= yythunkpos802; if (!yymatchString(ctx, "TR")) goto l801; + } + l802:; if (!yy_Spnl(ctx)) goto l801; if (!yymatchChar(ctx, '>')) goto l801; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseTr", ctx->buf+ctx->pos)); + return 1; + l801:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseTr", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenTr(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenTr")); if (!yymatchChar(ctx, '<')) goto l804; if (!yy_Spnl(ctx)) goto l804; + { int yypos805= ctx->pos, yythunkpos805= ctx->thunkpos; if (!yymatchString(ctx, "tr")) goto l806; goto l805; + l806:; ctx->pos= yypos805; ctx->thunkpos= yythunkpos805; if (!yymatchString(ctx, "TR")) goto l804; + } + l805:; if (!yy_Spnl(ctx)) goto l804; + l807:; + { int yypos808= ctx->pos, yythunkpos808= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l808; goto l807; + l808:; ctx->pos= yypos808; ctx->thunkpos= yythunkpos808; + } if (!yymatchChar(ctx, '>')) goto l804; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenTr", ctx->buf+ctx->pos)); + return 1; + l804:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenTr", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockThead(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockThead")); if (!yy_HtmlBlockOpenThead(ctx)) goto l809; + l810:; + { int yypos811= ctx->pos, yythunkpos811= ctx->thunkpos; + { int yypos812= ctx->pos, yythunkpos812= ctx->thunkpos; if (!yy_HtmlBlockThead(ctx)) goto l813; goto l812; + l813:; ctx->pos= yypos812; ctx->thunkpos= yythunkpos812; + { int yypos814= ctx->pos, yythunkpos814= ctx->thunkpos; if (!yy_HtmlBlockCloseThead(ctx)) goto l814; goto l811; + l814:; ctx->pos= yypos814; ctx->thunkpos= yythunkpos814; + } if (!yymatchDot(ctx)) goto l811; + } + l812:; goto l810; + l811:; ctx->pos= yypos811; ctx->thunkpos= yythunkpos811; + } if (!yy_HtmlBlockCloseThead(ctx)) goto l809; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockThead", ctx->buf+ctx->pos)); + return 1; + l809:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockThead", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseThead(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseThead")); if (!yymatchChar(ctx, '<')) goto l815; if (!yy_Spnl(ctx)) goto l815; if (!yymatchChar(ctx, '/')) goto l815; + { int yypos816= ctx->pos, yythunkpos816= ctx->thunkpos; if (!yymatchString(ctx, "thead")) goto l817; goto l816; + l817:; ctx->pos= yypos816; ctx->thunkpos= yythunkpos816; if (!yymatchString(ctx, "THEAD")) goto l815; + } + l816:; if (!yy_Spnl(ctx)) goto l815; if (!yymatchChar(ctx, '>')) goto l815; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseThead", ctx->buf+ctx->pos)); + return 1; + l815:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseThead", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenThead(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenThead")); if (!yymatchChar(ctx, '<')) goto l818; if (!yy_Spnl(ctx)) goto l818; + { int yypos819= ctx->pos, yythunkpos819= ctx->thunkpos; if (!yymatchString(ctx, "thead")) goto l820; goto l819; + l820:; ctx->pos= yypos819; ctx->thunkpos= yythunkpos819; if (!yymatchString(ctx, "THEAD")) goto l818; + } + l819:; if (!yy_Spnl(ctx)) goto l818; + l821:; + { int yypos822= ctx->pos, yythunkpos822= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l822; goto l821; + l822:; ctx->pos= yypos822; ctx->thunkpos= yythunkpos822; + } if (!yymatchChar(ctx, '>')) goto l818; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenThead", ctx->buf+ctx->pos)); + return 1; + l818:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenThead", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockTh(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockTh")); if (!yy_HtmlBlockOpenTh(ctx)) goto l823; + l824:; + { int yypos825= ctx->pos, yythunkpos825= ctx->thunkpos; + { int yypos826= ctx->pos, yythunkpos826= ctx->thunkpos; if (!yy_HtmlBlockTh(ctx)) goto l827; goto l826; + l827:; ctx->pos= yypos826; ctx->thunkpos= yythunkpos826; + { int yypos828= ctx->pos, yythunkpos828= ctx->thunkpos; if (!yy_HtmlBlockCloseTh(ctx)) goto l828; goto l825; + l828:; ctx->pos= yypos828; ctx->thunkpos= yythunkpos828; + } if (!yymatchDot(ctx)) goto l825; + } + l826:; goto l824; + l825:; ctx->pos= yypos825; ctx->thunkpos= yythunkpos825; + } if (!yy_HtmlBlockCloseTh(ctx)) goto l823; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockTh", ctx->buf+ctx->pos)); + return 1; + l823:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockTh", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseTh(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseTh")); if (!yymatchChar(ctx, '<')) goto l829; if (!yy_Spnl(ctx)) goto l829; if (!yymatchChar(ctx, '/')) goto l829; + { int yypos830= ctx->pos, yythunkpos830= ctx->thunkpos; if (!yymatchString(ctx, "th")) goto l831; goto l830; + l831:; ctx->pos= yypos830; ctx->thunkpos= yythunkpos830; if (!yymatchString(ctx, "TH")) goto l829; + } + l830:; if (!yy_Spnl(ctx)) goto l829; if (!yymatchChar(ctx, '>')) goto l829; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseTh", ctx->buf+ctx->pos)); + return 1; + l829:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseTh", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenTh(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenTh")); if (!yymatchChar(ctx, '<')) goto l832; if (!yy_Spnl(ctx)) goto l832; + { int yypos833= ctx->pos, yythunkpos833= ctx->thunkpos; if (!yymatchString(ctx, "th")) goto l834; goto l833; + l834:; ctx->pos= yypos833; ctx->thunkpos= yythunkpos833; if (!yymatchString(ctx, "TH")) goto l832; + } + l833:; if (!yy_Spnl(ctx)) goto l832; + l835:; + { int yypos836= ctx->pos, yythunkpos836= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l836; goto l835; + l836:; ctx->pos= yypos836; ctx->thunkpos= yythunkpos836; + } if (!yymatchChar(ctx, '>')) goto l832; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenTh", ctx->buf+ctx->pos)); + return 1; + l832:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenTh", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockTfoot(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockTfoot")); if (!yy_HtmlBlockOpenTfoot(ctx)) goto l837; + l838:; + { int yypos839= ctx->pos, yythunkpos839= ctx->thunkpos; + { int yypos840= ctx->pos, yythunkpos840= ctx->thunkpos; if (!yy_HtmlBlockTfoot(ctx)) goto l841; goto l840; + l841:; ctx->pos= yypos840; ctx->thunkpos= yythunkpos840; + { int yypos842= ctx->pos, yythunkpos842= ctx->thunkpos; if (!yy_HtmlBlockCloseTfoot(ctx)) goto l842; goto l839; + l842:; ctx->pos= yypos842; ctx->thunkpos= yythunkpos842; + } if (!yymatchDot(ctx)) goto l839; + } + l840:; goto l838; + l839:; ctx->pos= yypos839; ctx->thunkpos= yythunkpos839; + } if (!yy_HtmlBlockCloseTfoot(ctx)) goto l837; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockTfoot", ctx->buf+ctx->pos)); + return 1; + l837:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockTfoot", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseTfoot(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseTfoot")); if (!yymatchChar(ctx, '<')) goto l843; if (!yy_Spnl(ctx)) goto l843; if (!yymatchChar(ctx, '/')) goto l843; + { int yypos844= ctx->pos, yythunkpos844= ctx->thunkpos; if (!yymatchString(ctx, "tfoot")) goto l845; goto l844; + l845:; ctx->pos= yypos844; ctx->thunkpos= yythunkpos844; if (!yymatchString(ctx, "TFOOT")) goto l843; + } + l844:; if (!yy_Spnl(ctx)) goto l843; if (!yymatchChar(ctx, '>')) goto l843; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseTfoot", ctx->buf+ctx->pos)); + return 1; + l843:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseTfoot", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenTfoot(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenTfoot")); if (!yymatchChar(ctx, '<')) goto l846; if (!yy_Spnl(ctx)) goto l846; + { int yypos847= ctx->pos, yythunkpos847= ctx->thunkpos; if (!yymatchString(ctx, "tfoot")) goto l848; goto l847; + l848:; ctx->pos= yypos847; ctx->thunkpos= yythunkpos847; if (!yymatchString(ctx, "TFOOT")) goto l846; + } + l847:; if (!yy_Spnl(ctx)) goto l846; + l849:; + { int yypos850= ctx->pos, yythunkpos850= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l850; goto l849; + l850:; ctx->pos= yypos850; ctx->thunkpos= yythunkpos850; + } if (!yymatchChar(ctx, '>')) goto l846; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenTfoot", ctx->buf+ctx->pos)); + return 1; + l846:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenTfoot", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockTd(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockTd")); if (!yy_HtmlBlockOpenTd(ctx)) goto l851; + l852:; + { int yypos853= ctx->pos, yythunkpos853= ctx->thunkpos; + { int yypos854= ctx->pos, yythunkpos854= ctx->thunkpos; if (!yy_HtmlBlockTd(ctx)) goto l855; goto l854; + l855:; ctx->pos= yypos854; ctx->thunkpos= yythunkpos854; + { int yypos856= ctx->pos, yythunkpos856= ctx->thunkpos; if (!yy_HtmlBlockCloseTd(ctx)) goto l856; goto l853; + l856:; ctx->pos= yypos856; ctx->thunkpos= yythunkpos856; + } if (!yymatchDot(ctx)) goto l853; + } + l854:; goto l852; + l853:; ctx->pos= yypos853; ctx->thunkpos= yythunkpos853; + } if (!yy_HtmlBlockCloseTd(ctx)) goto l851; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockTd", ctx->buf+ctx->pos)); + return 1; + l851:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockTd", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseTd(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseTd")); if (!yymatchChar(ctx, '<')) goto l857; if (!yy_Spnl(ctx)) goto l857; if (!yymatchChar(ctx, '/')) goto l857; + { int yypos858= ctx->pos, yythunkpos858= ctx->thunkpos; if (!yymatchString(ctx, "td")) goto l859; goto l858; + l859:; ctx->pos= yypos858; ctx->thunkpos= yythunkpos858; if (!yymatchString(ctx, "TD")) goto l857; + } + l858:; if (!yy_Spnl(ctx)) goto l857; if (!yymatchChar(ctx, '>')) goto l857; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseTd", ctx->buf+ctx->pos)); + return 1; + l857:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseTd", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenTd(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenTd")); if (!yymatchChar(ctx, '<')) goto l860; if (!yy_Spnl(ctx)) goto l860; + { int yypos861= ctx->pos, yythunkpos861= ctx->thunkpos; if (!yymatchString(ctx, "td")) goto l862; goto l861; + l862:; ctx->pos= yypos861; ctx->thunkpos= yythunkpos861; if (!yymatchString(ctx, "TD")) goto l860; + } + l861:; if (!yy_Spnl(ctx)) goto l860; + l863:; + { int yypos864= ctx->pos, yythunkpos864= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l864; goto l863; + l864:; ctx->pos= yypos864; ctx->thunkpos= yythunkpos864; + } if (!yymatchChar(ctx, '>')) goto l860; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenTd", ctx->buf+ctx->pos)); + return 1; + l860:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenTd", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockTbody(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockTbody")); if (!yy_HtmlBlockOpenTbody(ctx)) goto l865; + l866:; + { int yypos867= ctx->pos, yythunkpos867= ctx->thunkpos; + { int yypos868= ctx->pos, yythunkpos868= ctx->thunkpos; if (!yy_HtmlBlockTbody(ctx)) goto l869; goto l868; + l869:; ctx->pos= yypos868; ctx->thunkpos= yythunkpos868; + { int yypos870= ctx->pos, yythunkpos870= ctx->thunkpos; if (!yy_HtmlBlockCloseTbody(ctx)) goto l870; goto l867; + l870:; ctx->pos= yypos870; ctx->thunkpos= yythunkpos870; + } if (!yymatchDot(ctx)) goto l867; + } + l868:; goto l866; + l867:; ctx->pos= yypos867; ctx->thunkpos= yythunkpos867; + } if (!yy_HtmlBlockCloseTbody(ctx)) goto l865; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockTbody", ctx->buf+ctx->pos)); + return 1; + l865:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockTbody", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseTbody(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseTbody")); if (!yymatchChar(ctx, '<')) goto l871; if (!yy_Spnl(ctx)) goto l871; if (!yymatchChar(ctx, '/')) goto l871; + { int yypos872= ctx->pos, yythunkpos872= ctx->thunkpos; if (!yymatchString(ctx, "tbody")) goto l873; goto l872; + l873:; ctx->pos= yypos872; ctx->thunkpos= yythunkpos872; if (!yymatchString(ctx, "TBODY")) goto l871; + } + l872:; if (!yy_Spnl(ctx)) goto l871; if (!yymatchChar(ctx, '>')) goto l871; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseTbody", ctx->buf+ctx->pos)); + return 1; + l871:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseTbody", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenTbody(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenTbody")); if (!yymatchChar(ctx, '<')) goto l874; if (!yy_Spnl(ctx)) goto l874; + { int yypos875= ctx->pos, yythunkpos875= ctx->thunkpos; if (!yymatchString(ctx, "tbody")) goto l876; goto l875; + l876:; ctx->pos= yypos875; ctx->thunkpos= yythunkpos875; if (!yymatchString(ctx, "TBODY")) goto l874; + } + l875:; if (!yy_Spnl(ctx)) goto l874; + l877:; + { int yypos878= ctx->pos, yythunkpos878= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l878; goto l877; + l878:; ctx->pos= yypos878; ctx->thunkpos= yythunkpos878; + } if (!yymatchChar(ctx, '>')) goto l874; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenTbody", ctx->buf+ctx->pos)); + return 1; + l874:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenTbody", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockLi(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockLi")); if (!yy_HtmlBlockOpenLi(ctx)) goto l879; + l880:; + { int yypos881= ctx->pos, yythunkpos881= ctx->thunkpos; + { int yypos882= ctx->pos, yythunkpos882= ctx->thunkpos; if (!yy_HtmlBlockLi(ctx)) goto l883; goto l882; + l883:; ctx->pos= yypos882; ctx->thunkpos= yythunkpos882; + { int yypos884= ctx->pos, yythunkpos884= ctx->thunkpos; if (!yy_HtmlBlockCloseLi(ctx)) goto l884; goto l881; + l884:; ctx->pos= yypos884; ctx->thunkpos= yythunkpos884; + } if (!yymatchDot(ctx)) goto l881; + } + l882:; goto l880; + l881:; ctx->pos= yypos881; ctx->thunkpos= yythunkpos881; + } if (!yy_HtmlBlockCloseLi(ctx)) goto l879; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockLi", ctx->buf+ctx->pos)); + return 1; + l879:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockLi", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseLi(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseLi")); if (!yymatchChar(ctx, '<')) goto l885; if (!yy_Spnl(ctx)) goto l885; if (!yymatchChar(ctx, '/')) goto l885; + { int yypos886= ctx->pos, yythunkpos886= ctx->thunkpos; if (!yymatchString(ctx, "li")) goto l887; goto l886; + l887:; ctx->pos= yypos886; ctx->thunkpos= yythunkpos886; if (!yymatchString(ctx, "LI")) goto l885; + } + l886:; if (!yy_Spnl(ctx)) goto l885; if (!yymatchChar(ctx, '>')) goto l885; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseLi", ctx->buf+ctx->pos)); + return 1; + l885:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseLi", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenLi(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenLi")); if (!yymatchChar(ctx, '<')) goto l888; if (!yy_Spnl(ctx)) goto l888; + { int yypos889= ctx->pos, yythunkpos889= ctx->thunkpos; if (!yymatchString(ctx, "li")) goto l890; goto l889; + l890:; ctx->pos= yypos889; ctx->thunkpos= yythunkpos889; if (!yymatchString(ctx, "LI")) goto l888; + } + l889:; if (!yy_Spnl(ctx)) goto l888; + l891:; + { int yypos892= ctx->pos, yythunkpos892= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l892; goto l891; + l892:; ctx->pos= yypos892; ctx->thunkpos= yythunkpos892; + } if (!yymatchChar(ctx, '>')) goto l888; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenLi", ctx->buf+ctx->pos)); + return 1; + l888:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenLi", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockFrameset(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockFrameset")); if (!yy_HtmlBlockOpenFrameset(ctx)) goto l893; + l894:; + { int yypos895= ctx->pos, yythunkpos895= ctx->thunkpos; + { int yypos896= ctx->pos, yythunkpos896= ctx->thunkpos; if (!yy_HtmlBlockFrameset(ctx)) goto l897; goto l896; + l897:; ctx->pos= yypos896; ctx->thunkpos= yythunkpos896; + { int yypos898= ctx->pos, yythunkpos898= ctx->thunkpos; if (!yy_HtmlBlockCloseFrameset(ctx)) goto l898; goto l895; + l898:; ctx->pos= yypos898; ctx->thunkpos= yythunkpos898; + } if (!yymatchDot(ctx)) goto l895; + } + l896:; goto l894; + l895:; ctx->pos= yypos895; ctx->thunkpos= yythunkpos895; + } if (!yy_HtmlBlockCloseFrameset(ctx)) goto l893; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockFrameset", ctx->buf+ctx->pos)); + return 1; + l893:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockFrameset", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseFrameset(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseFrameset")); if (!yymatchChar(ctx, '<')) goto l899; if (!yy_Spnl(ctx)) goto l899; if (!yymatchChar(ctx, '/')) goto l899; + { int yypos900= ctx->pos, yythunkpos900= ctx->thunkpos; if (!yymatchString(ctx, "frameset")) goto l901; goto l900; + l901:; ctx->pos= yypos900; ctx->thunkpos= yythunkpos900; if (!yymatchString(ctx, "FRAMESET")) goto l899; + } + l900:; if (!yy_Spnl(ctx)) goto l899; if (!yymatchChar(ctx, '>')) goto l899; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseFrameset", ctx->buf+ctx->pos)); + return 1; + l899:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseFrameset", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenFrameset(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenFrameset")); if (!yymatchChar(ctx, '<')) goto l902; if (!yy_Spnl(ctx)) goto l902; + { int yypos903= ctx->pos, yythunkpos903= ctx->thunkpos; if (!yymatchString(ctx, "frameset")) goto l904; goto l903; + l904:; ctx->pos= yypos903; ctx->thunkpos= yythunkpos903; if (!yymatchString(ctx, "FRAMESET")) goto l902; + } + l903:; if (!yy_Spnl(ctx)) goto l902; + l905:; + { int yypos906= ctx->pos, yythunkpos906= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l906; goto l905; + l906:; ctx->pos= yypos906; ctx->thunkpos= yythunkpos906; + } if (!yymatchChar(ctx, '>')) goto l902; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenFrameset", ctx->buf+ctx->pos)); + return 1; + l902:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenFrameset", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockDt(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockDt")); if (!yy_HtmlBlockOpenDt(ctx)) goto l907; + l908:; + { int yypos909= ctx->pos, yythunkpos909= ctx->thunkpos; + { int yypos910= ctx->pos, yythunkpos910= ctx->thunkpos; if (!yy_HtmlBlockDt(ctx)) goto l911; goto l910; + l911:; ctx->pos= yypos910; ctx->thunkpos= yythunkpos910; + { int yypos912= ctx->pos, yythunkpos912= ctx->thunkpos; if (!yy_HtmlBlockCloseDt(ctx)) goto l912; goto l909; + l912:; ctx->pos= yypos912; ctx->thunkpos= yythunkpos912; + } if (!yymatchDot(ctx)) goto l909; + } + l910:; goto l908; + l909:; ctx->pos= yypos909; ctx->thunkpos= yythunkpos909; + } if (!yy_HtmlBlockCloseDt(ctx)) goto l907; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockDt", ctx->buf+ctx->pos)); + return 1; + l907:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockDt", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseDt(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseDt")); if (!yymatchChar(ctx, '<')) goto l913; if (!yy_Spnl(ctx)) goto l913; if (!yymatchChar(ctx, '/')) goto l913; + { int yypos914= ctx->pos, yythunkpos914= ctx->thunkpos; if (!yymatchString(ctx, "dt")) goto l915; goto l914; + l915:; ctx->pos= yypos914; ctx->thunkpos= yythunkpos914; if (!yymatchString(ctx, "DT")) goto l913; + } + l914:; if (!yy_Spnl(ctx)) goto l913; if (!yymatchChar(ctx, '>')) goto l913; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseDt", ctx->buf+ctx->pos)); + return 1; + l913:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseDt", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenDt(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenDt")); if (!yymatchChar(ctx, '<')) goto l916; if (!yy_Spnl(ctx)) goto l916; + { int yypos917= ctx->pos, yythunkpos917= ctx->thunkpos; if (!yymatchString(ctx, "dt")) goto l918; goto l917; + l918:; ctx->pos= yypos917; ctx->thunkpos= yythunkpos917; if (!yymatchString(ctx, "DT")) goto l916; + } + l917:; if (!yy_Spnl(ctx)) goto l916; + l919:; + { int yypos920= ctx->pos, yythunkpos920= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l920; goto l919; + l920:; ctx->pos= yypos920; ctx->thunkpos= yythunkpos920; + } if (!yymatchChar(ctx, '>')) goto l916; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenDt", ctx->buf+ctx->pos)); + return 1; + l916:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenDt", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockDd(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockDd")); if (!yy_HtmlBlockOpenDd(ctx)) goto l921; + l922:; + { int yypos923= ctx->pos, yythunkpos923= ctx->thunkpos; + { int yypos924= ctx->pos, yythunkpos924= ctx->thunkpos; if (!yy_HtmlBlockDd(ctx)) goto l925; goto l924; + l925:; ctx->pos= yypos924; ctx->thunkpos= yythunkpos924; + { int yypos926= ctx->pos, yythunkpos926= ctx->thunkpos; if (!yy_HtmlBlockCloseDd(ctx)) goto l926; goto l923; + l926:; ctx->pos= yypos926; ctx->thunkpos= yythunkpos926; + } if (!yymatchDot(ctx)) goto l923; + } + l924:; goto l922; + l923:; ctx->pos= yypos923; ctx->thunkpos= yythunkpos923; + } if (!yy_HtmlBlockCloseDd(ctx)) goto l921; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockDd", ctx->buf+ctx->pos)); + return 1; + l921:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockDd", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseDd(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseDd")); if (!yymatchChar(ctx, '<')) goto l927; if (!yy_Spnl(ctx)) goto l927; if (!yymatchChar(ctx, '/')) goto l927; + { int yypos928= ctx->pos, yythunkpos928= ctx->thunkpos; if (!yymatchString(ctx, "dd")) goto l929; goto l928; + l929:; ctx->pos= yypos928; ctx->thunkpos= yythunkpos928; if (!yymatchString(ctx, "DD")) goto l927; + } + l928:; if (!yy_Spnl(ctx)) goto l927; if (!yymatchChar(ctx, '>')) goto l927; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseDd", ctx->buf+ctx->pos)); + return 1; + l927:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseDd", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenDd(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenDd")); if (!yymatchChar(ctx, '<')) goto l930; if (!yy_Spnl(ctx)) goto l930; + { int yypos931= ctx->pos, yythunkpos931= ctx->thunkpos; if (!yymatchString(ctx, "dd")) goto l932; goto l931; + l932:; ctx->pos= yypos931; ctx->thunkpos= yythunkpos931; if (!yymatchString(ctx, "DD")) goto l930; + } + l931:; if (!yy_Spnl(ctx)) goto l930; + l933:; + { int yypos934= ctx->pos, yythunkpos934= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l934; goto l933; + l934:; ctx->pos= yypos934; ctx->thunkpos= yythunkpos934; + } if (!yymatchChar(ctx, '>')) goto l930; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenDd", ctx->buf+ctx->pos)); + return 1; + l930:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenDd", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockUl(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockUl")); if (!yy_HtmlBlockOpenUl(ctx)) goto l935; + l936:; + { int yypos937= ctx->pos, yythunkpos937= ctx->thunkpos; + { int yypos938= ctx->pos, yythunkpos938= ctx->thunkpos; if (!yy_HtmlBlockUl(ctx)) goto l939; goto l938; + l939:; ctx->pos= yypos938; ctx->thunkpos= yythunkpos938; + { int yypos940= ctx->pos, yythunkpos940= ctx->thunkpos; if (!yy_HtmlBlockCloseUl(ctx)) goto l940; goto l937; + l940:; ctx->pos= yypos940; ctx->thunkpos= yythunkpos940; + } if (!yymatchDot(ctx)) goto l937; + } + l938:; goto l936; + l937:; ctx->pos= yypos937; ctx->thunkpos= yythunkpos937; + } if (!yy_HtmlBlockCloseUl(ctx)) goto l935; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockUl", ctx->buf+ctx->pos)); + return 1; + l935:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockUl", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseUl(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseUl")); if (!yymatchChar(ctx, '<')) goto l941; if (!yy_Spnl(ctx)) goto l941; if (!yymatchChar(ctx, '/')) goto l941; + { int yypos942= ctx->pos, yythunkpos942= ctx->thunkpos; if (!yymatchString(ctx, "ul")) goto l943; goto l942; + l943:; ctx->pos= yypos942; ctx->thunkpos= yythunkpos942; if (!yymatchString(ctx, "UL")) goto l941; + } + l942:; if (!yy_Spnl(ctx)) goto l941; if (!yymatchChar(ctx, '>')) goto l941; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseUl", ctx->buf+ctx->pos)); + return 1; + l941:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseUl", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenUl(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenUl")); if (!yymatchChar(ctx, '<')) goto l944; if (!yy_Spnl(ctx)) goto l944; + { int yypos945= ctx->pos, yythunkpos945= ctx->thunkpos; if (!yymatchString(ctx, "ul")) goto l946; goto l945; + l946:; ctx->pos= yypos945; ctx->thunkpos= yythunkpos945; if (!yymatchString(ctx, "UL")) goto l944; + } + l945:; if (!yy_Spnl(ctx)) goto l944; + l947:; + { int yypos948= ctx->pos, yythunkpos948= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l948; goto l947; + l948:; ctx->pos= yypos948; ctx->thunkpos= yythunkpos948; + } if (!yymatchChar(ctx, '>')) goto l944; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenUl", ctx->buf+ctx->pos)); + return 1; + l944:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenUl", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockTable(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockTable")); if (!yy_HtmlBlockOpenTable(ctx)) goto l949; + l950:; + { int yypos951= ctx->pos, yythunkpos951= ctx->thunkpos; + { int yypos952= ctx->pos, yythunkpos952= ctx->thunkpos; if (!yy_HtmlBlockTable(ctx)) goto l953; goto l952; + l953:; ctx->pos= yypos952; ctx->thunkpos= yythunkpos952; + { int yypos954= ctx->pos, yythunkpos954= ctx->thunkpos; if (!yy_HtmlBlockCloseTable(ctx)) goto l954; goto l951; + l954:; ctx->pos= yypos954; ctx->thunkpos= yythunkpos954; + } if (!yymatchDot(ctx)) goto l951; + } + l952:; goto l950; + l951:; ctx->pos= yypos951; ctx->thunkpos= yythunkpos951; + } if (!yy_HtmlBlockCloseTable(ctx)) goto l949; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockTable", ctx->buf+ctx->pos)); + return 1; + l949:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockTable", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseTable(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseTable")); if (!yymatchChar(ctx, '<')) goto l955; if (!yy_Spnl(ctx)) goto l955; if (!yymatchChar(ctx, '/')) goto l955; + { int yypos956= ctx->pos, yythunkpos956= ctx->thunkpos; if (!yymatchString(ctx, "table")) goto l957; goto l956; + l957:; ctx->pos= yypos956; ctx->thunkpos= yythunkpos956; if (!yymatchString(ctx, "TABLE")) goto l955; + } + l956:; if (!yy_Spnl(ctx)) goto l955; if (!yymatchChar(ctx, '>')) goto l955; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseTable", ctx->buf+ctx->pos)); + return 1; + l955:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseTable", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenTable(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenTable")); if (!yymatchChar(ctx, '<')) goto l958; if (!yy_Spnl(ctx)) goto l958; + { int yypos959= ctx->pos, yythunkpos959= ctx->thunkpos; if (!yymatchString(ctx, "table")) goto l960; goto l959; + l960:; ctx->pos= yypos959; ctx->thunkpos= yythunkpos959; if (!yymatchString(ctx, "TABLE")) goto l958; + } + l959:; if (!yy_Spnl(ctx)) goto l958; + l961:; + { int yypos962= ctx->pos, yythunkpos962= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l962; goto l961; + l962:; ctx->pos= yypos962; ctx->thunkpos= yythunkpos962; + } if (!yymatchChar(ctx, '>')) goto l958; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenTable", ctx->buf+ctx->pos)); + return 1; + l958:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenTable", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockPre(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockPre")); if (!yy_HtmlBlockOpenPre(ctx)) goto l963; + l964:; + { int yypos965= ctx->pos, yythunkpos965= ctx->thunkpos; + { int yypos966= ctx->pos, yythunkpos966= ctx->thunkpos; if (!yy_HtmlBlockPre(ctx)) goto l967; goto l966; + l967:; ctx->pos= yypos966; ctx->thunkpos= yythunkpos966; + { int yypos968= ctx->pos, yythunkpos968= ctx->thunkpos; if (!yy_HtmlBlockClosePre(ctx)) goto l968; goto l965; + l968:; ctx->pos= yypos968; ctx->thunkpos= yythunkpos968; + } if (!yymatchDot(ctx)) goto l965; + } + l966:; goto l964; + l965:; ctx->pos= yypos965; ctx->thunkpos= yythunkpos965; + } if (!yy_HtmlBlockClosePre(ctx)) goto l963; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockPre", ctx->buf+ctx->pos)); + return 1; + l963:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockPre", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockClosePre(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockClosePre")); if (!yymatchChar(ctx, '<')) goto l969; if (!yy_Spnl(ctx)) goto l969; if (!yymatchChar(ctx, '/')) goto l969; + { int yypos970= ctx->pos, yythunkpos970= ctx->thunkpos; if (!yymatchString(ctx, "pre")) goto l971; goto l970; + l971:; ctx->pos= yypos970; ctx->thunkpos= yythunkpos970; if (!yymatchString(ctx, "PRE")) goto l969; + } + l970:; if (!yy_Spnl(ctx)) goto l969; if (!yymatchChar(ctx, '>')) goto l969; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockClosePre", ctx->buf+ctx->pos)); + return 1; + l969:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockClosePre", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenPre(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenPre")); if (!yymatchChar(ctx, '<')) goto l972; if (!yy_Spnl(ctx)) goto l972; + { int yypos973= ctx->pos, yythunkpos973= ctx->thunkpos; if (!yymatchString(ctx, "pre")) goto l974; goto l973; + l974:; ctx->pos= yypos973; ctx->thunkpos= yythunkpos973; if (!yymatchString(ctx, "PRE")) goto l972; + } + l973:; if (!yy_Spnl(ctx)) goto l972; + l975:; + { int yypos976= ctx->pos, yythunkpos976= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l976; goto l975; + l976:; ctx->pos= yypos976; ctx->thunkpos= yythunkpos976; + } if (!yymatchChar(ctx, '>')) goto l972; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenPre", ctx->buf+ctx->pos)); + return 1; + l972:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenPre", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockP(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockP")); if (!yy_HtmlBlockOpenP(ctx)) goto l977; + l978:; + { int yypos979= ctx->pos, yythunkpos979= ctx->thunkpos; + { int yypos980= ctx->pos, yythunkpos980= ctx->thunkpos; if (!yy_HtmlBlockP(ctx)) goto l981; goto l980; + l981:; ctx->pos= yypos980; ctx->thunkpos= yythunkpos980; + { int yypos982= ctx->pos, yythunkpos982= ctx->thunkpos; if (!yy_HtmlBlockCloseP(ctx)) goto l982; goto l979; + l982:; ctx->pos= yypos982; ctx->thunkpos= yythunkpos982; + } if (!yymatchDot(ctx)) goto l979; + } + l980:; goto l978; + l979:; ctx->pos= yypos979; ctx->thunkpos= yythunkpos979; + } if (!yy_HtmlBlockCloseP(ctx)) goto l977; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockP", ctx->buf+ctx->pos)); + return 1; + l977:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockP", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseP(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseP")); if (!yymatchChar(ctx, '<')) goto l983; if (!yy_Spnl(ctx)) goto l983; if (!yymatchChar(ctx, '/')) goto l983; + { int yypos984= ctx->pos, yythunkpos984= ctx->thunkpos; if (!yymatchChar(ctx, 'p')) goto l985; goto l984; + l985:; ctx->pos= yypos984; ctx->thunkpos= yythunkpos984; if (!yymatchChar(ctx, 'P')) goto l983; + } + l984:; if (!yy_Spnl(ctx)) goto l983; if (!yymatchChar(ctx, '>')) goto l983; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseP", ctx->buf+ctx->pos)); + return 1; + l983:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseP", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenP(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenP")); if (!yymatchChar(ctx, '<')) goto l986; if (!yy_Spnl(ctx)) goto l986; + { int yypos987= ctx->pos, yythunkpos987= ctx->thunkpos; if (!yymatchChar(ctx, 'p')) goto l988; goto l987; + l988:; ctx->pos= yypos987; ctx->thunkpos= yythunkpos987; if (!yymatchChar(ctx, 'P')) goto l986; + } + l987:; if (!yy_Spnl(ctx)) goto l986; + l989:; + { int yypos990= ctx->pos, yythunkpos990= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l990; goto l989; + l990:; ctx->pos= yypos990; ctx->thunkpos= yythunkpos990; + } if (!yymatchChar(ctx, '>')) goto l986; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenP", ctx->buf+ctx->pos)); + return 1; + l986:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenP", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOl(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOl")); if (!yy_HtmlBlockOpenOl(ctx)) goto l991; + l992:; + { int yypos993= ctx->pos, yythunkpos993= ctx->thunkpos; + { int yypos994= ctx->pos, yythunkpos994= ctx->thunkpos; if (!yy_HtmlBlockOl(ctx)) goto l995; goto l994; + l995:; ctx->pos= yypos994; ctx->thunkpos= yythunkpos994; + { int yypos996= ctx->pos, yythunkpos996= ctx->thunkpos; if (!yy_HtmlBlockCloseOl(ctx)) goto l996; goto l993; + l996:; ctx->pos= yypos996; ctx->thunkpos= yythunkpos996; + } if (!yymatchDot(ctx)) goto l993; + } + l994:; goto l992; + l993:; ctx->pos= yypos993; ctx->thunkpos= yythunkpos993; + } if (!yy_HtmlBlockCloseOl(ctx)) goto l991; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOl", ctx->buf+ctx->pos)); + return 1; + l991:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOl", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseOl(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseOl")); if (!yymatchChar(ctx, '<')) goto l997; if (!yy_Spnl(ctx)) goto l997; if (!yymatchChar(ctx, '/')) goto l997; + { int yypos998= ctx->pos, yythunkpos998= ctx->thunkpos; if (!yymatchString(ctx, "ol")) goto l999; goto l998; + l999:; ctx->pos= yypos998; ctx->thunkpos= yythunkpos998; if (!yymatchString(ctx, "OL")) goto l997; + } + l998:; if (!yy_Spnl(ctx)) goto l997; if (!yymatchChar(ctx, '>')) goto l997; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseOl", ctx->buf+ctx->pos)); + return 1; + l997:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseOl", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenOl(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenOl")); if (!yymatchChar(ctx, '<')) goto l1000; if (!yy_Spnl(ctx)) goto l1000; + { int yypos1001= ctx->pos, yythunkpos1001= ctx->thunkpos; if (!yymatchString(ctx, "ol")) goto l1002; goto l1001; + l1002:; ctx->pos= yypos1001; ctx->thunkpos= yythunkpos1001; if (!yymatchString(ctx, "OL")) goto l1000; + } + l1001:; if (!yy_Spnl(ctx)) goto l1000; + l1003:; + { int yypos1004= ctx->pos, yythunkpos1004= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1004; goto l1003; + l1004:; ctx->pos= yypos1004; ctx->thunkpos= yythunkpos1004; + } if (!yymatchChar(ctx, '>')) goto l1000; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenOl", ctx->buf+ctx->pos)); + return 1; + l1000:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenOl", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockNoscript(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockNoscript")); if (!yy_HtmlBlockOpenNoscript(ctx)) goto l1005; + l1006:; + { int yypos1007= ctx->pos, yythunkpos1007= ctx->thunkpos; + { int yypos1008= ctx->pos, yythunkpos1008= ctx->thunkpos; if (!yy_HtmlBlockNoscript(ctx)) goto l1009; goto l1008; + l1009:; ctx->pos= yypos1008; ctx->thunkpos= yythunkpos1008; + { int yypos1010= ctx->pos, yythunkpos1010= ctx->thunkpos; if (!yy_HtmlBlockCloseNoscript(ctx)) goto l1010; goto l1007; + l1010:; ctx->pos= yypos1010; ctx->thunkpos= yythunkpos1010; + } if (!yymatchDot(ctx)) goto l1007; + } + l1008:; goto l1006; + l1007:; ctx->pos= yypos1007; ctx->thunkpos= yythunkpos1007; + } if (!yy_HtmlBlockCloseNoscript(ctx)) goto l1005; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockNoscript", ctx->buf+ctx->pos)); + return 1; + l1005:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockNoscript", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseNoscript(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseNoscript")); if (!yymatchChar(ctx, '<')) goto l1011; if (!yy_Spnl(ctx)) goto l1011; if (!yymatchChar(ctx, '/')) goto l1011; + { int yypos1012= ctx->pos, yythunkpos1012= ctx->thunkpos; if (!yymatchString(ctx, "noscript")) goto l1013; goto l1012; + l1013:; ctx->pos= yypos1012; ctx->thunkpos= yythunkpos1012; if (!yymatchString(ctx, "NOSCRIPT")) goto l1011; + } + l1012:; if (!yy_Spnl(ctx)) goto l1011; if (!yymatchChar(ctx, '>')) goto l1011; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseNoscript", ctx->buf+ctx->pos)); + return 1; + l1011:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseNoscript", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenNoscript(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenNoscript")); if (!yymatchChar(ctx, '<')) goto l1014; if (!yy_Spnl(ctx)) goto l1014; + { int yypos1015= ctx->pos, yythunkpos1015= ctx->thunkpos; if (!yymatchString(ctx, "noscript")) goto l1016; goto l1015; + l1016:; ctx->pos= yypos1015; ctx->thunkpos= yythunkpos1015; if (!yymatchString(ctx, "NOSCRIPT")) goto l1014; + } + l1015:; if (!yy_Spnl(ctx)) goto l1014; + l1017:; + { int yypos1018= ctx->pos, yythunkpos1018= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1018; goto l1017; + l1018:; ctx->pos= yypos1018; ctx->thunkpos= yythunkpos1018; + } if (!yymatchChar(ctx, '>')) goto l1014; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenNoscript", ctx->buf+ctx->pos)); + return 1; + l1014:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenNoscript", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockNoframes(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockNoframes")); if (!yy_HtmlBlockOpenNoframes(ctx)) goto l1019; + l1020:; + { int yypos1021= ctx->pos, yythunkpos1021= ctx->thunkpos; + { int yypos1022= ctx->pos, yythunkpos1022= ctx->thunkpos; if (!yy_HtmlBlockNoframes(ctx)) goto l1023; goto l1022; + l1023:; ctx->pos= yypos1022; ctx->thunkpos= yythunkpos1022; + { int yypos1024= ctx->pos, yythunkpos1024= ctx->thunkpos; if (!yy_HtmlBlockCloseNoframes(ctx)) goto l1024; goto l1021; + l1024:; ctx->pos= yypos1024; ctx->thunkpos= yythunkpos1024; + } if (!yymatchDot(ctx)) goto l1021; + } + l1022:; goto l1020; + l1021:; ctx->pos= yypos1021; ctx->thunkpos= yythunkpos1021; + } if (!yy_HtmlBlockCloseNoframes(ctx)) goto l1019; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockNoframes", ctx->buf+ctx->pos)); + return 1; + l1019:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockNoframes", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseNoframes(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseNoframes")); if (!yymatchChar(ctx, '<')) goto l1025; if (!yy_Spnl(ctx)) goto l1025; if (!yymatchChar(ctx, '/')) goto l1025; + { int yypos1026= ctx->pos, yythunkpos1026= ctx->thunkpos; if (!yymatchString(ctx, "noframes")) goto l1027; goto l1026; + l1027:; ctx->pos= yypos1026; ctx->thunkpos= yythunkpos1026; if (!yymatchString(ctx, "NOFRAMES")) goto l1025; + } + l1026:; if (!yy_Spnl(ctx)) goto l1025; if (!yymatchChar(ctx, '>')) goto l1025; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseNoframes", ctx->buf+ctx->pos)); + return 1; + l1025:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseNoframes", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenNoframes(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenNoframes")); if (!yymatchChar(ctx, '<')) goto l1028; if (!yy_Spnl(ctx)) goto l1028; + { int yypos1029= ctx->pos, yythunkpos1029= ctx->thunkpos; if (!yymatchString(ctx, "noframes")) goto l1030; goto l1029; + l1030:; ctx->pos= yypos1029; ctx->thunkpos= yythunkpos1029; if (!yymatchString(ctx, "NOFRAMES")) goto l1028; + } + l1029:; if (!yy_Spnl(ctx)) goto l1028; + l1031:; + { int yypos1032= ctx->pos, yythunkpos1032= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1032; goto l1031; + l1032:; ctx->pos= yypos1032; ctx->thunkpos= yythunkpos1032; + } if (!yymatchChar(ctx, '>')) goto l1028; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenNoframes", ctx->buf+ctx->pos)); + return 1; + l1028:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenNoframes", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockMenu(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockMenu")); if (!yy_HtmlBlockOpenMenu(ctx)) goto l1033; + l1034:; + { int yypos1035= ctx->pos, yythunkpos1035= ctx->thunkpos; + { int yypos1036= ctx->pos, yythunkpos1036= ctx->thunkpos; if (!yy_HtmlBlockMenu(ctx)) goto l1037; goto l1036; + l1037:; ctx->pos= yypos1036; ctx->thunkpos= yythunkpos1036; + { int yypos1038= ctx->pos, yythunkpos1038= ctx->thunkpos; if (!yy_HtmlBlockCloseMenu(ctx)) goto l1038; goto l1035; + l1038:; ctx->pos= yypos1038; ctx->thunkpos= yythunkpos1038; + } if (!yymatchDot(ctx)) goto l1035; + } + l1036:; goto l1034; + l1035:; ctx->pos= yypos1035; ctx->thunkpos= yythunkpos1035; + } if (!yy_HtmlBlockCloseMenu(ctx)) goto l1033; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockMenu", ctx->buf+ctx->pos)); + return 1; + l1033:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockMenu", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseMenu(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseMenu")); if (!yymatchChar(ctx, '<')) goto l1039; if (!yy_Spnl(ctx)) goto l1039; if (!yymatchChar(ctx, '/')) goto l1039; + { int yypos1040= ctx->pos, yythunkpos1040= ctx->thunkpos; if (!yymatchString(ctx, "menu")) goto l1041; goto l1040; + l1041:; ctx->pos= yypos1040; ctx->thunkpos= yythunkpos1040; if (!yymatchString(ctx, "MENU")) goto l1039; + } + l1040:; if (!yy_Spnl(ctx)) goto l1039; if (!yymatchChar(ctx, '>')) goto l1039; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseMenu", ctx->buf+ctx->pos)); + return 1; + l1039:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseMenu", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenMenu(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenMenu")); if (!yymatchChar(ctx, '<')) goto l1042; if (!yy_Spnl(ctx)) goto l1042; + { int yypos1043= ctx->pos, yythunkpos1043= ctx->thunkpos; if (!yymatchString(ctx, "menu")) goto l1044; goto l1043; + l1044:; ctx->pos= yypos1043; ctx->thunkpos= yythunkpos1043; if (!yymatchString(ctx, "MENU")) goto l1042; + } + l1043:; if (!yy_Spnl(ctx)) goto l1042; + l1045:; + { int yypos1046= ctx->pos, yythunkpos1046= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1046; goto l1045; + l1046:; ctx->pos= yypos1046; ctx->thunkpos= yythunkpos1046; + } if (!yymatchChar(ctx, '>')) goto l1042; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenMenu", ctx->buf+ctx->pos)); + return 1; + l1042:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenMenu", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockH6(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockH6")); if (!yy_HtmlBlockOpenH6(ctx)) goto l1047; + l1048:; + { int yypos1049= ctx->pos, yythunkpos1049= ctx->thunkpos; + { int yypos1050= ctx->pos, yythunkpos1050= ctx->thunkpos; if (!yy_HtmlBlockH6(ctx)) goto l1051; goto l1050; + l1051:; ctx->pos= yypos1050; ctx->thunkpos= yythunkpos1050; + { int yypos1052= ctx->pos, yythunkpos1052= ctx->thunkpos; if (!yy_HtmlBlockCloseH6(ctx)) goto l1052; goto l1049; + l1052:; ctx->pos= yypos1052; ctx->thunkpos= yythunkpos1052; + } if (!yymatchDot(ctx)) goto l1049; + } + l1050:; goto l1048; + l1049:; ctx->pos= yypos1049; ctx->thunkpos= yythunkpos1049; + } if (!yy_HtmlBlockCloseH6(ctx)) goto l1047; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockH6", ctx->buf+ctx->pos)); + return 1; + l1047:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockH6", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseH6(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseH6")); if (!yymatchChar(ctx, '<')) goto l1053; if (!yy_Spnl(ctx)) goto l1053; if (!yymatchChar(ctx, '/')) goto l1053; + { int yypos1054= ctx->pos, yythunkpos1054= ctx->thunkpos; if (!yymatchString(ctx, "h6")) goto l1055; goto l1054; + l1055:; ctx->pos= yypos1054; ctx->thunkpos= yythunkpos1054; if (!yymatchString(ctx, "H6")) goto l1053; + } + l1054:; if (!yy_Spnl(ctx)) goto l1053; if (!yymatchChar(ctx, '>')) goto l1053; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseH6", ctx->buf+ctx->pos)); + return 1; + l1053:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseH6", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenH6(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenH6")); if (!yymatchChar(ctx, '<')) goto l1056; if (!yy_Spnl(ctx)) goto l1056; + { int yypos1057= ctx->pos, yythunkpos1057= ctx->thunkpos; if (!yymatchString(ctx, "h6")) goto l1058; goto l1057; + l1058:; ctx->pos= yypos1057; ctx->thunkpos= yythunkpos1057; if (!yymatchString(ctx, "H6")) goto l1056; + } + l1057:; if (!yy_Spnl(ctx)) goto l1056; + l1059:; + { int yypos1060= ctx->pos, yythunkpos1060= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1060; goto l1059; + l1060:; ctx->pos= yypos1060; ctx->thunkpos= yythunkpos1060; + } if (!yymatchChar(ctx, '>')) goto l1056; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenH6", ctx->buf+ctx->pos)); + return 1; + l1056:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenH6", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockH5(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockH5")); if (!yy_HtmlBlockOpenH5(ctx)) goto l1061; + l1062:; + { int yypos1063= ctx->pos, yythunkpos1063= ctx->thunkpos; + { int yypos1064= ctx->pos, yythunkpos1064= ctx->thunkpos; if (!yy_HtmlBlockH5(ctx)) goto l1065; goto l1064; + l1065:; ctx->pos= yypos1064; ctx->thunkpos= yythunkpos1064; + { int yypos1066= ctx->pos, yythunkpos1066= ctx->thunkpos; if (!yy_HtmlBlockCloseH5(ctx)) goto l1066; goto l1063; + l1066:; ctx->pos= yypos1066; ctx->thunkpos= yythunkpos1066; + } if (!yymatchDot(ctx)) goto l1063; + } + l1064:; goto l1062; + l1063:; ctx->pos= yypos1063; ctx->thunkpos= yythunkpos1063; + } if (!yy_HtmlBlockCloseH5(ctx)) goto l1061; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockH5", ctx->buf+ctx->pos)); + return 1; + l1061:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockH5", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseH5(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseH5")); if (!yymatchChar(ctx, '<')) goto l1067; if (!yy_Spnl(ctx)) goto l1067; if (!yymatchChar(ctx, '/')) goto l1067; + { int yypos1068= ctx->pos, yythunkpos1068= ctx->thunkpos; if (!yymatchString(ctx, "h5")) goto l1069; goto l1068; + l1069:; ctx->pos= yypos1068; ctx->thunkpos= yythunkpos1068; if (!yymatchString(ctx, "H5")) goto l1067; + } + l1068:; if (!yy_Spnl(ctx)) goto l1067; if (!yymatchChar(ctx, '>')) goto l1067; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseH5", ctx->buf+ctx->pos)); + return 1; + l1067:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseH5", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenH5(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenH5")); if (!yymatchChar(ctx, '<')) goto l1070; if (!yy_Spnl(ctx)) goto l1070; + { int yypos1071= ctx->pos, yythunkpos1071= ctx->thunkpos; if (!yymatchString(ctx, "h5")) goto l1072; goto l1071; + l1072:; ctx->pos= yypos1071; ctx->thunkpos= yythunkpos1071; if (!yymatchString(ctx, "H5")) goto l1070; + } + l1071:; if (!yy_Spnl(ctx)) goto l1070; + l1073:; + { int yypos1074= ctx->pos, yythunkpos1074= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1074; goto l1073; + l1074:; ctx->pos= yypos1074; ctx->thunkpos= yythunkpos1074; + } if (!yymatchChar(ctx, '>')) goto l1070; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenH5", ctx->buf+ctx->pos)); + return 1; + l1070:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenH5", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockH4(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockH4")); if (!yy_HtmlBlockOpenH4(ctx)) goto l1075; + l1076:; + { int yypos1077= ctx->pos, yythunkpos1077= ctx->thunkpos; + { int yypos1078= ctx->pos, yythunkpos1078= ctx->thunkpos; if (!yy_HtmlBlockH4(ctx)) goto l1079; goto l1078; + l1079:; ctx->pos= yypos1078; ctx->thunkpos= yythunkpos1078; + { int yypos1080= ctx->pos, yythunkpos1080= ctx->thunkpos; if (!yy_HtmlBlockCloseH4(ctx)) goto l1080; goto l1077; + l1080:; ctx->pos= yypos1080; ctx->thunkpos= yythunkpos1080; + } if (!yymatchDot(ctx)) goto l1077; + } + l1078:; goto l1076; + l1077:; ctx->pos= yypos1077; ctx->thunkpos= yythunkpos1077; + } if (!yy_HtmlBlockCloseH4(ctx)) goto l1075; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockH4", ctx->buf+ctx->pos)); + return 1; + l1075:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockH4", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseH4(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseH4")); if (!yymatchChar(ctx, '<')) goto l1081; if (!yy_Spnl(ctx)) goto l1081; if (!yymatchChar(ctx, '/')) goto l1081; + { int yypos1082= ctx->pos, yythunkpos1082= ctx->thunkpos; if (!yymatchString(ctx, "h4")) goto l1083; goto l1082; + l1083:; ctx->pos= yypos1082; ctx->thunkpos= yythunkpos1082; if (!yymatchString(ctx, "H4")) goto l1081; + } + l1082:; if (!yy_Spnl(ctx)) goto l1081; if (!yymatchChar(ctx, '>')) goto l1081; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseH4", ctx->buf+ctx->pos)); + return 1; + l1081:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseH4", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenH4(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenH4")); if (!yymatchChar(ctx, '<')) goto l1084; if (!yy_Spnl(ctx)) goto l1084; + { int yypos1085= ctx->pos, yythunkpos1085= ctx->thunkpos; if (!yymatchString(ctx, "h4")) goto l1086; goto l1085; + l1086:; ctx->pos= yypos1085; ctx->thunkpos= yythunkpos1085; if (!yymatchString(ctx, "H4")) goto l1084; + } + l1085:; if (!yy_Spnl(ctx)) goto l1084; + l1087:; + { int yypos1088= ctx->pos, yythunkpos1088= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1088; goto l1087; + l1088:; ctx->pos= yypos1088; ctx->thunkpos= yythunkpos1088; + } if (!yymatchChar(ctx, '>')) goto l1084; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenH4", ctx->buf+ctx->pos)); + return 1; + l1084:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenH4", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockH3(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockH3")); if (!yy_HtmlBlockOpenH3(ctx)) goto l1089; + l1090:; + { int yypos1091= ctx->pos, yythunkpos1091= ctx->thunkpos; + { int yypos1092= ctx->pos, yythunkpos1092= ctx->thunkpos; if (!yy_HtmlBlockH3(ctx)) goto l1093; goto l1092; + l1093:; ctx->pos= yypos1092; ctx->thunkpos= yythunkpos1092; + { int yypos1094= ctx->pos, yythunkpos1094= ctx->thunkpos; if (!yy_HtmlBlockCloseH3(ctx)) goto l1094; goto l1091; + l1094:; ctx->pos= yypos1094; ctx->thunkpos= yythunkpos1094; + } if (!yymatchDot(ctx)) goto l1091; + } + l1092:; goto l1090; + l1091:; ctx->pos= yypos1091; ctx->thunkpos= yythunkpos1091; + } if (!yy_HtmlBlockCloseH3(ctx)) goto l1089; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockH3", ctx->buf+ctx->pos)); + return 1; + l1089:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockH3", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseH3(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseH3")); if (!yymatchChar(ctx, '<')) goto l1095; if (!yy_Spnl(ctx)) goto l1095; if (!yymatchChar(ctx, '/')) goto l1095; + { int yypos1096= ctx->pos, yythunkpos1096= ctx->thunkpos; if (!yymatchString(ctx, "h3")) goto l1097; goto l1096; + l1097:; ctx->pos= yypos1096; ctx->thunkpos= yythunkpos1096; if (!yymatchString(ctx, "H3")) goto l1095; + } + l1096:; if (!yy_Spnl(ctx)) goto l1095; if (!yymatchChar(ctx, '>')) goto l1095; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseH3", ctx->buf+ctx->pos)); + return 1; + l1095:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseH3", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenH3(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenH3")); if (!yymatchChar(ctx, '<')) goto l1098; if (!yy_Spnl(ctx)) goto l1098; + { int yypos1099= ctx->pos, yythunkpos1099= ctx->thunkpos; if (!yymatchString(ctx, "h3")) goto l1100; goto l1099; + l1100:; ctx->pos= yypos1099; ctx->thunkpos= yythunkpos1099; if (!yymatchString(ctx, "H3")) goto l1098; + } + l1099:; if (!yy_Spnl(ctx)) goto l1098; + l1101:; + { int yypos1102= ctx->pos, yythunkpos1102= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1102; goto l1101; + l1102:; ctx->pos= yypos1102; ctx->thunkpos= yythunkpos1102; + } if (!yymatchChar(ctx, '>')) goto l1098; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenH3", ctx->buf+ctx->pos)); + return 1; + l1098:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenH3", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockH2(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockH2")); if (!yy_HtmlBlockOpenH2(ctx)) goto l1103; + l1104:; + { int yypos1105= ctx->pos, yythunkpos1105= ctx->thunkpos; + { int yypos1106= ctx->pos, yythunkpos1106= ctx->thunkpos; if (!yy_HtmlBlockH2(ctx)) goto l1107; goto l1106; + l1107:; ctx->pos= yypos1106; ctx->thunkpos= yythunkpos1106; + { int yypos1108= ctx->pos, yythunkpos1108= ctx->thunkpos; if (!yy_HtmlBlockCloseH2(ctx)) goto l1108; goto l1105; + l1108:; ctx->pos= yypos1108; ctx->thunkpos= yythunkpos1108; + } if (!yymatchDot(ctx)) goto l1105; + } + l1106:; goto l1104; + l1105:; ctx->pos= yypos1105; ctx->thunkpos= yythunkpos1105; + } if (!yy_HtmlBlockCloseH2(ctx)) goto l1103; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockH2", ctx->buf+ctx->pos)); + return 1; + l1103:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockH2", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseH2(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseH2")); if (!yymatchChar(ctx, '<')) goto l1109; if (!yy_Spnl(ctx)) goto l1109; if (!yymatchChar(ctx, '/')) goto l1109; + { int yypos1110= ctx->pos, yythunkpos1110= ctx->thunkpos; if (!yymatchString(ctx, "h2")) goto l1111; goto l1110; + l1111:; ctx->pos= yypos1110; ctx->thunkpos= yythunkpos1110; if (!yymatchString(ctx, "H2")) goto l1109; + } + l1110:; if (!yy_Spnl(ctx)) goto l1109; if (!yymatchChar(ctx, '>')) goto l1109; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseH2", ctx->buf+ctx->pos)); + return 1; + l1109:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseH2", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenH2(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenH2")); if (!yymatchChar(ctx, '<')) goto l1112; if (!yy_Spnl(ctx)) goto l1112; + { int yypos1113= ctx->pos, yythunkpos1113= ctx->thunkpos; if (!yymatchString(ctx, "h2")) goto l1114; goto l1113; + l1114:; ctx->pos= yypos1113; ctx->thunkpos= yythunkpos1113; if (!yymatchString(ctx, "H2")) goto l1112; + } + l1113:; if (!yy_Spnl(ctx)) goto l1112; + l1115:; + { int yypos1116= ctx->pos, yythunkpos1116= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1116; goto l1115; + l1116:; ctx->pos= yypos1116; ctx->thunkpos= yythunkpos1116; + } if (!yymatchChar(ctx, '>')) goto l1112; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenH2", ctx->buf+ctx->pos)); + return 1; + l1112:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenH2", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockH1(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockH1")); if (!yy_HtmlBlockOpenH1(ctx)) goto l1117; + l1118:; + { int yypos1119= ctx->pos, yythunkpos1119= ctx->thunkpos; + { int yypos1120= ctx->pos, yythunkpos1120= ctx->thunkpos; if (!yy_HtmlBlockH1(ctx)) goto l1121; goto l1120; + l1121:; ctx->pos= yypos1120; ctx->thunkpos= yythunkpos1120; + { int yypos1122= ctx->pos, yythunkpos1122= ctx->thunkpos; if (!yy_HtmlBlockCloseH1(ctx)) goto l1122; goto l1119; + l1122:; ctx->pos= yypos1122; ctx->thunkpos= yythunkpos1122; + } if (!yymatchDot(ctx)) goto l1119; + } + l1120:; goto l1118; + l1119:; ctx->pos= yypos1119; ctx->thunkpos= yythunkpos1119; + } if (!yy_HtmlBlockCloseH1(ctx)) goto l1117; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockH1", ctx->buf+ctx->pos)); + return 1; + l1117:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockH1", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseH1(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseH1")); if (!yymatchChar(ctx, '<')) goto l1123; if (!yy_Spnl(ctx)) goto l1123; if (!yymatchChar(ctx, '/')) goto l1123; + { int yypos1124= ctx->pos, yythunkpos1124= ctx->thunkpos; if (!yymatchString(ctx, "h1")) goto l1125; goto l1124; + l1125:; ctx->pos= yypos1124; ctx->thunkpos= yythunkpos1124; if (!yymatchString(ctx, "H1")) goto l1123; + } + l1124:; if (!yy_Spnl(ctx)) goto l1123; if (!yymatchChar(ctx, '>')) goto l1123; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseH1", ctx->buf+ctx->pos)); + return 1; + l1123:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseH1", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenH1(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenH1")); if (!yymatchChar(ctx, '<')) goto l1126; if (!yy_Spnl(ctx)) goto l1126; + { int yypos1127= ctx->pos, yythunkpos1127= ctx->thunkpos; if (!yymatchString(ctx, "h1")) goto l1128; goto l1127; + l1128:; ctx->pos= yypos1127; ctx->thunkpos= yythunkpos1127; if (!yymatchString(ctx, "H1")) goto l1126; + } + l1127:; if (!yy_Spnl(ctx)) goto l1126; + l1129:; + { int yypos1130= ctx->pos, yythunkpos1130= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1130; goto l1129; + l1130:; ctx->pos= yypos1130; ctx->thunkpos= yythunkpos1130; + } if (!yymatchChar(ctx, '>')) goto l1126; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenH1", ctx->buf+ctx->pos)); + return 1; + l1126:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenH1", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockForm(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockForm")); if (!yy_HtmlBlockOpenForm(ctx)) goto l1131; + l1132:; + { int yypos1133= ctx->pos, yythunkpos1133= ctx->thunkpos; + { int yypos1134= ctx->pos, yythunkpos1134= ctx->thunkpos; if (!yy_HtmlBlockForm(ctx)) goto l1135; goto l1134; + l1135:; ctx->pos= yypos1134; ctx->thunkpos= yythunkpos1134; + { int yypos1136= ctx->pos, yythunkpos1136= ctx->thunkpos; if (!yy_HtmlBlockCloseForm(ctx)) goto l1136; goto l1133; + l1136:; ctx->pos= yypos1136; ctx->thunkpos= yythunkpos1136; + } if (!yymatchDot(ctx)) goto l1133; + } + l1134:; goto l1132; + l1133:; ctx->pos= yypos1133; ctx->thunkpos= yythunkpos1133; + } if (!yy_HtmlBlockCloseForm(ctx)) goto l1131; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockForm", ctx->buf+ctx->pos)); + return 1; + l1131:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockForm", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseForm(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseForm")); if (!yymatchChar(ctx, '<')) goto l1137; if (!yy_Spnl(ctx)) goto l1137; if (!yymatchChar(ctx, '/')) goto l1137; + { int yypos1138= ctx->pos, yythunkpos1138= ctx->thunkpos; if (!yymatchString(ctx, "form")) goto l1139; goto l1138; + l1139:; ctx->pos= yypos1138; ctx->thunkpos= yythunkpos1138; if (!yymatchString(ctx, "FORM")) goto l1137; + } + l1138:; if (!yy_Spnl(ctx)) goto l1137; if (!yymatchChar(ctx, '>')) goto l1137; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseForm", ctx->buf+ctx->pos)); + return 1; + l1137:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseForm", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenForm(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenForm")); if (!yymatchChar(ctx, '<')) goto l1140; if (!yy_Spnl(ctx)) goto l1140; + { int yypos1141= ctx->pos, yythunkpos1141= ctx->thunkpos; if (!yymatchString(ctx, "form")) goto l1142; goto l1141; + l1142:; ctx->pos= yypos1141; ctx->thunkpos= yythunkpos1141; if (!yymatchString(ctx, "FORM")) goto l1140; + } + l1141:; if (!yy_Spnl(ctx)) goto l1140; + l1143:; + { int yypos1144= ctx->pos, yythunkpos1144= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1144; goto l1143; + l1144:; ctx->pos= yypos1144; ctx->thunkpos= yythunkpos1144; + } if (!yymatchChar(ctx, '>')) goto l1140; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenForm", ctx->buf+ctx->pos)); + return 1; + l1140:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenForm", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockFieldset(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockFieldset")); if (!yy_HtmlBlockOpenFieldset(ctx)) goto l1145; + l1146:; + { int yypos1147= ctx->pos, yythunkpos1147= ctx->thunkpos; + { int yypos1148= ctx->pos, yythunkpos1148= ctx->thunkpos; if (!yy_HtmlBlockFieldset(ctx)) goto l1149; goto l1148; + l1149:; ctx->pos= yypos1148; ctx->thunkpos= yythunkpos1148; + { int yypos1150= ctx->pos, yythunkpos1150= ctx->thunkpos; if (!yy_HtmlBlockCloseFieldset(ctx)) goto l1150; goto l1147; + l1150:; ctx->pos= yypos1150; ctx->thunkpos= yythunkpos1150; + } if (!yymatchDot(ctx)) goto l1147; + } + l1148:; goto l1146; + l1147:; ctx->pos= yypos1147; ctx->thunkpos= yythunkpos1147; + } if (!yy_HtmlBlockCloseFieldset(ctx)) goto l1145; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockFieldset", ctx->buf+ctx->pos)); + return 1; + l1145:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockFieldset", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseFieldset(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseFieldset")); if (!yymatchChar(ctx, '<')) goto l1151; if (!yy_Spnl(ctx)) goto l1151; if (!yymatchChar(ctx, '/')) goto l1151; + { int yypos1152= ctx->pos, yythunkpos1152= ctx->thunkpos; if (!yymatchString(ctx, "fieldset")) goto l1153; goto l1152; + l1153:; ctx->pos= yypos1152; ctx->thunkpos= yythunkpos1152; if (!yymatchString(ctx, "FIELDSET")) goto l1151; + } + l1152:; if (!yy_Spnl(ctx)) goto l1151; if (!yymatchChar(ctx, '>')) goto l1151; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseFieldset", ctx->buf+ctx->pos)); + return 1; + l1151:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseFieldset", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenFieldset(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenFieldset")); if (!yymatchChar(ctx, '<')) goto l1154; if (!yy_Spnl(ctx)) goto l1154; + { int yypos1155= ctx->pos, yythunkpos1155= ctx->thunkpos; if (!yymatchString(ctx, "fieldset")) goto l1156; goto l1155; + l1156:; ctx->pos= yypos1155; ctx->thunkpos= yythunkpos1155; if (!yymatchString(ctx, "FIELDSET")) goto l1154; + } + l1155:; if (!yy_Spnl(ctx)) goto l1154; + l1157:; + { int yypos1158= ctx->pos, yythunkpos1158= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1158; goto l1157; + l1158:; ctx->pos= yypos1158; ctx->thunkpos= yythunkpos1158; + } if (!yymatchChar(ctx, '>')) goto l1154; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenFieldset", ctx->buf+ctx->pos)); + return 1; + l1154:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenFieldset", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockDl(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockDl")); if (!yy_HtmlBlockOpenDl(ctx)) goto l1159; + l1160:; + { int yypos1161= ctx->pos, yythunkpos1161= ctx->thunkpos; + { int yypos1162= ctx->pos, yythunkpos1162= ctx->thunkpos; if (!yy_HtmlBlockDl(ctx)) goto l1163; goto l1162; + l1163:; ctx->pos= yypos1162; ctx->thunkpos= yythunkpos1162; + { int yypos1164= ctx->pos, yythunkpos1164= ctx->thunkpos; if (!yy_HtmlBlockCloseDl(ctx)) goto l1164; goto l1161; + l1164:; ctx->pos= yypos1164; ctx->thunkpos= yythunkpos1164; + } if (!yymatchDot(ctx)) goto l1161; + } + l1162:; goto l1160; + l1161:; ctx->pos= yypos1161; ctx->thunkpos= yythunkpos1161; + } if (!yy_HtmlBlockCloseDl(ctx)) goto l1159; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockDl", ctx->buf+ctx->pos)); + return 1; + l1159:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockDl", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseDl(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseDl")); if (!yymatchChar(ctx, '<')) goto l1165; if (!yy_Spnl(ctx)) goto l1165; if (!yymatchChar(ctx, '/')) goto l1165; + { int yypos1166= ctx->pos, yythunkpos1166= ctx->thunkpos; if (!yymatchString(ctx, "dl")) goto l1167; goto l1166; + l1167:; ctx->pos= yypos1166; ctx->thunkpos= yythunkpos1166; if (!yymatchString(ctx, "DL")) goto l1165; + } + l1166:; if (!yy_Spnl(ctx)) goto l1165; if (!yymatchChar(ctx, '>')) goto l1165; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseDl", ctx->buf+ctx->pos)); + return 1; + l1165:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseDl", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenDl(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenDl")); if (!yymatchChar(ctx, '<')) goto l1168; if (!yy_Spnl(ctx)) goto l1168; + { int yypos1169= ctx->pos, yythunkpos1169= ctx->thunkpos; if (!yymatchString(ctx, "dl")) goto l1170; goto l1169; + l1170:; ctx->pos= yypos1169; ctx->thunkpos= yythunkpos1169; if (!yymatchString(ctx, "DL")) goto l1168; + } + l1169:; if (!yy_Spnl(ctx)) goto l1168; + l1171:; + { int yypos1172= ctx->pos, yythunkpos1172= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1172; goto l1171; + l1172:; ctx->pos= yypos1172; ctx->thunkpos= yythunkpos1172; + } if (!yymatchChar(ctx, '>')) goto l1168; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenDl", ctx->buf+ctx->pos)); + return 1; + l1168:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenDl", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockDiv(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockDiv")); if (!yy_HtmlBlockOpenDiv(ctx)) goto l1173; + l1174:; + { int yypos1175= ctx->pos, yythunkpos1175= ctx->thunkpos; + { int yypos1176= ctx->pos, yythunkpos1176= ctx->thunkpos; if (!yy_HtmlBlockDiv(ctx)) goto l1177; goto l1176; + l1177:; ctx->pos= yypos1176; ctx->thunkpos= yythunkpos1176; + { int yypos1178= ctx->pos, yythunkpos1178= ctx->thunkpos; if (!yy_HtmlBlockCloseDiv(ctx)) goto l1178; goto l1175; + l1178:; ctx->pos= yypos1178; ctx->thunkpos= yythunkpos1178; + } if (!yymatchDot(ctx)) goto l1175; + } + l1176:; goto l1174; + l1175:; ctx->pos= yypos1175; ctx->thunkpos= yythunkpos1175; + } if (!yy_HtmlBlockCloseDiv(ctx)) goto l1173; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockDiv", ctx->buf+ctx->pos)); + return 1; + l1173:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockDiv", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseDiv(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseDiv")); if (!yymatchChar(ctx, '<')) goto l1179; if (!yy_Spnl(ctx)) goto l1179; if (!yymatchChar(ctx, '/')) goto l1179; + { int yypos1180= ctx->pos, yythunkpos1180= ctx->thunkpos; if (!yymatchString(ctx, "div")) goto l1181; goto l1180; + l1181:; ctx->pos= yypos1180; ctx->thunkpos= yythunkpos1180; if (!yymatchString(ctx, "DIV")) goto l1179; + } + l1180:; if (!yy_Spnl(ctx)) goto l1179; if (!yymatchChar(ctx, '>')) goto l1179; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseDiv", ctx->buf+ctx->pos)); + return 1; + l1179:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseDiv", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenDiv(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenDiv")); if (!yymatchChar(ctx, '<')) goto l1182; if (!yy_Spnl(ctx)) goto l1182; + { int yypos1183= ctx->pos, yythunkpos1183= ctx->thunkpos; if (!yymatchString(ctx, "div")) goto l1184; goto l1183; + l1184:; ctx->pos= yypos1183; ctx->thunkpos= yythunkpos1183; if (!yymatchString(ctx, "DIV")) goto l1182; + } + l1183:; if (!yy_Spnl(ctx)) goto l1182; + l1185:; + { int yypos1186= ctx->pos, yythunkpos1186= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1186; goto l1185; + l1186:; ctx->pos= yypos1186; ctx->thunkpos= yythunkpos1186; + } if (!yymatchChar(ctx, '>')) goto l1182; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenDiv", ctx->buf+ctx->pos)); + return 1; + l1182:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenDiv", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockDir(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockDir")); if (!yy_HtmlBlockOpenDir(ctx)) goto l1187; + l1188:; + { int yypos1189= ctx->pos, yythunkpos1189= ctx->thunkpos; + { int yypos1190= ctx->pos, yythunkpos1190= ctx->thunkpos; if (!yy_HtmlBlockDir(ctx)) goto l1191; goto l1190; + l1191:; ctx->pos= yypos1190; ctx->thunkpos= yythunkpos1190; + { int yypos1192= ctx->pos, yythunkpos1192= ctx->thunkpos; if (!yy_HtmlBlockCloseDir(ctx)) goto l1192; goto l1189; + l1192:; ctx->pos= yypos1192; ctx->thunkpos= yythunkpos1192; + } if (!yymatchDot(ctx)) goto l1189; + } + l1190:; goto l1188; + l1189:; ctx->pos= yypos1189; ctx->thunkpos= yythunkpos1189; + } if (!yy_HtmlBlockCloseDir(ctx)) goto l1187; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockDir", ctx->buf+ctx->pos)); + return 1; + l1187:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockDir", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseDir(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseDir")); if (!yymatchChar(ctx, '<')) goto l1193; if (!yy_Spnl(ctx)) goto l1193; if (!yymatchChar(ctx, '/')) goto l1193; + { int yypos1194= ctx->pos, yythunkpos1194= ctx->thunkpos; if (!yymatchString(ctx, "dir")) goto l1195; goto l1194; + l1195:; ctx->pos= yypos1194; ctx->thunkpos= yythunkpos1194; if (!yymatchString(ctx, "DIR")) goto l1193; + } + l1194:; if (!yy_Spnl(ctx)) goto l1193; if (!yymatchChar(ctx, '>')) goto l1193; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseDir", ctx->buf+ctx->pos)); + return 1; + l1193:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseDir", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenDir(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenDir")); if (!yymatchChar(ctx, '<')) goto l1196; if (!yy_Spnl(ctx)) goto l1196; + { int yypos1197= ctx->pos, yythunkpos1197= ctx->thunkpos; if (!yymatchString(ctx, "dir")) goto l1198; goto l1197; + l1198:; ctx->pos= yypos1197; ctx->thunkpos= yythunkpos1197; if (!yymatchString(ctx, "DIR")) goto l1196; + } + l1197:; if (!yy_Spnl(ctx)) goto l1196; + l1199:; + { int yypos1200= ctx->pos, yythunkpos1200= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1200; goto l1199; + l1200:; ctx->pos= yypos1200; ctx->thunkpos= yythunkpos1200; + } if (!yymatchChar(ctx, '>')) goto l1196; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenDir", ctx->buf+ctx->pos)); + return 1; + l1196:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenDir", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCenter(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCenter")); if (!yy_HtmlBlockOpenCenter(ctx)) goto l1201; + l1202:; + { int yypos1203= ctx->pos, yythunkpos1203= ctx->thunkpos; + { int yypos1204= ctx->pos, yythunkpos1204= ctx->thunkpos; if (!yy_HtmlBlockCenter(ctx)) goto l1205; goto l1204; + l1205:; ctx->pos= yypos1204; ctx->thunkpos= yythunkpos1204; + { int yypos1206= ctx->pos, yythunkpos1206= ctx->thunkpos; if (!yy_HtmlBlockCloseCenter(ctx)) goto l1206; goto l1203; + l1206:; ctx->pos= yypos1206; ctx->thunkpos= yythunkpos1206; + } if (!yymatchDot(ctx)) goto l1203; + } + l1204:; goto l1202; + l1203:; ctx->pos= yypos1203; ctx->thunkpos= yythunkpos1203; + } if (!yy_HtmlBlockCloseCenter(ctx)) goto l1201; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCenter", ctx->buf+ctx->pos)); + return 1; + l1201:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCenter", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseCenter(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseCenter")); if (!yymatchChar(ctx, '<')) goto l1207; if (!yy_Spnl(ctx)) goto l1207; if (!yymatchChar(ctx, '/')) goto l1207; + { int yypos1208= ctx->pos, yythunkpos1208= ctx->thunkpos; if (!yymatchString(ctx, "center")) goto l1209; goto l1208; + l1209:; ctx->pos= yypos1208; ctx->thunkpos= yythunkpos1208; if (!yymatchString(ctx, "CENTER")) goto l1207; + } + l1208:; if (!yy_Spnl(ctx)) goto l1207; if (!yymatchChar(ctx, '>')) goto l1207; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseCenter", ctx->buf+ctx->pos)); + return 1; + l1207:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseCenter", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenCenter(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenCenter")); if (!yymatchChar(ctx, '<')) goto l1210; if (!yy_Spnl(ctx)) goto l1210; + { int yypos1211= ctx->pos, yythunkpos1211= ctx->thunkpos; if (!yymatchString(ctx, "center")) goto l1212; goto l1211; + l1212:; ctx->pos= yypos1211; ctx->thunkpos= yythunkpos1211; if (!yymatchString(ctx, "CENTER")) goto l1210; + } + l1211:; if (!yy_Spnl(ctx)) goto l1210; + l1213:; + { int yypos1214= ctx->pos, yythunkpos1214= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1214; goto l1213; + l1214:; ctx->pos= yypos1214; ctx->thunkpos= yythunkpos1214; + } if (!yymatchChar(ctx, '>')) goto l1210; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenCenter", ctx->buf+ctx->pos)); + return 1; + l1210:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenCenter", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockBlockquote(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockBlockquote")); if (!yy_HtmlBlockOpenBlockquote(ctx)) goto l1215; + l1216:; + { int yypos1217= ctx->pos, yythunkpos1217= ctx->thunkpos; + { int yypos1218= ctx->pos, yythunkpos1218= ctx->thunkpos; if (!yy_HtmlBlockBlockquote(ctx)) goto l1219; goto l1218; + l1219:; ctx->pos= yypos1218; ctx->thunkpos= yythunkpos1218; + { int yypos1220= ctx->pos, yythunkpos1220= ctx->thunkpos; if (!yy_HtmlBlockCloseBlockquote(ctx)) goto l1220; goto l1217; + l1220:; ctx->pos= yypos1220; ctx->thunkpos= yythunkpos1220; + } if (!yymatchDot(ctx)) goto l1217; + } + l1218:; goto l1216; + l1217:; ctx->pos= yypos1217; ctx->thunkpos= yythunkpos1217; + } if (!yy_HtmlBlockCloseBlockquote(ctx)) goto l1215; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockBlockquote", ctx->buf+ctx->pos)); + return 1; + l1215:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockBlockquote", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseBlockquote(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseBlockquote")); if (!yymatchChar(ctx, '<')) goto l1221; if (!yy_Spnl(ctx)) goto l1221; if (!yymatchChar(ctx, '/')) goto l1221; + { int yypos1222= ctx->pos, yythunkpos1222= ctx->thunkpos; if (!yymatchString(ctx, "blockquote")) goto l1223; goto l1222; + l1223:; ctx->pos= yypos1222; ctx->thunkpos= yythunkpos1222; if (!yymatchString(ctx, "BLOCKQUOTE")) goto l1221; + } + l1222:; if (!yy_Spnl(ctx)) goto l1221; if (!yymatchChar(ctx, '>')) goto l1221; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseBlockquote", ctx->buf+ctx->pos)); + return 1; + l1221:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseBlockquote", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenBlockquote(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenBlockquote")); if (!yymatchChar(ctx, '<')) goto l1224; if (!yy_Spnl(ctx)) goto l1224; + { int yypos1225= ctx->pos, yythunkpos1225= ctx->thunkpos; if (!yymatchString(ctx, "blockquote")) goto l1226; goto l1225; + l1226:; ctx->pos= yypos1225; ctx->thunkpos= yythunkpos1225; if (!yymatchString(ctx, "BLOCKQUOTE")) goto l1224; + } + l1225:; if (!yy_Spnl(ctx)) goto l1224; + l1227:; + { int yypos1228= ctx->pos, yythunkpos1228= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1228; goto l1227; + l1228:; ctx->pos= yypos1228; ctx->thunkpos= yythunkpos1228; + } if (!yymatchChar(ctx, '>')) goto l1224; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenBlockquote", ctx->buf+ctx->pos)); + return 1; + l1224:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenBlockquote", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockAddress(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockAddress")); if (!yy_HtmlBlockOpenAddress(ctx)) goto l1229; + l1230:; + { int yypos1231= ctx->pos, yythunkpos1231= ctx->thunkpos; + { int yypos1232= ctx->pos, yythunkpos1232= ctx->thunkpos; if (!yy_HtmlBlockAddress(ctx)) goto l1233; goto l1232; + l1233:; ctx->pos= yypos1232; ctx->thunkpos= yythunkpos1232; + { int yypos1234= ctx->pos, yythunkpos1234= ctx->thunkpos; if (!yy_HtmlBlockCloseAddress(ctx)) goto l1234; goto l1231; + l1234:; ctx->pos= yypos1234; ctx->thunkpos= yythunkpos1234; + } if (!yymatchDot(ctx)) goto l1231; + } + l1232:; goto l1230; + l1231:; ctx->pos= yypos1231; ctx->thunkpos= yythunkpos1231; + } if (!yy_HtmlBlockCloseAddress(ctx)) goto l1229; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockAddress", ctx->buf+ctx->pos)); + return 1; + l1229:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockAddress", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockCloseAddress(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockCloseAddress")); if (!yymatchChar(ctx, '<')) goto l1235; if (!yy_Spnl(ctx)) goto l1235; if (!yymatchChar(ctx, '/')) goto l1235; + { int yypos1236= ctx->pos, yythunkpos1236= ctx->thunkpos; if (!yymatchString(ctx, "address")) goto l1237; goto l1236; + l1237:; ctx->pos= yypos1236; ctx->thunkpos= yythunkpos1236; if (!yymatchString(ctx, "ADDRESS")) goto l1235; + } + l1236:; if (!yy_Spnl(ctx)) goto l1235; if (!yymatchChar(ctx, '>')) goto l1235; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockCloseAddress", ctx->buf+ctx->pos)); + return 1; + l1235:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockCloseAddress", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlAttribute(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlAttribute")); + { int yypos1241= ctx->pos, yythunkpos1241= ctx->thunkpos; if (!yy_AlphanumericAscii(ctx)) goto l1242; goto l1241; + l1242:; ctx->pos= yypos1241; ctx->thunkpos= yythunkpos1241; if (!yymatchChar(ctx, '-')) goto l1238; + } + l1241:; + l1239:; + { int yypos1240= ctx->pos, yythunkpos1240= ctx->thunkpos; + { int yypos1243= ctx->pos, yythunkpos1243= ctx->thunkpos; if (!yy_AlphanumericAscii(ctx)) goto l1244; goto l1243; + l1244:; ctx->pos= yypos1243; ctx->thunkpos= yythunkpos1243; if (!yymatchChar(ctx, '-')) goto l1240; + } + l1243:; goto l1239; + l1240:; ctx->pos= yypos1240; ctx->thunkpos= yythunkpos1240; + } if (!yy_Spnl(ctx)) goto l1238; + { int yypos1245= ctx->pos, yythunkpos1245= ctx->thunkpos; if (!yymatchChar(ctx, '=')) goto l1245; if (!yy_Spnl(ctx)) goto l1245; + { int yypos1247= ctx->pos, yythunkpos1247= ctx->thunkpos; if (!yy_Quoted(ctx)) goto l1248; goto l1247; + l1248:; ctx->pos= yypos1247; ctx->thunkpos= yythunkpos1247; + { int yypos1251= ctx->pos, yythunkpos1251= ctx->thunkpos; if (!yymatchChar(ctx, '>')) goto l1251; goto l1245; + l1251:; ctx->pos= yypos1251; ctx->thunkpos= yythunkpos1251; + } if (!yy_Nonspacechar(ctx)) goto l1245; + l1249:; + { int yypos1250= ctx->pos, yythunkpos1250= ctx->thunkpos; + { int yypos1252= ctx->pos, yythunkpos1252= ctx->thunkpos; if (!yymatchChar(ctx, '>')) goto l1252; goto l1250; + l1252:; ctx->pos= yypos1252; ctx->thunkpos= yythunkpos1252; + } if (!yy_Nonspacechar(ctx)) goto l1250; goto l1249; + l1250:; ctx->pos= yypos1250; ctx->thunkpos= yythunkpos1250; + } + } + l1247:; goto l1246; + l1245:; ctx->pos= yypos1245; ctx->thunkpos= yythunkpos1245; + } + l1246:; if (!yy_Spnl(ctx)) goto l1238; + yyprintf((stderr, " ok %s @ %s\n", "HtmlAttribute", ctx->buf+ctx->pos)); + return 1; + l1238:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlAttribute", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Spnl(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Spnl")); if (!yy_Sp(ctx)) goto l1253; + { int yypos1254= ctx->pos, yythunkpos1254= ctx->thunkpos; if (!yy_Newline(ctx)) goto l1254; if (!yy_Sp(ctx)) goto l1254; goto l1255; + l1254:; ctx->pos= yypos1254; ctx->thunkpos= yythunkpos1254; + } + l1255:; + yyprintf((stderr, " ok %s @ %s\n", "Spnl", ctx->buf+ctx->pos)); + return 1; + l1253:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Spnl", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlockOpenAddress(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlockOpenAddress")); if (!yymatchChar(ctx, '<')) goto l1256; if (!yy_Spnl(ctx)) goto l1256; + { int yypos1257= ctx->pos, yythunkpos1257= ctx->thunkpos; if (!yymatchString(ctx, "address")) goto l1258; goto l1257; + l1258:; ctx->pos= yypos1257; ctx->thunkpos= yythunkpos1257; if (!yymatchString(ctx, "ADDRESS")) goto l1256; + } + l1257:; if (!yy_Spnl(ctx)) goto l1256; + l1259:; + { int yypos1260= ctx->pos, yythunkpos1260= ctx->thunkpos; if (!yy_HtmlAttribute(ctx)) goto l1260; goto l1259; + l1260:; ctx->pos= yypos1260; ctx->thunkpos= yythunkpos1260; + } if (!yymatchChar(ctx, '>')) goto l1256; + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlockOpenAddress", ctx->buf+ctx->pos)); + return 1; + l1256:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlockOpenAddress", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_OptionallyIndentedLine(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "OptionallyIndentedLine")); + { int yypos1262= ctx->pos, yythunkpos1262= ctx->thunkpos; if (!yy_Indent(ctx)) goto l1262; goto l1263; + l1262:; ctx->pos= yypos1262; ctx->thunkpos= yythunkpos1262; + } + l1263:; if (!yy_Line(ctx)) goto l1261; + yyprintf((stderr, " ok %s @ %s\n", "OptionallyIndentedLine", ctx->buf+ctx->pos)); + return 1; + l1261:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "OptionallyIndentedLine", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Indent(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Indent")); + { int yypos1265= ctx->pos, yythunkpos1265= ctx->thunkpos; if (!yymatchChar(ctx, '\t')) goto l1266; goto l1265; + l1266:; ctx->pos= yypos1265; ctx->thunkpos= yythunkpos1265; if (!yymatchString(ctx, " ")) goto l1264; + } + l1265:; + yyprintf((stderr, " ok %s @ %s\n", "Indent", ctx->buf+ctx->pos)); + return 1; + l1264:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Indent", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_ListBlockLine(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "ListBlockLine")); + { int yypos1268= ctx->pos, yythunkpos1268= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1268; goto l1267; + l1268:; ctx->pos= yypos1268; ctx->thunkpos= yythunkpos1268; + } + { int yypos1269= ctx->pos, yythunkpos1269= ctx->thunkpos; + { int yypos1270= ctx->pos, yythunkpos1270= ctx->thunkpos; if (!yy_Indent(ctx)) goto l1270; goto l1271; + l1270:; ctx->pos= yypos1270; ctx->thunkpos= yythunkpos1270; + } + l1271:; + { int yypos1272= ctx->pos, yythunkpos1272= ctx->thunkpos; if (!yy_Bullet(ctx)) goto l1273; goto l1272; + l1273:; ctx->pos= yypos1272; ctx->thunkpos= yythunkpos1272; if (!yy_Enumerator(ctx)) goto l1269; + } + l1272:; goto l1267; + l1269:; ctx->pos= yypos1269; ctx->thunkpos= yythunkpos1269; + } + { int yypos1274= ctx->pos, yythunkpos1274= ctx->thunkpos; if (!yy_HorizontalRule(ctx)) goto l1274; goto l1267; + l1274:; ctx->pos= yypos1274; ctx->thunkpos= yythunkpos1274; + } if (!yy_OptionallyIndentedLine(ctx)) goto l1267; + yyprintf((stderr, " ok %s @ %s\n", "ListBlockLine", ctx->buf+ctx->pos)); + return 1; + l1267:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "ListBlockLine", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_ListContinuationBlock(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "ListContinuationBlock")); if (!yy_StartList(ctx)) goto l1275; yyDo(ctx, yySet, -1, 0); yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l1275; + l1276:; + { int yypos1277= ctx->pos, yythunkpos1277= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1277; goto l1276; + l1277:; ctx->pos= yypos1277; ctx->thunkpos= yythunkpos1277; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l1275; yyDo(ctx, yy_1_ListContinuationBlock, ctx->begin, ctx->end); if (!yy_Indent(ctx)) goto l1275; if (!yy_ListBlock(ctx)) goto l1275; yyDo(ctx, yy_2_ListContinuationBlock, ctx->begin, ctx->end); + l1278:; + { int yypos1279= ctx->pos, yythunkpos1279= ctx->thunkpos; if (!yy_Indent(ctx)) goto l1279; if (!yy_ListBlock(ctx)) goto l1279; yyDo(ctx, yy_2_ListContinuationBlock, ctx->begin, ctx->end); goto l1278; + l1279:; ctx->pos= yypos1279; ctx->thunkpos= yythunkpos1279; + } yyDo(ctx, yy_3_ListContinuationBlock, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "ListContinuationBlock", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l1275:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "ListContinuationBlock", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_ListBlock(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "ListBlock")); if (!yy_StartList(ctx)) goto l1280; yyDo(ctx, yySet, -1, 0); + { int yypos1281= ctx->pos, yythunkpos1281= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1281; goto l1280; + l1281:; ctx->pos= yypos1281; ctx->thunkpos= yythunkpos1281; + } if (!yy_Line(ctx)) goto l1280; yyDo(ctx, yy_1_ListBlock, ctx->begin, ctx->end); + l1282:; + { int yypos1283= ctx->pos, yythunkpos1283= ctx->thunkpos; if (!yy_ListBlockLine(ctx)) goto l1283; yyDo(ctx, yy_2_ListBlock, ctx->begin, ctx->end); goto l1282; + l1283:; ctx->pos= yypos1283; ctx->thunkpos= yythunkpos1283; + } yyDo(ctx, yy_3_ListBlock, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "ListBlock", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l1280:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "ListBlock", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_ListItem(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "ListItem")); + { int yypos1285= ctx->pos, yythunkpos1285= ctx->thunkpos; if (!yy_Bullet(ctx)) goto l1286; goto l1285; + l1286:; ctx->pos= yypos1285; ctx->thunkpos= yythunkpos1285; if (!yy_Enumerator(ctx)) goto l1284; + } + l1285:; if (!yy_StartList(ctx)) goto l1284; yyDo(ctx, yySet, -1, 0); if (!yy_ListBlock(ctx)) goto l1284; yyDo(ctx, yy_1_ListItem, ctx->begin, ctx->end); + l1287:; + { int yypos1288= ctx->pos, yythunkpos1288= ctx->thunkpos; if (!yy_ListContinuationBlock(ctx)) goto l1288; yyDo(ctx, yy_2_ListItem, ctx->begin, ctx->end); goto l1287; + l1288:; ctx->pos= yypos1288; ctx->thunkpos= yythunkpos1288; + } yyDo(ctx, yy_3_ListItem, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "ListItem", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l1284:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "ListItem", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Enumerator(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Enumerator")); if (!yy_NonindentSpace(ctx)) goto l1289; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\377\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l1289; + l1290:; + { int yypos1291= ctx->pos, yythunkpos1291= ctx->thunkpos; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\377\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l1291; goto l1290; + l1291:; ctx->pos= yypos1291; ctx->thunkpos= yythunkpos1291; + } if (!yymatchChar(ctx, '.')) goto l1289; if (!yy_Spacechar(ctx)) goto l1289; + l1292:; + { int yypos1293= ctx->pos, yythunkpos1293= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l1293; goto l1292; + l1293:; ctx->pos= yypos1293; ctx->thunkpos= yythunkpos1293; + } + yyprintf((stderr, " ok %s @ %s\n", "Enumerator", ctx->buf+ctx->pos)); + return 1; + l1289:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Enumerator", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_ListItemTight(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "ListItemTight")); + { int yypos1295= ctx->pos, yythunkpos1295= ctx->thunkpos; if (!yy_Bullet(ctx)) goto l1296; goto l1295; + l1296:; ctx->pos= yypos1295; ctx->thunkpos= yythunkpos1295; if (!yy_Enumerator(ctx)) goto l1294; + } + l1295:; if (!yy_StartList(ctx)) goto l1294; yyDo(ctx, yySet, -1, 0); if (!yy_ListBlock(ctx)) goto l1294; yyDo(ctx, yy_1_ListItemTight, ctx->begin, ctx->end); + l1297:; + { int yypos1298= ctx->pos, yythunkpos1298= ctx->thunkpos; + { int yypos1299= ctx->pos, yythunkpos1299= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1299; goto l1298; + l1299:; ctx->pos= yypos1299; ctx->thunkpos= yythunkpos1299; + } if (!yy_ListContinuationBlock(ctx)) goto l1298; yyDo(ctx, yy_2_ListItemTight, ctx->begin, ctx->end); goto l1297; + l1298:; ctx->pos= yypos1298; ctx->thunkpos= yythunkpos1298; + } + { int yypos1300= ctx->pos, yythunkpos1300= ctx->thunkpos; if (!yy_ListContinuationBlock(ctx)) goto l1300; goto l1294; + l1300:; ctx->pos= yypos1300; ctx->thunkpos= yythunkpos1300; + } yyDo(ctx, yy_3_ListItemTight, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "ListItemTight", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l1294:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "ListItemTight", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_ListLoose(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 2, 0); + yyprintf((stderr, "%s\n", "ListLoose")); if (!yy_StartList(ctx)) goto l1301; yyDo(ctx, yySet, -2, 0); if (!yy_ListItem(ctx)) goto l1301; yyDo(ctx, yySet, -1, 0); + l1304:; + { int yypos1305= ctx->pos, yythunkpos1305= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1305; goto l1304; + l1305:; ctx->pos= yypos1305; ctx->thunkpos= yythunkpos1305; + } yyDo(ctx, yy_1_ListLoose, ctx->begin, ctx->end); + l1302:; + { int yypos1303= ctx->pos, yythunkpos1303= ctx->thunkpos; if (!yy_ListItem(ctx)) goto l1303; yyDo(ctx, yySet, -1, 0); + l1306:; + { int yypos1307= ctx->pos, yythunkpos1307= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1307; goto l1306; + l1307:; ctx->pos= yypos1307; ctx->thunkpos= yythunkpos1307; + } yyDo(ctx, yy_1_ListLoose, ctx->begin, ctx->end); goto l1302; + l1303:; ctx->pos= yypos1303; ctx->thunkpos= yythunkpos1303; + } yyDo(ctx, yy_2_ListLoose, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "ListLoose", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 2, 0); + return 1; + l1301:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "ListLoose", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_ListTight(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "ListTight")); if (!yy_StartList(ctx)) goto l1308; yyDo(ctx, yySet, -1, 0); if (!yy_ListItemTight(ctx)) goto l1308; yyDo(ctx, yy_1_ListTight, ctx->begin, ctx->end); + l1309:; + { int yypos1310= ctx->pos, yythunkpos1310= ctx->thunkpos; if (!yy_ListItemTight(ctx)) goto l1310; yyDo(ctx, yy_1_ListTight, ctx->begin, ctx->end); goto l1309; + l1310:; ctx->pos= yypos1310; ctx->thunkpos= yythunkpos1310; + } + l1311:; + { int yypos1312= ctx->pos, yythunkpos1312= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1312; goto l1311; + l1312:; ctx->pos= yypos1312; ctx->thunkpos= yythunkpos1312; + } + { int yypos1313= ctx->pos, yythunkpos1313= ctx->thunkpos; + { int yypos1314= ctx->pos, yythunkpos1314= ctx->thunkpos; if (!yy_Bullet(ctx)) goto l1315; goto l1314; + l1315:; ctx->pos= yypos1314; ctx->thunkpos= yythunkpos1314; if (!yy_Enumerator(ctx)) goto l1313; + } + l1314:; goto l1308; + l1313:; ctx->pos= yypos1313; ctx->thunkpos= yythunkpos1313; + } yyDo(ctx, yy_2_ListTight, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "ListTight", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l1308:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "ListTight", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Spacechar(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Spacechar")); + { int yypos1317= ctx->pos, yythunkpos1317= ctx->thunkpos; if (!yymatchChar(ctx, ' ')) goto l1318; goto l1317; + l1318:; ctx->pos= yypos1317; ctx->thunkpos= yythunkpos1317; if (!yymatchChar(ctx, '\t')) goto l1316; + } + l1317:; + yyprintf((stderr, " ok %s @ %s\n", "Spacechar", ctx->buf+ctx->pos)); + return 1; + l1316:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Spacechar", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Bullet(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Bullet")); + { int yypos1320= ctx->pos, yythunkpos1320= ctx->thunkpos; if (!yy_HorizontalRule(ctx)) goto l1320; goto l1319; + l1320:; ctx->pos= yypos1320; ctx->thunkpos= yythunkpos1320; + } if (!yy_NonindentSpace(ctx)) goto l1319; + { int yypos1321= ctx->pos, yythunkpos1321= ctx->thunkpos; if (!yymatchChar(ctx, '+')) goto l1322; goto l1321; + l1322:; ctx->pos= yypos1321; ctx->thunkpos= yythunkpos1321; if (!yymatchChar(ctx, '*')) goto l1323; goto l1321; + l1323:; ctx->pos= yypos1321; ctx->thunkpos= yythunkpos1321; if (!yymatchChar(ctx, '-')) goto l1319; + } + l1321:; if (!yy_Spacechar(ctx)) goto l1319; + l1324:; + { int yypos1325= ctx->pos, yythunkpos1325= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l1325; goto l1324; + l1325:; ctx->pos= yypos1325; ctx->thunkpos= yythunkpos1325; + } + yyprintf((stderr, " ok %s @ %s\n", "Bullet", ctx->buf+ctx->pos)); + return 1; + l1319:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Bullet", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_VerbatimChunk(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "VerbatimChunk")); if (!yy_StartList(ctx)) goto l1326; yyDo(ctx, yySet, -1, 0); + l1327:; + { int yypos1328= ctx->pos, yythunkpos1328= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1328; yyDo(ctx, yy_1_VerbatimChunk, ctx->begin, ctx->end); goto l1327; + l1328:; ctx->pos= yypos1328; ctx->thunkpos= yythunkpos1328; + } if (!yy_NonblankIndentedLine(ctx)) goto l1326; yyDo(ctx, yy_2_VerbatimChunk, ctx->begin, ctx->end); + l1329:; + { int yypos1330= ctx->pos, yythunkpos1330= ctx->thunkpos; if (!yy_NonblankIndentedLine(ctx)) goto l1330; yyDo(ctx, yy_2_VerbatimChunk, ctx->begin, ctx->end); goto l1329; + l1330:; ctx->pos= yypos1330; ctx->thunkpos= yythunkpos1330; + } yyDo(ctx, yy_3_VerbatimChunk, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "VerbatimChunk", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l1326:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "VerbatimChunk", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_IndentedLine(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "IndentedLine")); if (!yy_Indent(ctx)) goto l1331; if (!yy_Line(ctx)) goto l1331; + yyprintf((stderr, " ok %s @ %s\n", "IndentedLine", ctx->buf+ctx->pos)); + return 1; + l1331:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "IndentedLine", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_NonblankIndentedLine(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "NonblankIndentedLine")); + { int yypos1333= ctx->pos, yythunkpos1333= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1333; goto l1332; + l1333:; ctx->pos= yypos1333; ctx->thunkpos= yythunkpos1333; + } if (!yy_IndentedLine(ctx)) goto l1332; + yyprintf((stderr, " ok %s @ %s\n", "NonblankIndentedLine", ctx->buf+ctx->pos)); + return 1; + l1332:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "NonblankIndentedLine", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Line(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Line")); if (!yy_RawLine(ctx)) goto l1334; yyDo(ctx, yy_1_Line, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Line", ctx->buf+ctx->pos)); + return 1; + l1334:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Line", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_BlockQuoteRaw(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "BlockQuoteRaw")); if (!yy_StartList(ctx)) goto l1335; yyDo(ctx, yySet, -1, 0); if (!yymatchChar(ctx, '>')) goto l1335; + { int yypos1338= ctx->pos, yythunkpos1338= ctx->thunkpos; if (!yymatchChar(ctx, ' ')) goto l1338; goto l1339; + l1338:; ctx->pos= yypos1338; ctx->thunkpos= yythunkpos1338; + } + l1339:; if (!yy_Line(ctx)) goto l1335; yyDo(ctx, yy_1_BlockQuoteRaw, ctx->begin, ctx->end); + l1340:; + { int yypos1341= ctx->pos, yythunkpos1341= ctx->thunkpos; + { int yypos1342= ctx->pos, yythunkpos1342= ctx->thunkpos; if (!yymatchChar(ctx, '>')) goto l1342; goto l1341; + l1342:; ctx->pos= yypos1342; ctx->thunkpos= yythunkpos1342; + } + { int yypos1343= ctx->pos, yythunkpos1343= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1343; goto l1341; + l1343:; ctx->pos= yypos1343; ctx->thunkpos= yythunkpos1343; + } if (!yy_Line(ctx)) goto l1341; yyDo(ctx, yy_2_BlockQuoteRaw, ctx->begin, ctx->end); goto l1340; + l1341:; ctx->pos= yypos1341; ctx->thunkpos= yythunkpos1341; + } + l1344:; + { int yypos1345= ctx->pos, yythunkpos1345= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1345; yyDo(ctx, yy_3_BlockQuoteRaw, ctx->begin, ctx->end); goto l1344; + l1345:; ctx->pos= yypos1345; ctx->thunkpos= yythunkpos1345; + } + l1336:; + { int yypos1337= ctx->pos, yythunkpos1337= ctx->thunkpos; if (!yymatchChar(ctx, '>')) goto l1337; + { int yypos1346= ctx->pos, yythunkpos1346= ctx->thunkpos; if (!yymatchChar(ctx, ' ')) goto l1346; goto l1347; + l1346:; ctx->pos= yypos1346; ctx->thunkpos= yythunkpos1346; + } + l1347:; if (!yy_Line(ctx)) goto l1337; yyDo(ctx, yy_1_BlockQuoteRaw, ctx->begin, ctx->end); + l1348:; + { int yypos1349= ctx->pos, yythunkpos1349= ctx->thunkpos; + { int yypos1350= ctx->pos, yythunkpos1350= ctx->thunkpos; if (!yymatchChar(ctx, '>')) goto l1350; goto l1349; + l1350:; ctx->pos= yypos1350; ctx->thunkpos= yythunkpos1350; + } + { int yypos1351= ctx->pos, yythunkpos1351= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1351; goto l1349; + l1351:; ctx->pos= yypos1351; ctx->thunkpos= yythunkpos1351; + } if (!yy_Line(ctx)) goto l1349; yyDo(ctx, yy_2_BlockQuoteRaw, ctx->begin, ctx->end); goto l1348; + l1349:; ctx->pos= yypos1349; ctx->thunkpos= yythunkpos1349; + } + l1352:; + { int yypos1353= ctx->pos, yythunkpos1353= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1353; yyDo(ctx, yy_3_BlockQuoteRaw, ctx->begin, ctx->end); goto l1352; + l1353:; ctx->pos= yypos1353; ctx->thunkpos= yythunkpos1353; + } goto l1336; + l1337:; ctx->pos= yypos1337; ctx->thunkpos= yythunkpos1337; + } yyDo(ctx, yy_4_BlockQuoteRaw, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "BlockQuoteRaw", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l1335:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "BlockQuoteRaw", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Endline(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Endline")); + { int yypos1355= ctx->pos, yythunkpos1355= ctx->thunkpos; if (!yy_LineBreak(ctx)) goto l1356; goto l1355; + l1356:; ctx->pos= yypos1355; ctx->thunkpos= yythunkpos1355; if (!yy_TerminalEndline(ctx)) goto l1357; goto l1355; + l1357:; ctx->pos= yypos1355; ctx->thunkpos= yythunkpos1355; if (!yy_NormalEndline(ctx)) goto l1354; + } + l1355:; + yyprintf((stderr, " ok %s @ %s\n", "Endline", ctx->buf+ctx->pos)); + return 1; + l1354:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Endline", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_RawLine(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "RawLine")); + { int yypos1359= ctx->pos, yythunkpos1359= ctx->thunkpos; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l1360; + l1361:; + { int yypos1362= ctx->pos, yythunkpos1362= ctx->thunkpos; + { int yypos1363= ctx->pos, yythunkpos1363= ctx->thunkpos; if (!yymatchChar(ctx, '\r')) goto l1363; goto l1362; + l1363:; ctx->pos= yypos1363; ctx->thunkpos= yythunkpos1363; + } + { int yypos1364= ctx->pos, yythunkpos1364= ctx->thunkpos; if (!yymatchChar(ctx, '\n')) goto l1364; goto l1362; + l1364:; ctx->pos= yypos1364; ctx->thunkpos= yythunkpos1364; + } if (!yymatchDot(ctx)) goto l1362; goto l1361; + l1362:; ctx->pos= yypos1362; ctx->thunkpos= yythunkpos1362; + } if (!yy_Newline(ctx)) goto l1360; yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l1360; goto l1359; + l1360:; ctx->pos= yypos1359; ctx->thunkpos= yythunkpos1359; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l1358; if (!yymatchDot(ctx)) goto l1358; + l1365:; + { int yypos1366= ctx->pos, yythunkpos1366= ctx->thunkpos; if (!yymatchDot(ctx)) goto l1366; goto l1365; + l1366:; ctx->pos= yypos1366; ctx->thunkpos= yythunkpos1366; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l1358; if (!yy_Eof(ctx)) goto l1358; + } + l1359:; + yyprintf((stderr, " ok %s @ %s\n", "RawLine", ctx->buf+ctx->pos)); + return 1; + l1358:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "RawLine", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_SetextBottom2(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "SetextBottom2")); if (!yymatchChar(ctx, '-')) goto l1367; + l1368:; + { int yypos1369= ctx->pos, yythunkpos1369= ctx->thunkpos; if (!yymatchChar(ctx, '-')) goto l1369; goto l1368; + l1369:; ctx->pos= yypos1369; ctx->thunkpos= yythunkpos1369; + } if (!yy_Newline(ctx)) goto l1367; + yyprintf((stderr, " ok %s @ %s\n", "SetextBottom2", ctx->buf+ctx->pos)); + return 1; + l1367:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "SetextBottom2", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_SetextBottom1(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "SetextBottom1")); if (!yymatchChar(ctx, '=')) goto l1370; + l1371:; + { int yypos1372= ctx->pos, yythunkpos1372= ctx->thunkpos; if (!yymatchChar(ctx, '=')) goto l1372; goto l1371; + l1372:; ctx->pos= yypos1372; ctx->thunkpos= yythunkpos1372; + } if (!yy_Newline(ctx)) goto l1370; + yyprintf((stderr, " ok %s @ %s\n", "SetextBottom1", ctx->buf+ctx->pos)); + return 1; + l1370:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "SetextBottom1", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_SetextHeading2(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "SetextHeading2")); + { int yypos1374= ctx->pos, yythunkpos1374= ctx->thunkpos; if (!yy_RawLine(ctx)) goto l1373; if (!yy_SetextBottom2(ctx)) goto l1373; ctx->pos= yypos1374; ctx->thunkpos= yythunkpos1374; + } if (!yy_StartList(ctx)) goto l1373; yyDo(ctx, yySet, -1, 0); + { int yypos1377= ctx->pos, yythunkpos1377= ctx->thunkpos; if (!yy_Endline(ctx)) goto l1377; goto l1373; + l1377:; ctx->pos= yypos1377; ctx->thunkpos= yythunkpos1377; + } if (!yy_Inline(ctx)) goto l1373; yyDo(ctx, yy_1_SetextHeading2, ctx->begin, ctx->end); + l1375:; + { int yypos1376= ctx->pos, yythunkpos1376= ctx->thunkpos; + { int yypos1378= ctx->pos, yythunkpos1378= ctx->thunkpos; if (!yy_Endline(ctx)) goto l1378; goto l1376; + l1378:; ctx->pos= yypos1378; ctx->thunkpos= yythunkpos1378; + } if (!yy_Inline(ctx)) goto l1376; yyDo(ctx, yy_1_SetextHeading2, ctx->begin, ctx->end); goto l1375; + l1376:; ctx->pos= yypos1376; ctx->thunkpos= yythunkpos1376; + } + { int yypos1379= ctx->pos, yythunkpos1379= ctx->thunkpos; if (!yy_Sp(ctx)) goto l1379; goto l1380; + l1379:; ctx->pos= yypos1379; ctx->thunkpos= yythunkpos1379; + } + l1380:; if (!yy_Newline(ctx)) goto l1373; if (!yy_SetextBottom2(ctx)) goto l1373; yyDo(ctx, yy_2_SetextHeading2, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "SetextHeading2", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l1373:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "SetextHeading2", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_SetextHeading1(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "SetextHeading1")); + { int yypos1382= ctx->pos, yythunkpos1382= ctx->thunkpos; if (!yy_RawLine(ctx)) goto l1381; if (!yy_SetextBottom1(ctx)) goto l1381; ctx->pos= yypos1382; ctx->thunkpos= yythunkpos1382; + } if (!yy_StartList(ctx)) goto l1381; yyDo(ctx, yySet, -1, 0); + { int yypos1385= ctx->pos, yythunkpos1385= ctx->thunkpos; if (!yy_Endline(ctx)) goto l1385; goto l1381; + l1385:; ctx->pos= yypos1385; ctx->thunkpos= yythunkpos1385; + } if (!yy_Inline(ctx)) goto l1381; yyDo(ctx, yy_1_SetextHeading1, ctx->begin, ctx->end); + l1383:; + { int yypos1384= ctx->pos, yythunkpos1384= ctx->thunkpos; + { int yypos1386= ctx->pos, yythunkpos1386= ctx->thunkpos; if (!yy_Endline(ctx)) goto l1386; goto l1384; + l1386:; ctx->pos= yypos1386; ctx->thunkpos= yythunkpos1386; + } if (!yy_Inline(ctx)) goto l1384; yyDo(ctx, yy_1_SetextHeading1, ctx->begin, ctx->end); goto l1383; + l1384:; ctx->pos= yypos1384; ctx->thunkpos= yythunkpos1384; + } + { int yypos1387= ctx->pos, yythunkpos1387= ctx->thunkpos; if (!yy_Sp(ctx)) goto l1387; goto l1388; + l1387:; ctx->pos= yypos1387; ctx->thunkpos= yythunkpos1387; + } + l1388:; if (!yy_Newline(ctx)) goto l1381; if (!yy_SetextBottom1(ctx)) goto l1381; yyDo(ctx, yy_2_SetextHeading1, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "SetextHeading1", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l1381:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "SetextHeading1", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_SetextHeading(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "SetextHeading")); + { int yypos1390= ctx->pos, yythunkpos1390= ctx->thunkpos; if (!yy_SetextHeading1(ctx)) goto l1391; goto l1390; + l1391:; ctx->pos= yypos1390; ctx->thunkpos= yythunkpos1390; if (!yy_SetextHeading2(ctx)) goto l1389; + } + l1390:; + yyprintf((stderr, " ok %s @ %s\n", "SetextHeading", ctx->buf+ctx->pos)); + return 1; + l1389:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "SetextHeading", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_AtxHeading(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 2, 0); + yyprintf((stderr, "%s\n", "AtxHeading")); if (!yy_AtxStart(ctx)) goto l1392; yyDo(ctx, yySet, -2, 0); + { int yypos1393= ctx->pos, yythunkpos1393= ctx->thunkpos; if (!yy_Sp(ctx)) goto l1393; goto l1394; + l1393:; ctx->pos= yypos1393; ctx->thunkpos= yythunkpos1393; + } + l1394:; if (!yy_StartList(ctx)) goto l1392; yyDo(ctx, yySet, -1, 0); if (!yy_AtxInline(ctx)) goto l1392; yyDo(ctx, yy_1_AtxHeading, ctx->begin, ctx->end); + l1395:; + { int yypos1396= ctx->pos, yythunkpos1396= ctx->thunkpos; if (!yy_AtxInline(ctx)) goto l1396; yyDo(ctx, yy_1_AtxHeading, ctx->begin, ctx->end); goto l1395; + l1396:; ctx->pos= yypos1396; ctx->thunkpos= yythunkpos1396; + } + { int yypos1397= ctx->pos, yythunkpos1397= ctx->thunkpos; + { int yypos1399= ctx->pos, yythunkpos1399= ctx->thunkpos; if (!yy_Sp(ctx)) goto l1399; goto l1400; + l1399:; ctx->pos= yypos1399; ctx->thunkpos= yythunkpos1399; + } + l1400:; + l1401:; + { int yypos1402= ctx->pos, yythunkpos1402= ctx->thunkpos; if (!yymatchChar(ctx, '#')) goto l1402; goto l1401; + l1402:; ctx->pos= yypos1402; ctx->thunkpos= yythunkpos1402; + } if (!yy_Sp(ctx)) goto l1397; goto l1398; + l1397:; ctx->pos= yypos1397; ctx->thunkpos= yythunkpos1397; + } + l1398:; if (!yy_Newline(ctx)) goto l1392; yyDo(ctx, yy_2_AtxHeading, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "AtxHeading", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 2, 0); + return 1; + l1392:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "AtxHeading", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_AtxStart(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "AtxStart")); yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l1403; + { int yypos1404= ctx->pos, yythunkpos1404= ctx->thunkpos; if (!yymatchString(ctx, "######")) goto l1405; goto l1404; + l1405:; ctx->pos= yypos1404; ctx->thunkpos= yythunkpos1404; if (!yymatchString(ctx, "#####")) goto l1406; goto l1404; + l1406:; ctx->pos= yypos1404; ctx->thunkpos= yythunkpos1404; if (!yymatchString(ctx, "####")) goto l1407; goto l1404; + l1407:; ctx->pos= yypos1404; ctx->thunkpos= yythunkpos1404; if (!yymatchString(ctx, "###")) goto l1408; goto l1404; + l1408:; ctx->pos= yypos1404; ctx->thunkpos= yythunkpos1404; if (!yymatchString(ctx, "##")) goto l1409; goto l1404; + l1409:; ctx->pos= yypos1404; ctx->thunkpos= yythunkpos1404; if (!yymatchChar(ctx, '#')) goto l1403; + } + l1404:; yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l1403; yyDo(ctx, yy_1_AtxStart, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "AtxStart", ctx->buf+ctx->pos)); + return 1; + l1403:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "AtxStart", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Inline(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Inline")); + { int yypos1411= ctx->pos, yythunkpos1411= ctx->thunkpos; if (!yy_Str(ctx)) goto l1412; goto l1411; + l1412:; ctx->pos= yypos1411; ctx->thunkpos= yythunkpos1411; if (!yy_Endline(ctx)) goto l1413; goto l1411; + l1413:; ctx->pos= yypos1411; ctx->thunkpos= yythunkpos1411; if (!yy_UlOrStarLine(ctx)) goto l1414; goto l1411; + l1414:; ctx->pos= yypos1411; ctx->thunkpos= yythunkpos1411; if (!yy_Space(ctx)) goto l1415; goto l1411; + l1415:; ctx->pos= yypos1411; ctx->thunkpos= yythunkpos1411; if (!yy_Strong(ctx)) goto l1416; goto l1411; + l1416:; ctx->pos= yypos1411; ctx->thunkpos= yythunkpos1411; if (!yy_Emph(ctx)) goto l1417; goto l1411; + l1417:; ctx->pos= yypos1411; ctx->thunkpos= yythunkpos1411; if (!yy_Image(ctx)) goto l1418; goto l1411; + l1418:; ctx->pos= yypos1411; ctx->thunkpos= yythunkpos1411; if (!yy_Link(ctx)) goto l1419; goto l1411; + l1419:; ctx->pos= yypos1411; ctx->thunkpos= yythunkpos1411; if (!yy_NoteReference(ctx)) goto l1420; goto l1411; + l1420:; ctx->pos= yypos1411; ctx->thunkpos= yythunkpos1411; if (!yy_InlineNote(ctx)) goto l1421; goto l1411; + l1421:; ctx->pos= yypos1411; ctx->thunkpos= yythunkpos1411; if (!yy_Code(ctx)) goto l1422; goto l1411; + l1422:; ctx->pos= yypos1411; ctx->thunkpos= yythunkpos1411; if (!yy_RawHtml(ctx)) goto l1423; goto l1411; + l1423:; ctx->pos= yypos1411; ctx->thunkpos= yythunkpos1411; if (!yy_Entity(ctx)) goto l1424; goto l1411; + l1424:; ctx->pos= yypos1411; ctx->thunkpos= yythunkpos1411; if (!yy_EscapedChar(ctx)) goto l1425; goto l1411; + l1425:; ctx->pos= yypos1411; ctx->thunkpos= yythunkpos1411; if (!yy_Smart(ctx)) goto l1426; goto l1411; + l1426:; ctx->pos= yypos1411; ctx->thunkpos= yythunkpos1411; if (!yy_Symbol(ctx)) goto l1410; + } + l1411:; + yyprintf((stderr, " ok %s @ %s\n", "Inline", ctx->buf+ctx->pos)); + return 1; + l1410:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Inline", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Sp(yycontext *ctx) +{ + yyprintf((stderr, "%s\n", "Sp")); + l1428:; + { int yypos1429= ctx->pos, yythunkpos1429= ctx->thunkpos; if (!yy_Spacechar(ctx)) goto l1429; goto l1428; + l1429:; ctx->pos= yypos1429; ctx->thunkpos= yythunkpos1429; + } + yyprintf((stderr, " ok %s @ %s\n", "Sp", ctx->buf+ctx->pos)); + return 1; +} +YY_RULE(int) yy_Newline(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Newline")); + { int yypos1431= ctx->pos, yythunkpos1431= ctx->thunkpos; if (!yymatchChar(ctx, '\n')) goto l1432; goto l1431; + l1432:; ctx->pos= yypos1431; ctx->thunkpos= yythunkpos1431; if (!yymatchChar(ctx, '\r')) goto l1430; + { int yypos1433= ctx->pos, yythunkpos1433= ctx->thunkpos; if (!yymatchChar(ctx, '\n')) goto l1433; goto l1434; + l1433:; ctx->pos= yypos1433; ctx->thunkpos= yythunkpos1433; + } + l1434:; + } + l1431:; + yyprintf((stderr, " ok %s @ %s\n", "Newline", ctx->buf+ctx->pos)); + return 1; + l1430:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Newline", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_AtxInline(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "AtxInline")); + { int yypos1436= ctx->pos, yythunkpos1436= ctx->thunkpos; if (!yy_Newline(ctx)) goto l1436; goto l1435; + l1436:; ctx->pos= yypos1436; ctx->thunkpos= yythunkpos1436; + } + { int yypos1437= ctx->pos, yythunkpos1437= ctx->thunkpos; + { int yypos1438= ctx->pos, yythunkpos1438= ctx->thunkpos; if (!yy_Sp(ctx)) goto l1438; goto l1439; + l1438:; ctx->pos= yypos1438; ctx->thunkpos= yythunkpos1438; + } + l1439:; + l1440:; + { int yypos1441= ctx->pos, yythunkpos1441= ctx->thunkpos; if (!yymatchChar(ctx, '#')) goto l1441; goto l1440; + l1441:; ctx->pos= yypos1441; ctx->thunkpos= yythunkpos1441; + } if (!yy_Sp(ctx)) goto l1437; if (!yy_Newline(ctx)) goto l1437; goto l1435; + l1437:; ctx->pos= yypos1437; ctx->thunkpos= yythunkpos1437; + } if (!yy_Inline(ctx)) goto l1435; + yyprintf((stderr, " ok %s @ %s\n", "AtxInline", ctx->buf+ctx->pos)); + return 1; + l1435:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "AtxInline", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Inlines(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 2, 0); + yyprintf((stderr, "%s\n", "Inlines")); if (!yy_StartList(ctx)) goto l1442; yyDo(ctx, yySet, -2, 0); + { int yypos1445= ctx->pos, yythunkpos1445= ctx->thunkpos; + { int yypos1447= ctx->pos, yythunkpos1447= ctx->thunkpos; if (!yy_Endline(ctx)) goto l1447; goto l1446; + l1447:; ctx->pos= yypos1447; ctx->thunkpos= yythunkpos1447; + } if (!yy_Inline(ctx)) goto l1446; yyDo(ctx, yy_1_Inlines, ctx->begin, ctx->end); goto l1445; + l1446:; ctx->pos= yypos1445; ctx->thunkpos= yythunkpos1445; if (!yy_Endline(ctx)) goto l1442; yyDo(ctx, yySet, -1, 0); + { int yypos1448= ctx->pos, yythunkpos1448= ctx->thunkpos; if (!yy_Inline(ctx)) goto l1442; ctx->pos= yypos1448; ctx->thunkpos= yythunkpos1448; + } yyDo(ctx, yy_2_Inlines, ctx->begin, ctx->end); + } + l1445:; + l1443:; + { int yypos1444= ctx->pos, yythunkpos1444= ctx->thunkpos; + { int yypos1449= ctx->pos, yythunkpos1449= ctx->thunkpos; + { int yypos1451= ctx->pos, yythunkpos1451= ctx->thunkpos; if (!yy_Endline(ctx)) goto l1451; goto l1450; + l1451:; ctx->pos= yypos1451; ctx->thunkpos= yythunkpos1451; + } if (!yy_Inline(ctx)) goto l1450; yyDo(ctx, yy_1_Inlines, ctx->begin, ctx->end); goto l1449; + l1450:; ctx->pos= yypos1449; ctx->thunkpos= yythunkpos1449; if (!yy_Endline(ctx)) goto l1444; yyDo(ctx, yySet, -1, 0); + { int yypos1452= ctx->pos, yythunkpos1452= ctx->thunkpos; if (!yy_Inline(ctx)) goto l1444; ctx->pos= yypos1452; ctx->thunkpos= yythunkpos1452; + } yyDo(ctx, yy_2_Inlines, ctx->begin, ctx->end); + } + l1449:; goto l1443; + l1444:; ctx->pos= yypos1444; ctx->thunkpos= yythunkpos1444; + } + { int yypos1453= ctx->pos, yythunkpos1453= ctx->thunkpos; if (!yy_Endline(ctx)) goto l1453; goto l1454; + l1453:; ctx->pos= yypos1453; ctx->thunkpos= yythunkpos1453; + } + l1454:; yyDo(ctx, yy_3_Inlines, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Inlines", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 2, 0); + return 1; + l1442:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Inlines", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_NonindentSpace(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "NonindentSpace")); + { int yypos1456= ctx->pos, yythunkpos1456= ctx->thunkpos; if (!yymatchString(ctx, " ")) goto l1457; goto l1456; + l1457:; ctx->pos= yypos1456; ctx->thunkpos= yythunkpos1456; if (!yymatchString(ctx, " ")) goto l1458; goto l1456; + l1458:; ctx->pos= yypos1456; ctx->thunkpos= yythunkpos1456; if (!yymatchChar(ctx, ' ')) goto l1459; goto l1456; + l1459:; ctx->pos= yypos1456; ctx->thunkpos= yythunkpos1456; if (!yymatchString(ctx, "")) goto l1455; + } + l1456:; + yyprintf((stderr, " ok %s @ %s\n", "NonindentSpace", ctx->buf+ctx->pos)); + return 1; + l1455:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "NonindentSpace", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Plain(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "Plain")); if (!yy_Inlines(ctx)) goto l1460; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_Plain, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Plain", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l1460:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Plain", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Para(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "Para")); if (!yy_NonindentSpace(ctx)) goto l1461; if (!yy_Inlines(ctx)) goto l1461; yyDo(ctx, yySet, -1, 0); if (!yy_BlankLine(ctx)) goto l1461; + l1462:; + { int yypos1463= ctx->pos, yythunkpos1463= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1463; goto l1462; + l1463:; ctx->pos= yypos1463; ctx->thunkpos= yythunkpos1463; + } yyDo(ctx, yy_1_Para, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Para", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l1461:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Para", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_StyleBlock(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "StyleBlock")); yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l1464; if (!yy_InStyleTags(ctx)) goto l1464; yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l1464; + l1465:; + { int yypos1466= ctx->pos, yythunkpos1466= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1466; goto l1465; + l1466:; ctx->pos= yypos1466; ctx->thunkpos= yythunkpos1466; + } yyDo(ctx, yy_1_StyleBlock, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "StyleBlock", ctx->buf+ctx->pos)); + return 1; + l1464:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "StyleBlock", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HtmlBlock(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HtmlBlock")); yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l1467; + { int yypos1468= ctx->pos, yythunkpos1468= ctx->thunkpos; if (!yy_HtmlBlockInTags(ctx)) goto l1469; goto l1468; + l1469:; ctx->pos= yypos1468; ctx->thunkpos= yythunkpos1468; if (!yy_HtmlComment(ctx)) goto l1470; goto l1468; + l1470:; ctx->pos= yypos1468; ctx->thunkpos= yythunkpos1468; if (!yy_HtmlBlockSelfClosing(ctx)) goto l1467; + } + l1468:; yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l1467; if (!yy_BlankLine(ctx)) goto l1467; + l1471:; + { int yypos1472= ctx->pos, yythunkpos1472= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1472; goto l1471; + l1472:; ctx->pos= yypos1472; ctx->thunkpos= yythunkpos1472; + } yyDo(ctx, yy_1_HtmlBlock, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "HtmlBlock", ctx->buf+ctx->pos)); + return 1; + l1467:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HtmlBlock", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_BulletList(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "BulletList")); + { int yypos1474= ctx->pos, yythunkpos1474= ctx->thunkpos; if (!yy_Bullet(ctx)) goto l1473; ctx->pos= yypos1474; ctx->thunkpos= yythunkpos1474; + } + { int yypos1475= ctx->pos, yythunkpos1475= ctx->thunkpos; if (!yy_ListTight(ctx)) goto l1476; goto l1475; + l1476:; ctx->pos= yypos1475; ctx->thunkpos= yythunkpos1475; if (!yy_ListLoose(ctx)) goto l1473; + } + l1475:; yyDo(ctx, yy_1_BulletList, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "BulletList", ctx->buf+ctx->pos)); + return 1; + l1473:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "BulletList", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_OrderedList(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "OrderedList")); + { int yypos1478= ctx->pos, yythunkpos1478= ctx->thunkpos; if (!yy_Enumerator(ctx)) goto l1477; ctx->pos= yypos1478; ctx->thunkpos= yythunkpos1478; + } + { int yypos1479= ctx->pos, yythunkpos1479= ctx->thunkpos; if (!yy_ListTight(ctx)) goto l1480; goto l1479; + l1480:; ctx->pos= yypos1479; ctx->thunkpos= yythunkpos1479; if (!yy_ListLoose(ctx)) goto l1477; + } + l1479:; yyDo(ctx, yy_1_OrderedList, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "OrderedList", ctx->buf+ctx->pos)); + return 1; + l1477:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "OrderedList", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Heading(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Heading")); + { int yypos1482= ctx->pos, yythunkpos1482= ctx->thunkpos; if (!yy_SetextHeading(ctx)) goto l1483; goto l1482; + l1483:; ctx->pos= yypos1482; ctx->thunkpos= yythunkpos1482; if (!yy_AtxHeading(ctx)) goto l1481; + } + l1482:; + yyprintf((stderr, " ok %s @ %s\n", "Heading", ctx->buf+ctx->pos)); + return 1; + l1481:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Heading", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_HorizontalRule(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "HorizontalRule")); if (!yy_NonindentSpace(ctx)) goto l1484; + { int yypos1485= ctx->pos, yythunkpos1485= ctx->thunkpos; if (!yymatchChar(ctx, '*')) goto l1486; if (!yy_Sp(ctx)) goto l1486; if (!yymatchChar(ctx, '*')) goto l1486; if (!yy_Sp(ctx)) goto l1486; if (!yymatchChar(ctx, '*')) goto l1486; + l1487:; + { int yypos1488= ctx->pos, yythunkpos1488= ctx->thunkpos; if (!yy_Sp(ctx)) goto l1488; if (!yymatchChar(ctx, '*')) goto l1488; goto l1487; + l1488:; ctx->pos= yypos1488; ctx->thunkpos= yythunkpos1488; + } goto l1485; + l1486:; ctx->pos= yypos1485; ctx->thunkpos= yythunkpos1485; if (!yymatchChar(ctx, '-')) goto l1489; if (!yy_Sp(ctx)) goto l1489; if (!yymatchChar(ctx, '-')) goto l1489; if (!yy_Sp(ctx)) goto l1489; if (!yymatchChar(ctx, '-')) goto l1489; + l1490:; + { int yypos1491= ctx->pos, yythunkpos1491= ctx->thunkpos; if (!yy_Sp(ctx)) goto l1491; if (!yymatchChar(ctx, '-')) goto l1491; goto l1490; + l1491:; ctx->pos= yypos1491; ctx->thunkpos= yythunkpos1491; + } goto l1485; + l1489:; ctx->pos= yypos1485; ctx->thunkpos= yythunkpos1485; if (!yymatchChar(ctx, '_')) goto l1484; if (!yy_Sp(ctx)) goto l1484; if (!yymatchChar(ctx, '_')) goto l1484; if (!yy_Sp(ctx)) goto l1484; if (!yymatchChar(ctx, '_')) goto l1484; + l1492:; + { int yypos1493= ctx->pos, yythunkpos1493= ctx->thunkpos; if (!yy_Sp(ctx)) goto l1493; if (!yymatchChar(ctx, '_')) goto l1493; goto l1492; + l1493:; ctx->pos= yypos1493; ctx->thunkpos= yythunkpos1493; + } + } + l1485:; if (!yy_Sp(ctx)) goto l1484; if (!yy_Newline(ctx)) goto l1484; if (!yy_BlankLine(ctx)) goto l1484; + l1494:; + { int yypos1495= ctx->pos, yythunkpos1495= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1495; goto l1494; + l1495:; ctx->pos= yypos1495; ctx->thunkpos= yythunkpos1495; + } yyDo(ctx, yy_1_HorizontalRule, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "HorizontalRule", ctx->buf+ctx->pos)); + return 1; + l1484:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "HorizontalRule", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Reference(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 3, 0); + yyprintf((stderr, "%s\n", "Reference")); if (!yy_NonindentSpace(ctx)) goto l1496; + { int yypos1497= ctx->pos, yythunkpos1497= ctx->thunkpos; if (!yymatchString(ctx, "[]")) goto l1497; goto l1496; + l1497:; ctx->pos= yypos1497; ctx->thunkpos= yythunkpos1497; + } if (!yy_Label(ctx)) goto l1496; yyDo(ctx, yySet, -3, 0); if (!yymatchChar(ctx, ':')) goto l1496; if (!yy_Spnl(ctx)) goto l1496; if (!yy_RefSrc(ctx)) goto l1496; yyDo(ctx, yySet, -2, 0); if (!yy_RefTitle(ctx)) goto l1496; yyDo(ctx, yySet, -1, 0); if (!yy_BlankLine(ctx)) goto l1496; + l1498:; + { int yypos1499= ctx->pos, yythunkpos1499= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1499; goto l1498; + l1499:; ctx->pos= yypos1499; ctx->thunkpos= yythunkpos1499; + } yyDo(ctx, yy_1_Reference, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Reference", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 3, 0); + return 1; + l1496:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Reference", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Note(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 2, 0); + yyprintf((stderr, "%s\n", "Note")); yyText(ctx, ctx->begin, ctx->end); if (!( extension(EXT_NOTES) )) goto l1500; if (!yy_NonindentSpace(ctx)) goto l1500; if (!yy_RawNoteReference(ctx)) goto l1500; yyDo(ctx, yySet, -2, 0); if (!yymatchChar(ctx, ':')) goto l1500; if (!yy_Sp(ctx)) goto l1500; if (!yy_StartList(ctx)) goto l1500; yyDo(ctx, yySet, -1, 0); if (!yy_RawNoteBlock(ctx)) goto l1500; yyDo(ctx, yy_1_Note, ctx->begin, ctx->end); + l1501:; + { int yypos1502= ctx->pos, yythunkpos1502= ctx->thunkpos; + { int yypos1503= ctx->pos, yythunkpos1503= ctx->thunkpos; if (!yy_Indent(ctx)) goto l1502; ctx->pos= yypos1503; ctx->thunkpos= yythunkpos1503; + } if (!yy_RawNoteBlock(ctx)) goto l1502; yyDo(ctx, yy_2_Note, ctx->begin, ctx->end); goto l1501; + l1502:; ctx->pos= yypos1502; ctx->thunkpos= yythunkpos1502; + } yyDo(ctx, yy_3_Note, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Note", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 2, 0); + return 1; + l1500:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Note", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Verbatim(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "Verbatim")); if (!yy_StartList(ctx)) goto l1504; yyDo(ctx, yySet, -1, 0); if (!yy_VerbatimChunk(ctx)) goto l1504; yyDo(ctx, yy_1_Verbatim, ctx->begin, ctx->end); + l1505:; + { int yypos1506= ctx->pos, yythunkpos1506= ctx->thunkpos; if (!yy_VerbatimChunk(ctx)) goto l1506; yyDo(ctx, yy_1_Verbatim, ctx->begin, ctx->end); goto l1505; + l1506:; ctx->pos= yypos1506; ctx->thunkpos= yythunkpos1506; + } yyDo(ctx, yy_2_Verbatim, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Verbatim", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l1504:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Verbatim", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_BlockQuote(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "BlockQuote")); if (!yy_BlockQuoteRaw(ctx)) goto l1507; yyDo(ctx, yySet, -1, 0); yyDo(ctx, yy_1_BlockQuote, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "BlockQuote", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l1507:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "BlockQuote", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_BlankLine(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "BlankLine")); if (!yy_Sp(ctx)) goto l1508; if (!yy_Newline(ctx)) goto l1508; + yyprintf((stderr, " ok %s @ %s\n", "BlankLine", ctx->buf+ctx->pos)); + return 1; + l1508:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "BlankLine", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Block(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "Block")); + l1510:; + { int yypos1511= ctx->pos, yythunkpos1511= ctx->thunkpos; if (!yy_BlankLine(ctx)) goto l1511; goto l1510; + l1511:; ctx->pos= yypos1511; ctx->thunkpos= yythunkpos1511; + } + { int yypos1512= ctx->pos, yythunkpos1512= ctx->thunkpos; if (!yy_BlockQuote(ctx)) goto l1513; goto l1512; + l1513:; ctx->pos= yypos1512; ctx->thunkpos= yythunkpos1512; if (!yy_Verbatim(ctx)) goto l1514; goto l1512; + l1514:; ctx->pos= yypos1512; ctx->thunkpos= yythunkpos1512; if (!yy_Note(ctx)) goto l1515; goto l1512; + l1515:; ctx->pos= yypos1512; ctx->thunkpos= yythunkpos1512; if (!yy_Reference(ctx)) goto l1516; goto l1512; + l1516:; ctx->pos= yypos1512; ctx->thunkpos= yythunkpos1512; if (!yy_HorizontalRule(ctx)) goto l1517; goto l1512; + l1517:; ctx->pos= yypos1512; ctx->thunkpos= yythunkpos1512; if (!yy_Heading(ctx)) goto l1518; goto l1512; + l1518:; ctx->pos= yypos1512; ctx->thunkpos= yythunkpos1512; if (!yy_OrderedList(ctx)) goto l1519; goto l1512; + l1519:; ctx->pos= yypos1512; ctx->thunkpos= yythunkpos1512; if (!yy_BulletList(ctx)) goto l1520; goto l1512; + l1520:; ctx->pos= yypos1512; ctx->thunkpos= yythunkpos1512; if (!yy_HtmlBlock(ctx)) goto l1521; goto l1512; + l1521:; ctx->pos= yypos1512; ctx->thunkpos= yythunkpos1512; if (!yy_StyleBlock(ctx)) goto l1522; goto l1512; + l1522:; ctx->pos= yypos1512; ctx->thunkpos= yythunkpos1512; if (!yy_Para(ctx)) goto l1523; goto l1512; + l1523:; ctx->pos= yypos1512; ctx->thunkpos= yythunkpos1512; if (!yy_Plain(ctx)) goto l1509; + } + l1512:; + yyprintf((stderr, " ok %s @ %s\n", "Block", ctx->buf+ctx->pos)); + return 1; + l1509:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Block", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_StartList(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "StartList")); + { int yypos1525= ctx->pos, yythunkpos1525= ctx->thunkpos; if (!yymatchDot(ctx)) goto l1524; ctx->pos= yypos1525; ctx->thunkpos= yythunkpos1525; + } yyDo(ctx, yy_1_StartList, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "StartList", ctx->buf+ctx->pos)); + return 1; + l1524:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "StartList", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_BOM(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "BOM")); if (!yymatchString(ctx, "\357\273\277")) goto l1526; + yyprintf((stderr, " ok %s @ %s\n", "BOM", ctx->buf+ctx->pos)); + return 1; + l1526:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "BOM", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_Doc(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; yyDo(ctx, yyPush, 1, 0); + yyprintf((stderr, "%s\n", "Doc")); + { int yypos1528= ctx->pos, yythunkpos1528= ctx->thunkpos; if (!yy_BOM(ctx)) goto l1528; goto l1529; + l1528:; ctx->pos= yypos1528; ctx->thunkpos= yythunkpos1528; + } + l1529:; if (!yy_StartList(ctx)) goto l1527; yyDo(ctx, yySet, -1, 0); + l1530:; + { int yypos1531= ctx->pos, yythunkpos1531= ctx->thunkpos; if (!yy_Block(ctx)) goto l1531; yyDo(ctx, yy_1_Doc, ctx->begin, ctx->end); goto l1530; + l1531:; ctx->pos= yypos1531; ctx->thunkpos= yythunkpos1531; + } yyDo(ctx, yy_2_Doc, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "Doc", ctx->buf+ctx->pos)); yyDo(ctx, yyPop, 1, 0); + return 1; + l1527:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "Doc", ctx->buf+ctx->pos)); + return 0; +} + +#ifndef YY_PART + +typedef int (*yyrule)(yycontext *ctx); + +YY_PARSE(int) YYPARSEFROM(YY_CTX_PARAM_ yyrule yystart) +{ + int yyok; + if (!yyctx->buflen) + { + yyctx->buflen= 1024; + yyctx->buf= (char *)malloc(yyctx->buflen); + yyctx->textlen= 1024; + yyctx->text= (char *)malloc(yyctx->textlen); + yyctx->thunkslen= 32; + yyctx->thunks= (yythunk *)malloc(sizeof(yythunk) * yyctx->thunkslen); + yyctx->valslen= 32; + yyctx->vals= (YYSTYPE *)malloc(sizeof(YYSTYPE) * yyctx->valslen); + yyctx->begin= yyctx->end= yyctx->pos= yyctx->limit= yyctx->thunkpos= 0; + } + yyctx->begin= yyctx->end= yyctx->pos; + yyctx->thunkpos= 0; + yyctx->val= yyctx->vals; + yyok= yystart(yyctx); + if (yyok) yyDone(yyctx); + yyCommit(yyctx); + return yyok; +} + +YY_PARSE(int) YYPARSE(YY_CTX_PARAM) +{ + return YYPARSEFROM(YY_CTX_ARG_ yy_Doc); +} + +#endif + + + + diff --git a/supportlibs/pegmarkdown/markdown_parser.leg b/supportlibs/pegmarkdown/markdown_parser.leg new file mode 100644 index 000000000..cd1fc0b36 --- /dev/null +++ b/supportlibs/pegmarkdown/markdown_parser.leg @@ -0,0 +1,770 @@ +%{ +/********************************************************************** + + markdown_parser.leg - markdown parser in C using a PEG grammar. + (c) 2008 John MacFarlane (jgm at berkeley dot edu). + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License or the MIT + license. See LICENSE for details. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + ***********************************************************************/ + +#include +#include +#include "markdown_peg.h" +#include "utility_functions.h" + + + +/********************************************************************** + + Definitions for leg parser generator. + YY_INPUT is the function the parser calls to get new input. + We take all new input from (static) charbuf. + + ***********************************************************************/ + + + +# define YYSTYPE element * +#ifdef __DEBUG__ +# define YY_DEBUG 1 +#endif + +#define YY_INPUT(buf, result, max_size) \ +{ \ + int yyc; \ + if (charbuf && *charbuf != '\0') { \ + yyc= *charbuf++; \ + } else { \ + yyc= EOF; \ + } \ + result= (EOF == yyc) ? 0 : (*(buf)= yyc, 1); \ +} + +#define YY_RULE(T) T + + +/********************************************************************** + + PEG grammar and parser actions for markdown syntax. + + ***********************************************************************/ + +%} + +Doc = BOM? a:StartList ( Block { a = cons($$, a); } )* + { parse_result = reverse(a); } + +Block = BlankLine* + ( BlockQuote + | Verbatim + | Note + | Reference + | HorizontalRule + | Heading + | OrderedList + | BulletList + | HtmlBlock + | StyleBlock + | Para + | Plain ) + +Para = NonindentSpace a:Inlines BlankLine+ + { $$ = a; $$->key = PARA; } + +Plain = a:Inlines + { $$ = a; $$->key = PLAIN; } + +AtxInline = !Newline !(Sp? '#'* Sp Newline) Inline + +AtxStart = < ( "######" | "#####" | "####" | "###" | "##" | "#" ) > + { $$ = mk_element(H1 + (strlen(yytext) - 1)); } + +AtxHeading = s:AtxStart Sp? a:StartList ( AtxInline { a = cons($$, a); } )+ (Sp? '#'* Sp)? Newline + { $$ = mk_list(s->key, a); + free(s); } + +SetextHeading = SetextHeading1 | SetextHeading2 + +SetextBottom1 = '='+ Newline + +SetextBottom2 = '-'+ Newline + +SetextHeading1 = &(RawLine SetextBottom1) + a:StartList ( !Endline Inline { a = cons($$, a); } )+ Sp? Newline + SetextBottom1 { $$ = mk_list(H1, a); } + +SetextHeading2 = &(RawLine SetextBottom2) + a:StartList ( !Endline Inline { a = cons($$, a); } )+ Sp? Newline + SetextBottom2 { $$ = mk_list(H2, a); } + +Heading = SetextHeading | AtxHeading + +BlockQuote = a:BlockQuoteRaw + { $$ = mk_element(BLOCKQUOTE); + $$->children = a; + } + +BlockQuoteRaw = a:StartList + (( '>' ' '? Line { a = cons($$, a); } ) + ( !'>' !BlankLine Line { a = cons($$, a); } )* + ( BlankLine { a = cons(mk_str("\n"), a); } )* + )+ + { $$ = mk_str_from_list(a, true); + $$->key = RAW; + } + +NonblankIndentedLine = !BlankLine IndentedLine + +VerbatimChunk = a:StartList + ( BlankLine { a = cons(mk_str("\n"), a); } )* + ( NonblankIndentedLine { a = cons($$, a); } )+ + { $$ = mk_str_from_list(a, false); } + +Verbatim = a:StartList ( VerbatimChunk { a = cons($$, a); } )+ + { $$ = mk_str_from_list(a, false); + $$->key = VERBATIM; } + +HorizontalRule = NonindentSpace + ( '*' Sp '*' Sp '*' (Sp '*')* + | '-' Sp '-' Sp '-' (Sp '-')* + | '_' Sp '_' Sp '_' (Sp '_')*) + Sp Newline BlankLine+ + { $$ = mk_element(HRULE); } + +Bullet = !HorizontalRule NonindentSpace ('+' | '*' | '-') Spacechar+ + +BulletList = &Bullet (ListTight | ListLoose) + { $$->key = BULLETLIST; } + +ListTight = a:StartList + ( ListItemTight { a = cons($$, a); } )+ + BlankLine* !(Bullet | Enumerator) + { $$ = mk_list(LIST, a); } + +ListLoose = a:StartList + ( b:ListItem BlankLine* + { element *li; + li = b->children; + li->contents.str = realloc(li->contents.str, strlen(li->contents.str) + 3); + strcat(li->contents.str, "\n\n"); /* In loose list, \n\n added to end of each element */ + a = cons(b, a); + } )+ + { $$ = mk_list(LIST, a); } + +ListItem = ( Bullet | Enumerator ) + a:StartList + ListBlock { a = cons($$, a); } + ( ListContinuationBlock { a = cons($$, a); } )* + { element *raw; + raw = mk_str_from_list(a, false); + raw->key = RAW; + $$ = mk_element(LISTITEM); + $$->children = raw; + } + +ListItemTight = + ( Bullet | Enumerator ) + a:StartList + ListBlock { a = cons($$, a); } + ( !BlankLine + ListContinuationBlock { a = cons($$, a); } )* + !ListContinuationBlock + { element *raw; + raw = mk_str_from_list(a, false); + raw->key = RAW; + $$ = mk_element(LISTITEM); + $$->children = raw; + } + +ListBlock = a:StartList + !BlankLine Line { a = cons($$, a); } + ( ListBlockLine { a = cons($$, a); } )* + { $$ = mk_str_from_list(a, false); } + +ListContinuationBlock = a:StartList + ( < BlankLine* > + { if (strlen(yytext) == 0) + a = cons(mk_str("\001"), a); /* block separator */ + else + a = cons(mk_str(yytext), a); } ) + ( Indent ListBlock { a = cons($$, a); } )+ + { $$ = mk_str_from_list(a, false); } + +Enumerator = NonindentSpace [0-9]+ '.' Spacechar+ + +OrderedList = &Enumerator (ListTight | ListLoose) + { $$->key = ORDEREDLIST; } + +ListBlockLine = !BlankLine + !( Indent? (Bullet | Enumerator) ) + !HorizontalRule + OptionallyIndentedLine + +# Parsers for different kinds of block-level HTML content. +# This is repetitive due to constraints of PEG grammar. + +HtmlBlockOpenAddress = '<' Spnl ("address" | "ADDRESS") Spnl HtmlAttribute* '>' +HtmlBlockCloseAddress = '<' Spnl '/' ("address" | "ADDRESS") Spnl '>' +HtmlBlockAddress = HtmlBlockOpenAddress (HtmlBlockAddress | !HtmlBlockCloseAddress .)* HtmlBlockCloseAddress + +HtmlBlockOpenBlockquote = '<' Spnl ("blockquote" | "BLOCKQUOTE") Spnl HtmlAttribute* '>' +HtmlBlockCloseBlockquote = '<' Spnl '/' ("blockquote" | "BLOCKQUOTE") Spnl '>' +HtmlBlockBlockquote = HtmlBlockOpenBlockquote (HtmlBlockBlockquote | !HtmlBlockCloseBlockquote .)* HtmlBlockCloseBlockquote + +HtmlBlockOpenCenter = '<' Spnl ("center" | "CENTER") Spnl HtmlAttribute* '>' +HtmlBlockCloseCenter = '<' Spnl '/' ("center" | "CENTER") Spnl '>' +HtmlBlockCenter = HtmlBlockOpenCenter (HtmlBlockCenter | !HtmlBlockCloseCenter .)* HtmlBlockCloseCenter + +HtmlBlockOpenDir = '<' Spnl ("dir" | "DIR") Spnl HtmlAttribute* '>' +HtmlBlockCloseDir = '<' Spnl '/' ("dir" | "DIR") Spnl '>' +HtmlBlockDir = HtmlBlockOpenDir (HtmlBlockDir | !HtmlBlockCloseDir .)* HtmlBlockCloseDir + +HtmlBlockOpenDiv = '<' Spnl ("div" | "DIV") Spnl HtmlAttribute* '>' +HtmlBlockCloseDiv = '<' Spnl '/' ("div" | "DIV") Spnl '>' +HtmlBlockDiv = HtmlBlockOpenDiv (HtmlBlockDiv | !HtmlBlockCloseDiv .)* HtmlBlockCloseDiv + +HtmlBlockOpenDl = '<' Spnl ("dl" | "DL") Spnl HtmlAttribute* '>' +HtmlBlockCloseDl = '<' Spnl '/' ("dl" | "DL") Spnl '>' +HtmlBlockDl = HtmlBlockOpenDl (HtmlBlockDl | !HtmlBlockCloseDl .)* HtmlBlockCloseDl + +HtmlBlockOpenFieldset = '<' Spnl ("fieldset" | "FIELDSET") Spnl HtmlAttribute* '>' +HtmlBlockCloseFieldset = '<' Spnl '/' ("fieldset" | "FIELDSET") Spnl '>' +HtmlBlockFieldset = HtmlBlockOpenFieldset (HtmlBlockFieldset | !HtmlBlockCloseFieldset .)* HtmlBlockCloseFieldset + +HtmlBlockOpenForm = '<' Spnl ("form" | "FORM") Spnl HtmlAttribute* '>' +HtmlBlockCloseForm = '<' Spnl '/' ("form" | "FORM") Spnl '>' +HtmlBlockForm = HtmlBlockOpenForm (HtmlBlockForm | !HtmlBlockCloseForm .)* HtmlBlockCloseForm + +HtmlBlockOpenH1 = '<' Spnl ("h1" | "H1") Spnl HtmlAttribute* '>' +HtmlBlockCloseH1 = '<' Spnl '/' ("h1" | "H1") Spnl '>' +HtmlBlockH1 = HtmlBlockOpenH1 (HtmlBlockH1 | !HtmlBlockCloseH1 .)* HtmlBlockCloseH1 + +HtmlBlockOpenH2 = '<' Spnl ("h2" | "H2") Spnl HtmlAttribute* '>' +HtmlBlockCloseH2 = '<' Spnl '/' ("h2" | "H2") Spnl '>' +HtmlBlockH2 = HtmlBlockOpenH2 (HtmlBlockH2 | !HtmlBlockCloseH2 .)* HtmlBlockCloseH2 + +HtmlBlockOpenH3 = '<' Spnl ("h3" | "H3") Spnl HtmlAttribute* '>' +HtmlBlockCloseH3 = '<' Spnl '/' ("h3" | "H3") Spnl '>' +HtmlBlockH3 = HtmlBlockOpenH3 (HtmlBlockH3 | !HtmlBlockCloseH3 .)* HtmlBlockCloseH3 + +HtmlBlockOpenH4 = '<' Spnl ("h4" | "H4") Spnl HtmlAttribute* '>' +HtmlBlockCloseH4 = '<' Spnl '/' ("h4" | "H4") Spnl '>' +HtmlBlockH4 = HtmlBlockOpenH4 (HtmlBlockH4 | !HtmlBlockCloseH4 .)* HtmlBlockCloseH4 + +HtmlBlockOpenH5 = '<' Spnl ("h5" | "H5") Spnl HtmlAttribute* '>' +HtmlBlockCloseH5 = '<' Spnl '/' ("h5" | "H5") Spnl '>' +HtmlBlockH5 = HtmlBlockOpenH5 (HtmlBlockH5 | !HtmlBlockCloseH5 .)* HtmlBlockCloseH5 + +HtmlBlockOpenH6 = '<' Spnl ("h6" | "H6") Spnl HtmlAttribute* '>' +HtmlBlockCloseH6 = '<' Spnl '/' ("h6" | "H6") Spnl '>' +HtmlBlockH6 = HtmlBlockOpenH6 (HtmlBlockH6 | !HtmlBlockCloseH6 .)* HtmlBlockCloseH6 + +HtmlBlockOpenMenu = '<' Spnl ("menu" | "MENU") Spnl HtmlAttribute* '>' +HtmlBlockCloseMenu = '<' Spnl '/' ("menu" | "MENU") Spnl '>' +HtmlBlockMenu = HtmlBlockOpenMenu (HtmlBlockMenu | !HtmlBlockCloseMenu .)* HtmlBlockCloseMenu + +HtmlBlockOpenNoframes = '<' Spnl ("noframes" | "NOFRAMES") Spnl HtmlAttribute* '>' +HtmlBlockCloseNoframes = '<' Spnl '/' ("noframes" | "NOFRAMES") Spnl '>' +HtmlBlockNoframes = HtmlBlockOpenNoframes (HtmlBlockNoframes | !HtmlBlockCloseNoframes .)* HtmlBlockCloseNoframes + +HtmlBlockOpenNoscript = '<' Spnl ("noscript" | "NOSCRIPT") Spnl HtmlAttribute* '>' +HtmlBlockCloseNoscript = '<' Spnl '/' ("noscript" | "NOSCRIPT") Spnl '>' +HtmlBlockNoscript = HtmlBlockOpenNoscript (HtmlBlockNoscript | !HtmlBlockCloseNoscript .)* HtmlBlockCloseNoscript + +HtmlBlockOpenOl = '<' Spnl ("ol" | "OL") Spnl HtmlAttribute* '>' +HtmlBlockCloseOl = '<' Spnl '/' ("ol" | "OL") Spnl '>' +HtmlBlockOl = HtmlBlockOpenOl (HtmlBlockOl | !HtmlBlockCloseOl .)* HtmlBlockCloseOl + +HtmlBlockOpenP = '<' Spnl ("p" | "P") Spnl HtmlAttribute* '>' +HtmlBlockCloseP = '<' Spnl '/' ("p" | "P") Spnl '>' +HtmlBlockP = HtmlBlockOpenP (HtmlBlockP | !HtmlBlockCloseP .)* HtmlBlockCloseP + +HtmlBlockOpenPre = '<' Spnl ("pre" | "PRE") Spnl HtmlAttribute* '>' +HtmlBlockClosePre = '<' Spnl '/' ("pre" | "PRE") Spnl '>' +HtmlBlockPre = HtmlBlockOpenPre (HtmlBlockPre | !HtmlBlockClosePre .)* HtmlBlockClosePre + +HtmlBlockOpenTable = '<' Spnl ("table" | "TABLE") Spnl HtmlAttribute* '>' +HtmlBlockCloseTable = '<' Spnl '/' ("table" | "TABLE") Spnl '>' +HtmlBlockTable = HtmlBlockOpenTable (HtmlBlockTable | !HtmlBlockCloseTable .)* HtmlBlockCloseTable + +HtmlBlockOpenUl = '<' Spnl ("ul" | "UL") Spnl HtmlAttribute* '>' +HtmlBlockCloseUl = '<' Spnl '/' ("ul" | "UL") Spnl '>' +HtmlBlockUl = HtmlBlockOpenUl (HtmlBlockUl | !HtmlBlockCloseUl .)* HtmlBlockCloseUl + +HtmlBlockOpenDd = '<' Spnl ("dd" | "DD") Spnl HtmlAttribute* '>' +HtmlBlockCloseDd = '<' Spnl '/' ("dd" | "DD") Spnl '>' +HtmlBlockDd = HtmlBlockOpenDd (HtmlBlockDd | !HtmlBlockCloseDd .)* HtmlBlockCloseDd + +HtmlBlockOpenDt = '<' Spnl ("dt" | "DT") Spnl HtmlAttribute* '>' +HtmlBlockCloseDt = '<' Spnl '/' ("dt" | "DT") Spnl '>' +HtmlBlockDt = HtmlBlockOpenDt (HtmlBlockDt | !HtmlBlockCloseDt .)* HtmlBlockCloseDt + +HtmlBlockOpenFrameset = '<' Spnl ("frameset" | "FRAMESET") Spnl HtmlAttribute* '>' +HtmlBlockCloseFrameset = '<' Spnl '/' ("frameset" | "FRAMESET") Spnl '>' +HtmlBlockFrameset = HtmlBlockOpenFrameset (HtmlBlockFrameset | !HtmlBlockCloseFrameset .)* HtmlBlockCloseFrameset + +HtmlBlockOpenLi = '<' Spnl ("li" | "LI") Spnl HtmlAttribute* '>' +HtmlBlockCloseLi = '<' Spnl '/' ("li" | "LI") Spnl '>' +HtmlBlockLi = HtmlBlockOpenLi (HtmlBlockLi | !HtmlBlockCloseLi .)* HtmlBlockCloseLi + +HtmlBlockOpenTbody = '<' Spnl ("tbody" | "TBODY") Spnl HtmlAttribute* '>' +HtmlBlockCloseTbody = '<' Spnl '/' ("tbody" | "TBODY") Spnl '>' +HtmlBlockTbody = HtmlBlockOpenTbody (HtmlBlockTbody | !HtmlBlockCloseTbody .)* HtmlBlockCloseTbody + +HtmlBlockOpenTd = '<' Spnl ("td" | "TD") Spnl HtmlAttribute* '>' +HtmlBlockCloseTd = '<' Spnl '/' ("td" | "TD") Spnl '>' +HtmlBlockTd = HtmlBlockOpenTd (HtmlBlockTd | !HtmlBlockCloseTd .)* HtmlBlockCloseTd + +HtmlBlockOpenTfoot = '<' Spnl ("tfoot" | "TFOOT") Spnl HtmlAttribute* '>' +HtmlBlockCloseTfoot = '<' Spnl '/' ("tfoot" | "TFOOT") Spnl '>' +HtmlBlockTfoot = HtmlBlockOpenTfoot (HtmlBlockTfoot | !HtmlBlockCloseTfoot .)* HtmlBlockCloseTfoot + +HtmlBlockOpenTh = '<' Spnl ("th" | "TH") Spnl HtmlAttribute* '>' +HtmlBlockCloseTh = '<' Spnl '/' ("th" | "TH") Spnl '>' +HtmlBlockTh = HtmlBlockOpenTh (HtmlBlockTh | !HtmlBlockCloseTh .)* HtmlBlockCloseTh + +HtmlBlockOpenThead = '<' Spnl ("thead" | "THEAD") Spnl HtmlAttribute* '>' +HtmlBlockCloseThead = '<' Spnl '/' ("thead" | "THEAD") Spnl '>' +HtmlBlockThead = HtmlBlockOpenThead (HtmlBlockThead | !HtmlBlockCloseThead .)* HtmlBlockCloseThead + +HtmlBlockOpenTr = '<' Spnl ("tr" | "TR") Spnl HtmlAttribute* '>' +HtmlBlockCloseTr = '<' Spnl '/' ("tr" | "TR") Spnl '>' +HtmlBlockTr = HtmlBlockOpenTr (HtmlBlockTr | !HtmlBlockCloseTr .)* HtmlBlockCloseTr + +HtmlBlockOpenScript = '<' Spnl ("script" | "SCRIPT") Spnl HtmlAttribute* '>' +HtmlBlockCloseScript = '<' Spnl '/' ("script" | "SCRIPT") Spnl '>' +HtmlBlockScript = HtmlBlockOpenScript (!HtmlBlockCloseScript .)* HtmlBlockCloseScript + + +HtmlBlockInTags = HtmlBlockAddress + | HtmlBlockBlockquote + | HtmlBlockCenter + | HtmlBlockDir + | HtmlBlockDiv + | HtmlBlockDl + | HtmlBlockFieldset + | HtmlBlockForm + | HtmlBlockH1 + | HtmlBlockH2 + | HtmlBlockH3 + | HtmlBlockH4 + | HtmlBlockH5 + | HtmlBlockH6 + | HtmlBlockMenu + | HtmlBlockNoframes + | HtmlBlockNoscript + | HtmlBlockOl + | HtmlBlockP + | HtmlBlockPre + | HtmlBlockTable + | HtmlBlockUl + | HtmlBlockDd + | HtmlBlockDt + | HtmlBlockFrameset + | HtmlBlockLi + | HtmlBlockTbody + | HtmlBlockTd + | HtmlBlockTfoot + | HtmlBlockTh + | HtmlBlockThead + | HtmlBlockTr + | HtmlBlockScript + +HtmlBlock = < ( HtmlBlockInTags | HtmlComment | HtmlBlockSelfClosing ) > + BlankLine+ + { if (extension(EXT_FILTER_HTML)) { + $$ = mk_list(LIST, NULL); + } else { + $$ = mk_str(yytext); + $$->key = HTMLBLOCK; + } + } + +HtmlBlockSelfClosing = '<' Spnl HtmlBlockType Spnl HtmlAttribute* '/' Spnl '>' + +HtmlBlockType = "address" | "blockquote" | "center" | "dir" | "div" | "dl" | "fieldset" | "form" | "h1" | "h2" | "h3" | + "h4" | "h5" | "h6" | "hr" | "isindex" | "menu" | "noframes" | "noscript" | "ol" | "p" | "pre" | "table" | + "ul" | "dd" | "dt" | "frameset" | "li" | "tbody" | "td" | "tfoot" | "th" | "thead" | "tr" | "script" | + "ADDRESS" | "BLOCKQUOTE" | "CENTER" | "DIR" | "DIV" | "DL" | "FIELDSET" | "FORM" | "H1" | "H2" | "H3" | + "H4" | "H5" | "H6" | "HR" | "ISINDEX" | "MENU" | "NOFRAMES" | "NOSCRIPT" | "OL" | "P" | "PRE" | "TABLE" | + "UL" | "DD" | "DT" | "FRAMESET" | "LI" | "TBODY" | "TD" | "TFOOT" | "TH" | "THEAD" | "TR" | "SCRIPT" + +StyleOpen = '<' Spnl ("style" | "STYLE") Spnl HtmlAttribute* '>' +StyleClose = '<' Spnl '/' ("style" | "STYLE") Spnl '>' +InStyleTags = StyleOpen (!StyleClose .)* StyleClose +StyleBlock = < InStyleTags > + BlankLine* + { if (extension(EXT_FILTER_STYLES)) { + $$ = mk_list(LIST, NULL); + } else { + $$ = mk_str(yytext); + $$->key = HTMLBLOCK; + } + } + +Inlines = a:StartList ( !Endline Inline { a = cons($$, a); } + | c:Endline &Inline { a = cons(c, a); } )+ Endline? + { $$ = mk_list(LIST, a); } + +Inline = Str + | Endline + | UlOrStarLine + | Space + | Strong + | Emph + | Image + | Link + | NoteReference + | InlineNote + | Code + | RawHtml + | Entity + | EscapedChar + | Smart + | Symbol + +Space = Spacechar+ + { $$ = mk_str(" "); + $$->key = SPACE; } + +Str = a:StartList < NormalChar+ > { a = cons(mk_str(yytext), a); } + ( StrChunk { a = cons($$, a); } )* + { if (a->next == NULL) { $$ = a; } else { $$ = mk_list(LIST, a); } } + +StrChunk = < (NormalChar | '_'+ &Alphanumeric)+ > { $$ = mk_str(yytext); } | + AposChunk + +AposChunk = &{ extension(EXT_SMART) } '\'' &Alphanumeric + { $$ = mk_element(APOSTROPHE); } + +EscapedChar = '\\' !Newline < [-\\`|*_{}[\]()#+.!><] > + { $$ = mk_str(yytext); } + +Entity = ( HexEntity | DecEntity | CharEntity ) + { $$ = mk_str(yytext); $$->key = HTML; } + +Endline = LineBreak | TerminalEndline | NormalEndline + +NormalEndline = Sp Newline !BlankLine !'>' !AtxStart + !(Line ('='+ | '-'+) Newline) + { $$ = mk_str("\n"); + $$->key = SPACE; } + +TerminalEndline = Sp Newline Eof + { $$ = NULL; } + +LineBreak = " " NormalEndline + { $$ = mk_element(LINEBREAK); } + +Symbol = < SpecialChar > + { $$ = mk_str(yytext); } + +# This keeps the parser from getting bogged down on long strings of '*' or '_', +# or strings of '*' or '_' with space on each side: +UlOrStarLine = (UlLine | StarLine) { $$ = mk_str(yytext); } +StarLine = < "****" '*'* > | < Spacechar '*'+ &Spacechar > +UlLine = < "____" '_'* > | < Spacechar '_'+ &Spacechar > + +Emph = EmphStar | EmphUl + +Whitespace = Spacechar | Newline + +EmphStar = '*' !Whitespace + a:StartList + ( !'*' b:Inline { a = cons(b, a); } + | b:StrongStar { a = cons(b, a); } + )+ + '*' + { $$ = mk_list(EMPH, a); } + +EmphUl = '_' !Whitespace + a:StartList + ( !'_' b:Inline { a = cons(b, a); } + | b:StrongUl { a = cons(b, a); } + )+ + '_' + { $$ = mk_list(EMPH, a); } + +Strong = StrongStar | StrongUl + +StrongStar = "**" !Whitespace + a:StartList + ( !"**" b:Inline { a = cons(b, a); })+ + "**" + { $$ = mk_list(STRONG, a); } + +StrongUl = "__" !Whitespace + a:StartList + ( !"__" b:Inline { a = cons(b, a); })+ + "__" + { $$ = mk_list(STRONG, a); } + +Image = '!' ( ExplicitLink | ReferenceLink ) + { if ($$->key == LINK) { + $$->key = IMAGE; + } else { + element *result; + result = $$; + $$->children = cons(mk_str("!"), result->children); + } } + +Link = ExplicitLink | ReferenceLink | AutoLink + +ReferenceLink = ReferenceLinkDouble | ReferenceLinkSingle + +ReferenceLinkDouble = a:Label < Spnl > !"[]" b:Label + { link match; + if (find_reference(&match, b->children)) { + $$ = mk_link(a->children, match.url, match.title); + free(a); + free_element_list(b); + } else { + element *result; + result = mk_element(LIST); + result->children = cons(mk_str("["), cons(a, cons(mk_str("]"), cons(mk_str(yytext), + cons(mk_str("["), cons(b, mk_str("]"))))))); + $$ = result; + } + } + +ReferenceLinkSingle = a:Label < (Spnl "[]")? > + { link match; + if (find_reference(&match, a->children)) { + $$ = mk_link(a->children, match.url, match.title); + free(a); + } + else { + element *result; + result = mk_element(LIST); + result->children = cons(mk_str("["), cons(a, cons(mk_str("]"), mk_str(yytext)))); + $$ = result; + } + } + +ExplicitLink = l:Label '(' Sp s:Source Spnl t:Title Sp ')' + { $$ = mk_link(l->children, s->contents.str, t->contents.str); + free_element(s); + free_element(t); + free(l); } + +Source = ( '<' < SourceContents > '>' | < SourceContents > ) + { $$ = mk_str(yytext); } + +SourceContents = ( ( !'(' !')' !'>' Nonspacechar )+ | '(' SourceContents ')')* + +Title = ( TitleSingle | TitleDouble | < "" > ) + { $$ = mk_str(yytext); } + +TitleSingle = '\'' < ( !( '\'' Sp ( ')' | Newline ) ) . )* > '\'' + +TitleDouble = '"' < ( !( '"' Sp ( ')' | Newline ) ) . )* > '"' + +AutoLink = AutoLinkUrl | AutoLinkEmail + +AutoLinkUrl = '<' < [A-Za-z]+ "://" ( !Newline !'>' . )+ > '>' + { $$ = mk_link(mk_str(yytext), yytext, ""); } + +AutoLinkEmail = '<' ( "mailto:" )? < [-A-Za-z0-9+_./!%~$]+ '@' ( !Newline !'>' . )+ > '>' + { char *mailto = malloc(strlen(yytext) + 8); + sprintf(mailto, "mailto:%s", yytext); + $$ = mk_link(mk_str(yytext), mailto, ""); + free(mailto); + } + +Reference = NonindentSpace !"[]" l:Label ':' Spnl s:RefSrc t:RefTitle BlankLine+ + { $$ = mk_link(l->children, s->contents.str, t->contents.str); + free_element(s); + free_element(t); + free(l); + $$->key = REFERENCE; } + +Label = '[' ( !'^' &{ extension(EXT_NOTES) } | &. &{ !extension(EXT_NOTES) } ) + a:StartList + ( !']' Inline { a = cons($$, a); } )* + ']' + { $$ = mk_list(LIST, a); } + +RefSrc = < Nonspacechar+ > + { $$ = mk_str(yytext); + $$->key = HTML; } + +RefTitle = ( RefTitleSingle | RefTitleDouble | RefTitleParens | EmptyTitle ) + { $$ = mk_str(yytext); } + +EmptyTitle = < "" > + +RefTitleSingle = Spnl '\'' < ( !( '\'' Sp Newline | Newline ) . )* > '\'' + +RefTitleDouble = Spnl '"' < ( !('"' Sp Newline | Newline) . )* > '"' + +RefTitleParens = Spnl '(' < ( !(')' Sp Newline | Newline) . )* > ')' + +References = a:StartList + ( b:Reference { a = cons(b, a); } | SkipBlock )* + { references = reverse(a); } + +Ticks1 = "`" !'`' +Ticks2 = "``" !'`' +Ticks3 = "```" !'`' +Ticks4 = "````" !'`' +Ticks5 = "`````" !'`' + +Code = ( Ticks1 Sp < ( ( !'`' Nonspacechar )+ | !Ticks1 '`'+ | !( Sp Ticks1 ) ( Spacechar | Newline !BlankLine ) )+ > Sp Ticks1 + | Ticks2 Sp < ( ( !'`' Nonspacechar )+ | !Ticks2 '`'+ | !( Sp Ticks2 ) ( Spacechar | Newline !BlankLine ) )+ > Sp Ticks2 + | Ticks3 Sp < ( ( !'`' Nonspacechar )+ | !Ticks3 '`'+ | !( Sp Ticks3 ) ( Spacechar | Newline !BlankLine ) )+ > Sp Ticks3 + | Ticks4 Sp < ( ( !'`' Nonspacechar )+ | !Ticks4 '`'+ | !( Sp Ticks4 ) ( Spacechar | Newline !BlankLine ) )+ > Sp Ticks4 + | Ticks5 Sp < ( ( !'`' Nonspacechar )+ | !Ticks5 '`'+ | !( Sp Ticks5 ) ( Spacechar | Newline !BlankLine ) )+ > Sp Ticks5 + ) + { $$ = mk_str(yytext); $$->key = CODE; } + +RawHtml = < (HtmlComment | HtmlBlockScript | HtmlTag) > + { if (extension(EXT_FILTER_HTML)) { + $$ = mk_list(LIST, NULL); + } else { + $$ = mk_str(yytext); + $$->key = HTML; + } + } + +BlankLine = Sp Newline + +Quoted = '"' (!'"' .)* '"' | '\'' (!'\'' .)* '\'' +HtmlAttribute = (AlphanumericAscii | '-')+ Spnl ('=' Spnl (Quoted | (!'>' Nonspacechar)+))? Spnl +HtmlComment = "" .)* "-->" +HtmlTag = '<' Spnl '/'? AlphanumericAscii+ Spnl HtmlAttribute* '/'? Spnl '>' +Eof = !. +Spacechar = ' ' | '\t' +Nonspacechar = !Spacechar !Newline . +Newline = '\n' | '\r' '\n'? +Sp = Spacechar* +Spnl = Sp (Newline Sp)? +SpecialChar = '*' | '_' | '`' | '&' | '[' | ']' | '(' | ')' | '<' | '!' | '#' | '\\' | '\'' | '"' | ExtendedSpecialChar +NormalChar = !( SpecialChar | Spacechar | Newline ) . +Alphanumeric = [0-9A-Za-z] | '\200' | '\201' | '\202' | '\203' | '\204' | '\205' | '\206' | '\207' | '\210' | '\211' | '\212' | '\213' | '\214' | '\215' | '\216' | '\217' | '\220' | '\221' | '\222' | '\223' | '\224' | '\225' | '\226' | '\227' | '\230' | '\231' | '\232' | '\233' | '\234' | '\235' | '\236' | '\237' | '\240' | '\241' | '\242' | '\243' | '\244' | '\245' | '\246' | '\247' | '\250' | '\251' | '\252' | '\253' | '\254' | '\255' | '\256' | '\257' | '\260' | '\261' | '\262' | '\263' | '\264' | '\265' | '\266' | '\267' | '\270' | '\271' | '\272' | '\273' | '\274' | '\275' | '\276' | '\277' | '\300' | '\301' | '\302' | '\303' | '\304' | '\305' | '\306' | '\307' | '\310' | '\311' | '\312' | '\313' | '\314' | '\315' | '\316' | '\317' | '\320' | '\321' | '\322' | '\323' | '\324' | '\325' | '\326' | '\327' | '\330' | '\331' | '\332' | '\333' | '\334' | '\335' | '\336' | '\337' | '\340' | '\341' | '\342' | '\343' | '\344' | '\345' | '\346' | '\347' | '\350' | '\351' | '\352' | '\353' | '\354' | '\355' | '\356' | '\357' | '\360' | '\361' | '\362' | '\363' | '\364' | '\365' | '\366' | '\367' | '\370' | '\371' | '\372' | '\373' | '\374' | '\375' | '\376' | '\377' +AlphanumericAscii = [A-Za-z0-9] +Digit = [0-9] +BOM = "\357\273\277" + +HexEntity = < '&' '#' [Xx] [0-9a-fA-F]+ ';' > +DecEntity = < '&' '#' [0-9]+ > ';' > +CharEntity = < '&' [A-Za-z0-9]+ ';' > + +NonindentSpace = " " | " " | " " | "" +Indent = "\t" | " " +IndentedLine = Indent Line +OptionallyIndentedLine = Indent? Line + +# StartList starts a list data structure that can be added to with cons: +StartList = &. + { $$ = NULL; } + +Line = RawLine + { $$ = mk_str(yytext); } +RawLine = ( < (!'\r' !'\n' .)* Newline > | < .+ > Eof ) + +SkipBlock = HtmlBlock + | ( !'#' !SetextBottom1 !SetextBottom2 !BlankLine RawLine )+ BlankLine* + | BlankLine+ + | RawLine + +# Syntax extensions + +ExtendedSpecialChar = &{ extension(EXT_SMART) } ('.' | '-' | '\'' | '"') + | &{ extension(EXT_NOTES) } ( '^' ) + +Smart = &{ extension(EXT_SMART) } + ( Ellipsis | Dash | SingleQuoted | DoubleQuoted | Apostrophe ) + +Apostrophe = '\'' + { $$ = mk_element(APOSTROPHE); } + +Ellipsis = ("..." | ". . .") + { $$ = mk_element(ELLIPSIS); } + +Dash = EmDash | EnDash + +EnDash = '-' &Digit + { $$ = mk_element(ENDASH); } + +EmDash = ("---" | "--") + { $$ = mk_element(EMDASH); } + +SingleQuoteStart = '\'' !(Spacechar | Newline) + +SingleQuoteEnd = '\'' !Alphanumeric + +SingleQuoted = SingleQuoteStart + a:StartList + ( !SingleQuoteEnd b:Inline { a = cons(b, a); } )+ + SingleQuoteEnd + { $$ = mk_list(SINGLEQUOTED, a); } + +DoubleQuoteStart = '"' + +DoubleQuoteEnd = '"' + +DoubleQuoted = DoubleQuoteStart + a:StartList + ( !DoubleQuoteEnd b:Inline { a = cons(b, a); } )+ + DoubleQuoteEnd + { $$ = mk_list(DOUBLEQUOTED, a); } + +NoteReference = &{ extension(EXT_NOTES) } + ref:RawNoteReference + { element *match; + if (find_note(&match, ref->contents.str)) { + $$ = mk_element(NOTE); + assert(match->children != NULL); + $$->children = match->children; + $$->contents.str = 0; + } else { + char *s; + s = malloc(strlen(ref->contents.str) + 4); + sprintf(s, "[^%s]", ref->contents.str); + $$ = mk_str(s); + free(s); + } + } + +RawNoteReference = "[^" < ( !Newline !']' . )+ > ']' + { $$ = mk_str(yytext); } + +Note = &{ extension(EXT_NOTES) } + NonindentSpace ref:RawNoteReference ':' Sp + a:StartList + ( RawNoteBlock { a = cons($$, a); } ) + ( &Indent RawNoteBlock { a = cons($$, a); } )* + { $$ = mk_list(NOTE, a); + $$->contents.str = strdup(ref->contents.str); + } + +InlineNote = &{ extension(EXT_NOTES) } + "^[" + a:StartList + ( !']' Inline { a = cons($$, a); } )+ + ']' + { $$ = mk_list(NOTE, a); + $$->contents.str = 0; } + +Notes = a:StartList + ( b:Note { a = cons(b, a); } | SkipBlock )* + { notes = reverse(a); } + +RawNoteBlock = a:StartList + ( !BlankLine OptionallyIndentedLine { a = cons($$, a); } )+ + ( < BlankLine* > { a = cons(mk_str(yytext), a); } ) + { $$ = mk_str_from_list(a, true); + $$->key = RAW; + } + +%% + + diff --git a/supportlibs/pegmarkdown/markdown_peg.h b/supportlibs/pegmarkdown/markdown_peg.h new file mode 100644 index 000000000..c78d7e2cb --- /dev/null +++ b/supportlibs/pegmarkdown/markdown_peg.h @@ -0,0 +1,72 @@ +/* markdown_peg.h */ +#ifndef MARKDOWN_PEG_H +#define MARKDOWN_PEG_H + +#include "markdown_lib.h" +#include + +/* Information (label, URL and title) for a link. */ +struct Link { + struct Element *label; + char *url; + char *title; +}; + +typedef struct Link link; + +/* Union for contents of an Element (string, list, or link). */ +union Contents { + char *str; + struct Link *link; +}; + +/* Types of semantic values returned by parsers. */ +enum keys { LIST, /* A generic list of values. For ordered and bullet lists, see below. */ + RAW, /* Raw markdown to be processed further */ + SPACE, + LINEBREAK, + ELLIPSIS, + EMDASH, + ENDASH, + APOSTROPHE, + SINGLEQUOTED, + DOUBLEQUOTED, + STR, + LINK, + IMAGE, + CODE, + HTML, + EMPH, + STRONG, + PLAIN, + PARA, + LISTITEM, + BULLETLIST, + ORDEREDLIST, + H1, H2, H3, H4, H5, H6, /* Code assumes that these are in order. */ + BLOCKQUOTE, + VERBATIM, + HTMLBLOCK, + HRULE, + REFERENCE, + NOTE + }; + +/* Semantic value of a parsing action. */ +struct Element { + int key; + union Contents contents; + struct Element *children; + struct Element *next; +}; + +typedef struct Element element; + +element * parse_references(char *string, int extensions); +element * parse_notes(char *string, int extensions, element *reference_list); +element * parse_markdown(char *string, int extensions, element *reference_list, element *note_list); +void free_element_list(element * elt); +void free_element(element *elt); +void print_element_list(GString *out, element *elt, int format, int exts); + +#endif diff --git a/supportlibs/pegmarkdown/odf.c b/supportlibs/pegmarkdown/odf.c new file mode 100644 index 000000000..46265f20a --- /dev/null +++ b/supportlibs/pegmarkdown/odf.c @@ -0,0 +1,181 @@ +/********************************************************************** + + odf.c - Utility routines to enable ODF support in peg-multimarkdown. + (c) 2011 Fletcher T. Penney (http://fletcherpenney.net/). + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License or the MIT + license. See LICENSE for details. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + ***********************************************************************/ + +#include "odf.h" + + +void print_odf_header(GString *out){ + + /* Insert required XML header */ + g_string_append_printf(out, +"\n" \ +"\n"); + + /* Font Declarations */ + g_string_append_printf(out, "\n" \ + " \n" \ + "\n"); + + /* Append basic style information */ + g_string_append_printf(out, "\n" \ + "\n" \ + " \n" \ + " \n" \ + "\n" \ + " \n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + " \n" \ + "\n" \ + "\n"); + + /* Automatic style information */ + g_string_append_printf(out, "" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + " \n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + "\n" \ + "\n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + "\n" \ + "\n" \ + " \n" \ + "\n" \ + "\n" \ + " \n" \ + "\n"); +} + +void print_odf_footer(GString *out) { + g_string_append_printf(out, "\n\n"); +} + diff --git a/supportlibs/pegmarkdown/odf.h b/supportlibs/pegmarkdown/odf.h new file mode 100644 index 000000000..d5bdc8860 --- /dev/null +++ b/supportlibs/pegmarkdown/odf.h @@ -0,0 +1,11 @@ +#ifndef ODF_H +#define ODF_H + +#include +#include +#include + +void print_odf_header(GString *out); +void print_odf_footer(GString *out); +#endif + diff --git a/supportlibs/pegmarkdown/parsing_functions.c b/supportlibs/pegmarkdown/parsing_functions.c new file mode 100644 index 000000000..81fd9e26f --- /dev/null +++ b/supportlibs/pegmarkdown/parsing_functions.c @@ -0,0 +1,117 @@ +/* parsing_functions.c - Functions for parsing markdown and + * freeing element lists. */ + +/* These yy_* functions come from markdown_parser.c which is + * generated from markdown_parser.leg + * */ +typedef int (*yyrule)(); + +extern int yyparse(); +extern int yyparsefrom(yyrule); +extern int yy_References(); +extern int yy_Notes(); +extern int yy_Doc(); + +#include "utility_functions.h" +#include "parsing_functions.h" +#include "markdown_peg.h" + +static void free_element_contents(element elt); + +/* free_element_list - free list of elements recursively */ +void free_element_list(element * elt) { + element * next = NULL; + while (elt != NULL) { + next = elt->next; + free_element_contents(*elt); + if (elt->children != NULL) { + free_element_list(elt->children); + elt->children = NULL; + } + free(elt); + elt = next; + } +} + +/* free_element_contents - free element contents depending on type */ +static void free_element_contents(element elt) { + switch (elt.key) { + case STR: + case SPACE: + case RAW: + case HTMLBLOCK: + case HTML: + case VERBATIM: + case CODE: + case NOTE: + free(elt.contents.str); + elt.contents.str = NULL; + break; + case LINK: + case IMAGE: + case REFERENCE: + free(elt.contents.link->url); + elt.contents.link->url = NULL; + free(elt.contents.link->title); + elt.contents.link->title = NULL; + free_element_list(elt.contents.link->label); + free(elt.contents.link); + elt.contents.link = NULL; + break; + default: + ; + } +} + +/* free_element - free element and contents */ +void free_element(element *elt) { + free_element_contents(*elt); + free(elt); +} + +element * parse_references(char *string, int extensions) { + + char *oldcharbuf; + syntax_extensions = extensions; + + oldcharbuf = charbuf; + charbuf = string; + yyparsefrom(yy_References); /* first pass, just to collect references */ + charbuf = oldcharbuf; + + return references; +} + +element * parse_notes(char *string, int extensions, element *reference_list) { + + char *oldcharbuf; + notes = NULL; + syntax_extensions = extensions; + + if (extension(EXT_NOTES)) { + references = reference_list; + oldcharbuf = charbuf; + charbuf = string; + yyparsefrom(yy_Notes); /* second pass for notes */ + charbuf = oldcharbuf; + } + + return notes; +} + +element * parse_markdown(char *string, int extensions, element *reference_list, element *note_list) { + + char *oldcharbuf; + syntax_extensions = extensions; + references = reference_list; + notes = note_list; + + oldcharbuf = charbuf; + charbuf = string; + + yyparsefrom(yy_Doc); + + charbuf = oldcharbuf; /* restore charbuf to original value */ + return parse_result; + +} diff --git a/supportlibs/pegmarkdown/parsing_functions.h b/supportlibs/pegmarkdown/parsing_functions.h new file mode 100644 index 000000000..d7b7ff426 --- /dev/null +++ b/supportlibs/pegmarkdown/parsing_functions.h @@ -0,0 +1,17 @@ +#ifndef PARSING_FUNCTIONS_H +#define PARSING_FUNCTIONS_H +/* parsing_functions.c - Functions for parsing markdown and + * freeing element lists. */ + +#include "markdown_peg.h" + +/* free_element_list - free list of elements recursively */ +void free_element_list(element * elt); +/* free_element - free element and contents */ +void free_element(element *elt); + +element * parse_references(char *string, int extensions); +element * parse_notes(char *string, int extensions, element *reference_list); +element * parse_markdown(char *string, int extensions, element *reference_list, element *note_list); + +#endif diff --git a/supportlibs/pegmarkdown/peg-0.1.9/Makefile b/supportlibs/pegmarkdown/peg-0.1.9/Makefile new file mode 100644 index 000000000..c10fbda83 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/Makefile @@ -0,0 +1,65 @@ +CFLAGS = -g -Wall $(OFLAGS) $(XFLAGS) +OFLAGS = -O3 -DNDEBUG +#OFLAGS = -pg + +OBJS = tree.o compile.o + +all : peg leg + +peg : peg.o $(OBJS) + $(CC) $(CFLAGS) -o $@-new peg.o $(OBJS) + mv $@-new $@ + +leg : leg.o $(OBJS) + $(CC) $(CFLAGS) -o $@-new leg.o $(OBJS) + mv $@-new $@ + +ROOT = +PREFIX = /usr/local +BINDIR = $(ROOT)$(PREFIX)/bin + +install : $(BINDIR)/peg $(BINDIR)/leg + +$(BINDIR)/% : % + cp -p $< $@ + strip $@ + +uninstall : .FORCE + rm -f $(BINDIR)/peg + rm -f $(BINDIR)/leg + +peg.o : peg.c peg.peg-c + +%.peg-c : %.peg compile.c + ./peg -o $@ $< + +leg.o : leg.c + +leg.c : leg.leg compile.c + ./leg -o $@ $< + +check : check-peg check-leg + +check-peg : peg .FORCE + ./peg < peg.peg > peg.out + diff peg.peg-c peg.out + rm peg.out + +check-leg : leg .FORCE + ./leg < leg.leg > leg.out + diff leg.c leg.out + rm leg.out + +test examples : .FORCE + $(SHELL) -ec '(cd examples; $(MAKE))' + +clean : .FORCE + rm -f *~ *.o *.peg.[cd] *.leg.[cd] + $(SHELL) -ec '(cd examples; $(MAKE) $@)' + +spotless : clean .FORCE + rm -f peg + rm -f leg + $(SHELL) -ec '(cd examples; $(MAKE) $@)' + +.FORCE : diff --git a/supportlibs/pegmarkdown/peg-0.1.9/compile.c b/supportlibs/pegmarkdown/peg-0.1.9/compile.c new file mode 100644 index 000000000..74506b762 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/compile.c @@ -0,0 +1,717 @@ +/* Copyright (c) 2007, 2012 by Ian Piumarta + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the 'Software'), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, provided that the above copyright notice(s) and this + * permission notice appear in all copies of the Software. Acknowledgement + * of the use of this Software in supporting documentation would be + * appreciated but is not required. + * + * THE SOFTWARE IS PROVIDED 'AS IS'. USE ENTIRELY AT YOUR OWN RISK. + * + * Last edited: 2012-04-29 16:09:36 by piumarta on emilia + */ + +#include +#include +#include +#include + +#include "version.h" +#include "tree.h" + +static int yyl(void) +{ + static int prev= 0; + return ++prev; +} + +static void charClassSet (unsigned char bits[], int c) { bits[c >> 3] |= (1 << (c & 7)); } +static void charClassClear(unsigned char bits[], int c) { bits[c >> 3] &= ~(1 << (c & 7)); } + +typedef void (*setter)(unsigned char bits[], int c); + +static inline int oigit(int c) { return '0' <= c && c <= '7'; } + +static int cnext(unsigned char **ccp) +{ + unsigned char *cclass= *ccp; + int c= *cclass++; + if (c) + { + if ('\\' == c && *cclass) + { + switch (c= *cclass++) + { + case 'a': c= '\a'; break; /* bel */ + case 'b': c= '\b'; break; /* bs */ + case 'e': c= '\e'; break; /* esc */ + case 'f': c= '\f'; break; /* ff */ + case 'n': c= '\n'; break; /* nl */ + case 'r': c= '\r'; break; /* cr */ + case 't': c= '\t'; break; /* ht */ + case 'v': c= '\v'; break; /* vt */ + default: + if (oigit(c)) + { + c -= '0'; + if (oigit(*cclass)) c= (c << 3) + *cclass++ - '0'; + if (oigit(*cclass)) c= (c << 3) + *cclass++ - '0'; + } + break; + } + } + *ccp= cclass; + } + return c; +} + +static char *makeCharClass(unsigned char *cclass) +{ + unsigned char bits[32]; + setter set; + int c, prev= -1; + static char string[256]; + char *ptr; + + if ('^' == *cclass) + { + memset(bits, 255, 32); + set= charClassClear; + ++cclass; + } + else + { + memset(bits, 0, 32); + set= charClassSet; + } + + while (*cclass) + { + if ('-' == *cclass && cclass[1] && prev >= 0) + { + ++cclass; + for (c= cnext(&cclass); prev <= c; ++prev) + set(bits, prev); + prev= -1; + } + else + { + c= cnext(&cclass); + set(bits, prev= c); + } + } + + ptr= string; + for (c= 0; c < 32; ++c) + ptr += sprintf(ptr, "\\%03o", bits[c]); + + return string; +} + +static void begin(void) { fprintf(output, "\n {"); } +static void end(void) { fprintf(output, "\n }"); } +static void label(int n) { fprintf(output, "\n l%d:;\t", n); } +static void jump(int n) { fprintf(output, " goto l%d;", n); } +static void save(int n) { fprintf(output, " int yypos%d= ctx->pos, yythunkpos%d= ctx->thunkpos;", n, n); } +static void restore(int n) { fprintf(output, " ctx->pos= yypos%d; ctx->thunkpos= yythunkpos%d;", n, n); } + +static void Node_compile_c_ko(Node *node, int ko) +{ + assert(node); + switch (node->type) + { + case Rule: + fprintf(stderr, "\ninternal error #1 (%s)\n", node->rule.name); + exit(1); + break; + + case Dot: + fprintf(output, " if (!yymatchDot(ctx)) goto l%d;", ko); + break; + + case Name: + fprintf(output, " if (!yy_%s(ctx)) goto l%d;", node->name.rule->rule.name, ko); + if (node->name.variable) + fprintf(output, " yyDo(ctx, yySet, %d, 0);", node->name.variable->variable.offset); + break; + + case Character: + case String: + { + int len= strlen(node->string.value); + if (1 == len) + { + if ('\'' == node->string.value[0]) + fprintf(output, " if (!yymatchChar(ctx, '\\'')) goto l%d;", ko); + else + fprintf(output, " if (!yymatchChar(ctx, '%s')) goto l%d;", node->string.value, ko); + } + else + if (2 == len && '\\' == node->string.value[0]) + fprintf(output, " if (!yymatchChar(ctx, '%s')) goto l%d;", node->string.value, ko); + else + fprintf(output, " if (!yymatchString(ctx, \"%s\")) goto l%d;", node->string.value, ko); + } + break; + + case Class: + fprintf(output, " if (!yymatchClass(ctx, (unsigned char *)\"%s\")) goto l%d;", makeCharClass(node->cclass.value), ko); + break; + + case Action: + fprintf(output, " yyDo(ctx, yy%s, ctx->begin, ctx->end);", node->action.name); + break; + + case Predicate: + fprintf(output, " yyText(ctx, ctx->begin, ctx->end); if (!(%s)) goto l%d;", node->action.text, ko); + break; + + case Alternate: + { + int ok= yyl(); + begin(); + save(ok); + for (node= node->alternate.first; node; node= node->alternate.next) + if (node->alternate.next) + { + int next= yyl(); + Node_compile_c_ko(node, next); + jump(ok); + label(next); + restore(ok); + } + else + Node_compile_c_ko(node, ko); + end(); + label(ok); + } + break; + + case Sequence: + for (node= node->sequence.first; node; node= node->sequence.next) + Node_compile_c_ko(node, ko); + break; + + case PeekFor: + { + int ok= yyl(); + begin(); + save(ok); + Node_compile_c_ko(node->peekFor.element, ko); + restore(ok); + end(); + } + break; + + case PeekNot: + { + int ok= yyl(); + begin(); + save(ok); + Node_compile_c_ko(node->peekFor.element, ok); + jump(ko); + label(ok); + restore(ok); + end(); + } + break; + + case Query: + { + int qko= yyl(), qok= yyl(); + begin(); + save(qko); + Node_compile_c_ko(node->query.element, qko); + jump(qok); + label(qko); + restore(qko); + end(); + label(qok); + } + break; + + case Star: + { + int again= yyl(), out= yyl(); + label(again); + begin(); + save(out); + Node_compile_c_ko(node->star.element, out); + jump(again); + label(out); + restore(out); + end(); + } + break; + + case Plus: + { + int again= yyl(), out= yyl(); + Node_compile_c_ko(node->plus.element, ko); + label(again); + begin(); + save(out); + Node_compile_c_ko(node->plus.element, out); + jump(again); + label(out); + restore(out); + end(); + } + break; + + default: + fprintf(stderr, "\nNode_compile_c_ko: illegal node type %d\n", node->type); + exit(1); + } +} + + +static int countVariables(Node *node) +{ + int count= 0; + while (node) + { + ++count; + node= node->variable.next; + } + return count; +} + +static void defineVariables(Node *node) +{ + int count= 0; + while (node) + { + fprintf(output, "#define %s ctx->val[%d]\n", node->variable.name, --count); + node->variable.offset= count; + node= node->variable.next; + } + fprintf(output, "#define yy ctx->yy\n"); + fprintf(output, "#define yypos ctx->pos\n"); + fprintf(output, "#define yythunkpos ctx->thunkpos\n"); +} + +static void undefineVariables(Node *node) +{ + fprintf(output, "#undef yythunkpos\n"); + fprintf(output, "#undef yypos\n"); + fprintf(output, "#undef yy\n"); + while (node) + { + fprintf(output, "#undef %s\n", node->variable.name); + node= node->variable.next; + } +} + + +static void Rule_compile_c2(Node *node) +{ + assert(node); + assert(Rule == node->type); + + if (!node->rule.expression) + fprintf(stderr, "rule '%s' used but not defined\n", node->rule.name); + else + { + int ko= yyl(), safe; + + if ((!(RuleUsed & node->rule.flags)) && (node != start)) + fprintf(stderr, "rule '%s' defined but not used\n", node->rule.name); + + safe= ((Query == node->rule.expression->type) || (Star == node->rule.expression->type)); + + fprintf(output, "\nYY_RULE(int) yy_%s(yycontext *ctx)\n{", node->rule.name); + if (!safe) save(0); + if (node->rule.variables) + fprintf(output, " yyDo(ctx, yyPush, %d, 0);", countVariables(node->rule.variables)); + fprintf(output, "\n yyprintf((stderr, \"%%s\\n\", \"%s\"));", node->rule.name); + Node_compile_c_ko(node->rule.expression, ko); + fprintf(output, "\n yyprintf((stderr, \" ok %%s @ %%s\\n\", \"%s\", ctx->buf+ctx->pos));", node->rule.name); + if (node->rule.variables) + fprintf(output, " yyDo(ctx, yyPop, %d, 0);", countVariables(node->rule.variables)); + fprintf(output, "\n return 1;"); + if (!safe) + { + label(ko); + restore(0); + fprintf(output, "\n yyprintf((stderr, \" fail %%s @ %%s\\n\", \"%s\", ctx->buf+ctx->pos));", node->rule.name); + fprintf(output, "\n return 0;"); + } + fprintf(output, "\n}"); + } + + if (node->rule.next) + Rule_compile_c2(node->rule.next); +} + +static char *header= "\ +#include \n\ +#include \n\ +#include \n\ +"; + +static char *preamble= "\ +#ifndef YY_LOCAL\n\ +#define YY_LOCAL(T) static T\n\ +#endif\n\ +#ifndef YY_ACTION\n\ +#define YY_ACTION(T) static T\n\ +#endif\n\ +#ifndef YY_RULE\n\ +#define YY_RULE(T) static T\n\ +#endif\n\ +#ifndef YY_PARSE\n\ +#define YY_PARSE(T) T\n\ +#endif\n\ +#ifndef YYPARSE\n\ +#define YYPARSE yyparse\n\ +#endif\n\ +#ifndef YYPARSEFROM\n\ +#define YYPARSEFROM yyparsefrom\n\ +#endif\n\ +#ifndef YY_INPUT\n\ +#define YY_INPUT(buf, result, max_size) \\\n\ + { \\\n\ + int yyc= getchar(); \\\n\ + result= (EOF == yyc) ? 0 : (*(buf)= yyc, 1); \\\n\ + yyprintf((stderr, \"<%c>\", yyc)); \\\n\ + }\n\ +#endif\n\ +#ifndef YY_BEGIN\n\ +#define YY_BEGIN ( ctx->begin= ctx->pos, 1)\n\ +#endif\n\ +#ifndef YY_END\n\ +#define YY_END ( ctx->end= ctx->pos, 1)\n\ +#endif\n\ +#ifdef YY_DEBUG\n\ +# define yyprintf(args) fprintf args\n\ +#else\n\ +# define yyprintf(args)\n\ +#endif\n\ +#ifndef YYSTYPE\n\ +#define YYSTYPE int\n\ +#endif\n\ +\n\ +#ifndef YY_PART\n\ +\n\ +typedef struct _yycontext yycontext;\n\ +typedef void (*yyaction)(yycontext *ctx, char *yytext, int yyleng);\n\ +typedef struct _yythunk { int begin, end; yyaction action; struct _yythunk *next; } yythunk;\n\ +\n\ +struct _yycontext {\n\ + char *buf;\n\ + int buflen;\n\ + int pos;\n\ + int limit;\n\ + char *text;\n\ + int textlen;\n\ + int begin;\n\ + int end;\n\ + int textmax;\n\ + yythunk *thunks;\n\ + int thunkslen;\n\ + int thunkpos;\n\ + YYSTYPE yy;\n\ + YYSTYPE *val;\n\ + YYSTYPE *vals;\n\ + int valslen;\n\ +#ifdef YY_CTX_MEMBERS\n\ + YY_CTX_MEMBERS\n\ +#endif\n\ +};\n\ +\n\ +#ifdef YY_CTX_LOCAL\n\ +#define YY_CTX_PARAM_ yycontext *yyctx,\n\ +#define YY_CTX_PARAM yycontext *yyctx\n\ +#define YY_CTX_ARG_ yyctx,\n\ +#define YY_CTX_ARG yyctx\n\ +#else\n\ +#define YY_CTX_PARAM_\n\ +#define YY_CTX_PARAM\n\ +#define YY_CTX_ARG_\n\ +#define YY_CTX_ARG\n\ +yycontext yyctx0;\n\ +yycontext *yyctx= &yyctx0;\n\ +#endif\n\ +\n\ +YY_LOCAL(int) yyrefill(yycontext *ctx)\n\ +{\n\ + int yyn;\n\ + while (ctx->buflen - ctx->pos < 512)\n\ + {\n\ + ctx->buflen *= 2;\n\ + ctx->buf= (char *)realloc(ctx->buf, ctx->buflen);\n\ + }\n\ + YY_INPUT((ctx->buf + ctx->pos), yyn, (ctx->buflen - ctx->pos));\n\ + if (!yyn) return 0;\n\ + ctx->limit += yyn;\n\ + return 1;\n\ +}\n\ +\n\ +YY_LOCAL(int) yymatchDot(yycontext *ctx)\n\ +{\n\ + if (ctx->pos >= ctx->limit && !yyrefill(ctx)) return 0;\n\ + ++ctx->pos;\n\ + return 1;\n\ +}\n\ +\n\ +YY_LOCAL(int) yymatchChar(yycontext *ctx, int c)\n\ +{\n\ + if (ctx->pos >= ctx->limit && !yyrefill(ctx)) return 0;\n\ + if ((unsigned char)ctx->buf[ctx->pos] == c)\n\ + {\n\ + ++ctx->pos;\n\ + yyprintf((stderr, \" ok yymatchChar(ctx, %c) @ %s\\n\", c, ctx->buf+ctx->pos));\n\ + return 1;\n\ + }\n\ + yyprintf((stderr, \" fail yymatchChar(ctx, %c) @ %s\\n\", c, ctx->buf+ctx->pos));\n\ + return 0;\n\ +}\n\ +\n\ +YY_LOCAL(int) yymatchString(yycontext *ctx, char *s)\n\ +{\n\ + int yysav= ctx->pos;\n\ + while (*s)\n\ + {\n\ + if (ctx->pos >= ctx->limit && !yyrefill(ctx)) return 0;\n\ + if (ctx->buf[ctx->pos] != *s)\n\ + {\n\ + ctx->pos= yysav;\n\ + return 0;\n\ + }\n\ + ++s;\n\ + ++ctx->pos;\n\ + }\n\ + return 1;\n\ +}\n\ +\n\ +YY_LOCAL(int) yymatchClass(yycontext *ctx, unsigned char *bits)\n\ +{\n\ + int c;\n\ + if (ctx->pos >= ctx->limit && !yyrefill(ctx)) return 0;\n\ + c= (unsigned char)ctx->buf[ctx->pos];\n\ + if (bits[c >> 3] & (1 << (c & 7)))\n\ + {\n\ + ++ctx->pos;\n\ + yyprintf((stderr, \" ok yymatchClass @ %s\\n\", ctx->buf+ctx->pos));\n\ + return 1;\n\ + }\n\ + yyprintf((stderr, \" fail yymatchClass @ %s\\n\", ctx->buf+ctx->pos));\n\ + return 0;\n\ +}\n\ +\n\ +YY_LOCAL(void) yyDo(yycontext *ctx, yyaction action, int begin, int end)\n\ +{\n\ + while (ctx->thunkpos >= ctx->thunkslen)\n\ + {\n\ + ctx->thunkslen *= 2;\n\ + ctx->thunks= (yythunk *)realloc(ctx->thunks, sizeof(yythunk) * ctx->thunkslen);\n\ + }\n\ + ctx->thunks[ctx->thunkpos].begin= begin;\n\ + ctx->thunks[ctx->thunkpos].end= end;\n\ + ctx->thunks[ctx->thunkpos].action= action;\n\ + ++ctx->thunkpos;\n\ +}\n\ +\n\ +YY_LOCAL(int) yyText(yycontext *ctx, int begin, int end)\n\ +{\n\ + int yyleng= end - begin;\n\ + if (yyleng <= 0)\n\ + yyleng= 0;\n\ + else\n\ + {\n\ + while (ctx->textlen < (yyleng + 1))\n\ + {\n\ + ctx->textlen *= 2;\n\ + ctx->text= (char *)realloc(ctx->text, ctx->textlen);\n\ + }\n\ + memcpy(ctx->text, ctx->buf + begin, yyleng);\n\ + }\n\ + ctx->text[yyleng]= '\\0';\n\ + return yyleng;\n\ +}\n\ +\n\ +YY_LOCAL(void) yyDone(yycontext *ctx)\n\ +{\n\ + int pos;\n\ + for (pos= 0; pos < ctx->thunkpos; ++pos)\n\ + {\n\ + yythunk *thunk= &ctx->thunks[pos];\n\ + int yyleng= thunk->end ? yyText(ctx, thunk->begin, thunk->end) : thunk->begin;\n\ + yyprintf((stderr, \"DO [%d] %p %s\\n\", pos, thunk->action, ctx->text));\n\ + thunk->action(ctx, ctx->text, yyleng);\n\ + }\n\ + ctx->thunkpos= 0;\n\ +}\n\ +\n\ +YY_LOCAL(void) yyCommit(yycontext *ctx)\n\ +{\n\ + if ((ctx->limit -= ctx->pos))\n\ + {\n\ + memmove(ctx->buf, ctx->buf + ctx->pos, ctx->limit);\n\ + }\n\ + ctx->begin -= ctx->pos;\n\ + ctx->end -= ctx->pos;\n\ + ctx->pos= ctx->thunkpos= 0;\n\ +}\n\ +\n\ +YY_LOCAL(int) yyAccept(yycontext *ctx, int tp0)\n\ +{\n\ + if (tp0)\n\ + {\n\ + fprintf(stderr, \"accept denied at %d\\n\", tp0);\n\ + return 0;\n\ + }\n\ + else\n\ + {\n\ + yyDone(ctx);\n\ + yyCommit(ctx);\n\ + }\n\ + return 1;\n\ +}\n\ +\n\ +YY_LOCAL(void) yyPush(yycontext *ctx, char *text, int count) { ctx->val += count; }\n\ +YY_LOCAL(void) yyPop(yycontext *ctx, char *text, int count) { ctx->val -= count; }\n\ +YY_LOCAL(void) yySet(yycontext *ctx, char *text, int count) { ctx->val[count]= ctx->yy; }\n\ +\n\ +#endif /* YY_PART */\n\ +\n\ +#define YYACCEPT yyAccept(ctx, yythunkpos0)\n\ +\n\ +"; + +static char *footer= "\n\ +\n\ +#ifndef YY_PART\n\ +\n\ +typedef int (*yyrule)(yycontext *ctx);\n\ +\n\ +YY_PARSE(int) YYPARSEFROM(YY_CTX_PARAM_ yyrule yystart)\n\ +{\n\ + int yyok;\n\ + if (!yyctx->buflen)\n\ + {\n\ + yyctx->buflen= 1024;\n\ + yyctx->buf= (char *)malloc(yyctx->buflen);\n\ + yyctx->textlen= 1024;\n\ + yyctx->text= (char *)malloc(yyctx->textlen);\n\ + yyctx->thunkslen= 32;\n\ + yyctx->thunks= (yythunk *)malloc(sizeof(yythunk) * yyctx->thunkslen);\n\ + yyctx->valslen= 32;\n\ + yyctx->vals= (YYSTYPE *)malloc(sizeof(YYSTYPE) * yyctx->valslen);\n\ + yyctx->begin= yyctx->end= yyctx->pos= yyctx->limit= yyctx->thunkpos= 0;\n\ + }\n\ + yyctx->begin= yyctx->end= yyctx->pos;\n\ + yyctx->thunkpos= 0;\n\ + yyctx->val= yyctx->vals;\n\ + yyok= yystart(yyctx);\n\ + if (yyok) yyDone(yyctx);\n\ + yyCommit(yyctx);\n\ + return yyok;\n\ +}\n\ +\n\ +YY_PARSE(int) YYPARSE(YY_CTX_PARAM)\n\ +{\n\ + return YYPARSEFROM(YY_CTX_ARG_ yy_%s);\n\ +}\n\ +\n\ +#endif\n\ +"; + +void Rule_compile_c_header(void) +{ + fprintf(output, "/* A recursive-descent parser generated by peg %d.%d.%d */\n", PEG_MAJOR, PEG_MINOR, PEG_LEVEL); + fprintf(output, "\n"); + fprintf(output, "%s", header); + fprintf(output, "#define YYRULECOUNT %d\n", ruleCount); +} + +int consumesInput(Node *node) +{ + if (!node) return 0; + + switch (node->type) + { + case Rule: + { + int result= 0; + if (RuleReached & node->rule.flags) + fprintf(stderr, "possible infinite left recursion in rule '%s'\n", node->rule.name); + else + { + node->rule.flags |= RuleReached; + result= consumesInput(node->rule.expression); + node->rule.flags &= ~RuleReached; + } + return result; + } + break; + + case Dot: return 1; + case Name: return consumesInput(node->name.rule); + case Character: + case String: return strlen(node->string.value) > 0; + case Class: return 1; + case Action: return 0; + case Predicate: return 0; + + case Alternate: + { + Node *n; + for (n= node->alternate.first; n; n= n->alternate.next) + if (!consumesInput(n)) + return 0; + } + return 1; + + case Sequence: + { + Node *n; + for (n= node->alternate.first; n; n= n->alternate.next) + if (consumesInput(n)) + return 1; + } + return 0; + + case PeekFor: return 0; + case PeekNot: return 0; + case Query: return 0; + case Star: return 0; + case Plus: return consumesInput(node->plus.element); + + default: + fprintf(stderr, "\nconsumesInput: illegal node type %d\n", node->type); + exit(1); + } + return 0; +} + + +void Rule_compile_c(Node *node) +{ + Node *n; + + for (n= rules; n; n= n->rule.next) + consumesInput(n); + + fprintf(output, "%s", preamble); + for (n= node; n; n= n->rule.next) + fprintf(output, "YY_RULE(int) yy_%s(yycontext *ctx); /* %d */\n", n->rule.name, n->rule.id); + fprintf(output, "\n"); + for (n= actions; n; n= n->action.list) + { + fprintf(output, "YY_ACTION(void) yy%s(yycontext *ctx, char *yytext, int yyleng)\n{\n", n->action.name); + defineVariables(n->action.rule->rule.variables); + fprintf(output, " yyprintf((stderr, \"do yy%s\\n\"));\n", n->action.name); + fprintf(output, " %s;\n", n->action.text); + undefineVariables(n->action.rule->rule.variables); + fprintf(output, "}\n"); + } + Rule_compile_c2(node); + fprintf(output, footer, start->rule.name); +} diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/Makefile b/supportlibs/pegmarkdown/peg-0.1.9/examples/Makefile new file mode 100644 index 000000000..30d3cc8f8 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/Makefile @@ -0,0 +1,88 @@ +EXAMPLES = test rule accept wc dc dcv calc basic localctx + +CFLAGS = -g -O3 + +DIFF = diff +TEE = cat > + +all : $(EXAMPLES) + +test : .FORCE + ../peg -o test.peg.c test.peg + $(CC) $(CFLAGS) -o test test.c + echo 'ab.ac.ad.ae.afg.afh.afg.afh.afi.afj.' | ./$@ | $(TEE) $@.out + $(DIFF) $@.ref $@.out + rm -f $@.out + @echo + +rule : .FORCE + ../peg -o rule.peg.c rule.peg + $(CC) $(CFLAGS) -o rule rule.c + echo 'abcbcdabcbcdabcbcdabcbcd' | ./$@ | $(TEE) $@.out + $(DIFF) $@.ref $@.out + rm -f $@.out + @echo + +accept : .FORCE + ../peg -o accept.peg.c accept.peg + $(CC) $(CFLAGS) -o accept accept.c + echo 'abcbcdabcbcdabcbcdabcbcd' | ./$@ | $(TEE) $@.out + $(DIFF) $@.ref $@.out + rm -f $@.out + @echo + +wc : .FORCE + ../leg -o wc.leg.c wc.leg + $(CC) $(CFLAGS) -o wc wc.leg.c + cat wc.leg | ./$@ | $(TEE) $@.out + $(DIFF) $@.ref $@.out + rm -f $@.out + @echo + +dc : .FORCE + ../peg -o dc.peg.c dc.peg + $(CC) $(CFLAGS) -o dc dc.c + echo ' 2 *3 *(3+ 4) ' | ./dc | $(TEE) $@.out + $(DIFF) $@.ref $@.out + rm -f $@.out + @echo + +dcv : .FORCE + ../peg -o dcv.peg.c dcv.peg + $(CC) $(CFLAGS) -o dcv dcv.c + echo 'a = 6; b = 7; a * b' | ./dcv | $(TEE) $@.out + $(DIFF) $@.ref $@.out + rm -f $@.out + @echo + +calc : .FORCE + ../leg -o calc.leg.c calc.leg + $(CC) $(CFLAGS) -o calc calc.leg.c + echo 'a = 6; b = 7; a * b' | ./calc | $(TEE) $@.out + $(DIFF) $@.ref $@.out + rm -f $@.out + @echo + +basic : .FORCE + ../leg -o basic.leg.c basic.leg + $(CC) $(CFLAGS) -o basic basic.leg.c + ( echo 'load "test"'; echo "run" ) | ./basic | $(TEE) $@.out + $(DIFF) $@.ref $@.out + rm -f $@.out + @echo + +localctx : .FORCE + ../peg -o test.peg.c test.peg + $(CC) $(CFLAGS) -o localctx localctx.c + echo 'ab.ac.ad.ae.afg.afh.afg.afh.afi.afj.' | ./$@ | $(TEE) $@.out + $(DIFF) $@.ref $@.out + rm -f $@.out + @echo + +clean : .FORCE + rm -f *~ *.o *.[pl]eg.[cd] $(EXAMPLES) + rm -rf *.dSYM + +spotless : clean + +.FORCE : diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/accept.c b/supportlibs/pegmarkdown/peg-0.1.9/examples/accept.c new file mode 100644 index 000000000..781e3b11d --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/accept.c @@ -0,0 +1,11 @@ +#include +#include + +#include "accept.peg.c" + +int main() +{ + while (yyparse()); + + return 0; +} diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/accept.peg b/supportlibs/pegmarkdown/peg-0.1.9/examples/accept.peg new file mode 100644 index 000000000..9b28e4040 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/accept.peg @@ -0,0 +1,8 @@ +start <- abcd+ + +abcd <- 'a' { printf("A %d\n", yypos); } bc { printf("ABC %d\n", yypos); } &{YYACCEPT} + / 'b' { printf("B %d\n", yypos); } cd { printf("BCD %d\n", yypos); } &{YYACCEPT} + +bc <- 'b' { printf("B %d\n", yypos); } 'c' { printf("C %d\n", yypos); } + +cd <- 'c' { printf("C %d\n", yypos); } 'd' { printf("D %d\n", yypos); } diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/accept.ref b/supportlibs/pegmarkdown/peg-0.1.9/examples/accept.ref new file mode 100644 index 000000000..789f52830 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/accept.ref @@ -0,0 +1,32 @@ +A 3 +B 3 +C 3 +ABC 3 +B 3 +C 3 +D 3 +BCD 3 +A 3 +B 3 +C 3 +ABC 3 +B 3 +C 3 +D 3 +BCD 3 +A 3 +B 3 +C 3 +ABC 3 +B 3 +C 3 +D 3 +BCD 3 +A 3 +B 3 +C 3 +ABC 3 +B 3 +C 3 +D 3 +BCD 3 diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/basic.leg b/supportlibs/pegmarkdown/peg-0.1.9/examples/basic.leg new file mode 100644 index 000000000..ed38a8d71 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/basic.leg @@ -0,0 +1,361 @@ +# A 'syntax-directed interpreter' (all execution is a side-effect of parsing). +# Inspired by Dennis Allison's original Tiny BASIC grammar, circa 1975. +# +# Copyright (c) 2007 by Ian Piumarta +# All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the 'Software'), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, provided that the above copyright notice(s) and this +# permission notice appear in all copies of the Software. Acknowledgement +# of the use of this Software in supporting documentation would be +# appreciated but is not required. +# +# THE SOFTWARE IS PROVIDED 'AS IS'. USE ENTIRELY AT YOUR OWN RISK. +# +# Last edited: 2012-04-29 15:14:06 by piumarta on emilia + +%{ +# include + + typedef struct line line; + + struct line + { + int number; + int length; + char *text; + }; + + line *lines= 0; + int numLines= 0; + int pc= -1, epc= -1; + int batch= 0; + + int nextline(char *buf, int max); + +# define min(x, y) ((x) < (y) ? (x) : (y)) + +# define YY_INPUT(buf, result, max_size) \ + { \ + if ((pc >= 0) && (pc < numLines)) \ + { \ + line *linep= lines+pc++; \ + result= min(max_size, linep->length); \ + memcpy(buf, linep->text, result); \ + } \ + else \ + result= nextline(buf, max_size); \ + } + + union value { + int number; + char *string; + int (*binop)(int lhs, int rhs); + }; + +# define YYSTYPE union value + + int variables[26]; + + void accept(int number, char *line); + + void save(char *name); + void load(char *name); + void type(char *name); + + int lessThan(int lhs, int rhs) { return lhs < rhs; } + int lessEqual(int lhs, int rhs) { return lhs <= rhs; } + int notEqual(int lhs, int rhs) { return lhs != rhs; } + int equalTo(int lhs, int rhs) { return lhs == rhs; } + int greaterEqual(int lhs, int rhs) { return lhs >= rhs; } + int greaterThan(int lhs, int rhs) { return lhs > rhs; } + + int input(void); + + int stack[1024], sp= 0; + + char *help; + + void error(char *fmt, ...); + int findLine(int n, int create); +%} + +line = - s:statement CR +| - n:number < ( !CR . )* CR > { accept(n.number, yytext); } +| - CR +| - < ( !CR . )* CR > { epc= pc; error("syntax error"); } +| - !. { exit(0); } + +statement = 'print'- expr-list +| 'if'- e1:expression r:relop e2:expression { if (!r.binop(e1.number, e2.number)) yythunkpos= 0; } + 'then'- statement +| 'goto'- e:expression { epc= pc; if ((pc= findLine(e.number, 0)) < 0) error("no such line"); } +| 'input'- var-list +| 'let'- v:var EQUAL e:expression { variables[v.number]= e.number; } +| 'gosub'- e:expression { epc= pc; if (sp < 1024) stack[sp++]= pc, pc= findLine(e.number, 0); else error("too many gosubs"); + if (pc < 0) error("no such line"); } +| 'return'- { epc= pc; if ((pc= sp ? stack[--sp] : -1) < 0) error("no gosub"); } +| 'clear'- { while (numLines) accept(lines->number, "\n"); } +| 'list'- { int i; for (i= 0; i < numLines; ++i) printf("%5d %s", lines[i].number, lines[i].text); } +| 'run'- s:string { load(s.string); pc= 0; } +| 'run'- { pc= 0; } +| 'end'- { pc= -1; if (batch) exit(0); } +| 'rem'- ( !CR . )* +| ('bye'|'quit'|'exit')- { exit(0); } +| 'save'- s:string { save(s.string); } +| 'load'- s:string { load(s.string); } +| 'type'- s:string { type(s.string); } +| 'dir'- { system("ls *.bas"); } +| 'help'- { fprintf(stderr, "%s", help); } + +expr-list = ( e:string { printf("%s", e.string); } + | e:expression { printf("%d", e.number); } + )? ( COMMA ( e:string { printf("%s", e.string); } + | e:expression { printf("%d", e.number); } + ) + )* ( COMMA + | !COMMA { printf("\n"); } + ) + +var-list = v:var { variables[v.number]= input(); } + ( COMMA v:var { variables[v.number]= input(); } + )* + +expression = ( PLUS? l:term + | MINUS l:term { l.number = -l.number } + ) ( PLUS r:term { l.number += r.number } + | MINUS r:term { l.number -= r.number } + )* { $$.number = l.number } + +term = l:factor ( STAR r:factor { l.number *= r.number } + | SLASH r:factor { l.number /= r.number } + )* { $$.number = l.number } + +factor = v:var { $$.number = variables[v.number] } +| n:number +| OPEN expression CLOSE + +var = < [a-z] > - { $$.number = yytext[0] - 'a' } + +number = < digit+ > - { $$.number = atoi(yytext); } + +digit = [0-9] + +string = '"' < [^\"]* > '"' - { $$.string = yytext; } + +relop = '<=' - { $$.binop= lessEqual; } +| '<>' - { $$.binop= notEqual; } +| '<' - { $$.binop= lessThan; } +| '>=' - { $$.binop= greaterEqual; } +| '>' - { $$.binop= greaterThan; } +| '=' - { $$.binop= equalTo; } + +EQUAL = '=' - CLOSE = ')' - OPEN = '(' - +SLASH = '/' - STAR = '*' - MINUS = '-' - +PLUS = '+' - COMMA = ',' - + +- = [ \t]* + +CR = '\n' | '\r' | '\r\n' + +%% + +#include +#include + +char *help= + "print | [, | ...] [,]\n" + "if <|<=|<>|=|>=|> then \n" + "input [, ...] let = \n" + "goto gosub \n" + "end return\n" + "list clear\n" + "run [\"filename\"] rem \n" + "dir type \"filename\"\n" + "save \"filename\" load \"filename\"\n" + "bye|quit|exit help\n" + ; + +void error(char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + if (epc > 0) + fprintf(stderr, "\nline %d: %s", lines[epc-1].number, lines[epc-1].text); + else + fprintf(stderr, "\n"); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); + epc= pc= -1; +} + +#ifdef USE_READLINE +# include +# include +#endif + +int nextline(char *buf, int max) +{ + pc= -1; + if (batch) exit(0); + if (isatty(fileno(stdin))) + { +# ifdef USE_READLINE + char *line= readline(">"); + if (line) + { + int len= strlen(line); + if (len >= max) len= max - 1; + strncpy(buf, line, len); + (buf)[len]= '\n'; + add_history(line); + free(line); + return len + 1; + } + else + { + printf("\n"); + return 0; + } +# endif + putchar('>'); + fflush(stdout); + } + return fgets(buf, max, stdin) ? strlen(buf) : 0; +} + +int maxLines= 0; + +int findLine(int n, int create) +{ + int lo= 0, hi= numLines - 1; + while (lo <= hi) + { + int mid= (lo + hi) / 2, lno= lines[mid].number; + if (lno > n) + hi= mid - 1; + else if (lno < n) + lo= mid + 1; + else + return mid; + } + if (create) + { + if (numLines == maxLines) + { + maxLines *= 2; + lines= realloc(lines, sizeof(line) * maxLines); + } + if (lo < numLines) + memmove(lines + lo + 1, lines + lo, sizeof(line) * (numLines - lo)); + ++numLines; + lines[lo].number= n; + lines[lo].text= 0; + return lo; + } + return -1; +} + +void accept(int n, char *s) +{ + if (s[0] < 32) /* delete */ + { + int lno= findLine(n, 0); + if (lno >= 0) + { + if (lno < numLines - 1) + memmove(lines + lno, lines + lno + 1, sizeof(line) * (numLines - lno - 1)); + --numLines; + } + } + else /* insert */ + { + int lno= findLine(n, 1); + if (lines[lno].text) free(lines[lno].text); + lines[lno].length= strlen(s); + lines[lno].text= strdup(s); + } +} + +char *extend(char *name) +{ + static char path[1024]; + int len= strlen(name); + sprintf(path, "%s%s", name, (((len > 4) && !strcasecmp(".bas", name + len - 4)) ? "" : ".bas")); + return path; +} + +void save(char *name) +{ + FILE *f= fopen(name= extend(name), "w"); + if (!f) + perror(name); + else + { + int i; + for (i= 0; i < numLines; ++i) + fprintf(f, "%d %s", lines[i].number, lines[i].text); + fclose(f); + } +} + +void load(char *name) +{ + FILE *f= fopen(name= extend(name), "r"); + if (!f) + perror(name); + else + { + int lineNumber; + char lineText[1024]; + while ((1 == fscanf(f, " %d ", &lineNumber)) && fgets(lineText, sizeof(lineText), f)) + accept(lineNumber, lineText); + fclose(f); + } +} + +void type(char *name) +{ + FILE *f= fopen(name= extend(name), "r"); + if (!f) + perror(name); + else + { + int c, d; + while ((c= getc(f)) >= 0) + putchar(d= c); + fclose(f); + if ('\n' != d && '\r' != d) putchar('\n'); + } +} + +int input(void) +{ + char line[32]; + fgets(line, sizeof(line), stdin); + return atoi(line); +} + +int main(int argc, char **argv) +{ + lines= malloc(sizeof(line) * (maxLines= 32)); + numLines= 0; + + if (argc > 1) + { + batch= 1; + while (argc-- > 1) + load(*++argv); + pc= 0; + } + + while (!feof(stdin)) + yyparse(); + + return 0; +} diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/basic.ref b/supportlibs/pegmarkdown/peg-0.1.9/examples/basic.ref new file mode 100644 index 000000000..90d916c89 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/basic.ref @@ -0,0 +1,10 @@ + 1 + 2 4 + 3 6 9 + 4 8 12 16 + 5 10 15 20 25 + 6 12 18 24 30 36 + 7 14 21 28 35 42 49 + 8 16 24 32 40 48 56 64 + 9 18 27 36 45 54 63 72 81 + 10 20 30 40 50 60 70 80 90 100 diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/bench.bas b/supportlibs/pegmarkdown/peg-0.1.9/examples/bench.bas new file mode 100644 index 000000000..ffdbd44ff --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/bench.bas @@ -0,0 +1,8 @@ +100 let n=100000 +120 let m=0 +110 let s=0 +130 let m=m+1 +140 let s=s+m +150 if m +int vars[26]; +%} + +Stmt = - e:Expr EOL { printf("%d\n", e); } + | ( !EOL . )* EOL { printf("error\n"); } + +Expr = i:ID ASSIGN s:Sum { $$= vars[i]= s; } + | s:Sum { $$= s; } + +Sum = l:Product + ( PLUS r:Product { l += r; } + | MINUS r:Product { l -= r; } + )* { $$= l; } + +Product = l:Value + ( TIMES r:Value { l *= r; } + | DIVIDE r:Value { l /= r; } + )* { $$= l; } + +Value = i:NUMBER { $$= atoi(yytext); } + | i:ID !ASSIGN { $$= vars[i]; } + | OPEN i:Expr CLOSE { $$= i; } + +NUMBER = < [0-9]+ > - { $$= atoi(yytext); } +ID = < [a-z] > - { $$= yytext[0] - 'a'; } +ASSIGN = '=' - +PLUS = '+' - +MINUS = '-' - +TIMES = '*' - +DIVIDE = '/' - +OPEN = '(' - +CLOSE = ')' - + +- = [ \t]* +EOL = '\n' | '\r\n' | '\r' | ';' + +%% + +int main() +{ + while (yyparse()); + + return 0; +} diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/calc.ref b/supportlibs/pegmarkdown/peg-0.1.9/examples/calc.ref new file mode 100644 index 000000000..dbd7d59ec --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/calc.ref @@ -0,0 +1,3 @@ +6 +7 +42 diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/dc.c b/supportlibs/pegmarkdown/peg-0.1.9/examples/dc.c new file mode 100644 index 000000000..32bf1a54a --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/dc.c @@ -0,0 +1,17 @@ +#include +#include + +int stack[1024]; +int stackp= -1; + +int push(int n) { return stack[++stackp]= n; } +int pop(void) { return stack[stackp--]; } + +#include "dc.peg.c" + +int main() +{ + while (yyparse()); + + return 0; +} diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/dc.peg b/supportlibs/pegmarkdown/peg-0.1.9/examples/dc.peg new file mode 100644 index 000000000..75dcb6719 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/dc.peg @@ -0,0 +1,27 @@ +# Grammar + +Expr <- SPACE Sum EOL { printf("%d\n", pop()); } + / (!EOL .)* EOL { printf("error\n"); } + +Sum <- Product ( PLUS Product { int r= pop(), l= pop(); push(l + r); } + / MINUS Product { int r= pop(), l= pop(); push(l - r); } + )* + +Product <- Value ( TIMES Value { int r= pop(), l= pop(); push(l * r); } + / DIVIDE Value { int r= pop(), l= pop(); push(l / r); } + )* + +Value <- NUMBER { push(atoi(yytext)); } + / OPEN Sum CLOSE + +# Lexemes + +NUMBER <- < [0-9]+ > SPACE +PLUS <- '+' SPACE +MINUS <- '-' SPACE +TIMES <- '*' SPACE +DIVIDE <- '/' SPACE +OPEN <- '(' SPACE +CLOSE <- ')' SPACE +SPACE <- [ \t]* +EOL <- '\n' / '\r\n' / '\r' diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/dc.ref b/supportlibs/pegmarkdown/peg-0.1.9/examples/dc.ref new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/dc.ref @@ -0,0 +1 @@ +42 diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/dcv.c b/supportlibs/pegmarkdown/peg-0.1.9/examples/dcv.c new file mode 100644 index 000000000..0c5c46d85 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/dcv.c @@ -0,0 +1,20 @@ +#include +#include + +int stack[1024]; +int stackp= -1; +int var= 0; +int vars[26]; + +int push(int n) { return stack[++stackp]= n; } +int pop(void) { return stack[stackp--]; } +int top(void) { return stack[stackp]; } + +#include "dcv.peg.c" + +int main() +{ + while (yyparse()); + + return 0; +} diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/dcv.peg b/supportlibs/pegmarkdown/peg-0.1.9/examples/dcv.peg new file mode 100644 index 000000000..2ae3a8cb0 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/dcv.peg @@ -0,0 +1,34 @@ +# Grammar + +Stmt <- SPACE Expr EOL { printf("%d\n", pop()); } + / (!EOL .)* EOL { printf("error\n"); } + +Expr <- ID { var= yytext[0] } ASSIGN Sum { vars[var - 'a']= top(); } + / Sum + +Sum <- Product ( PLUS Product { int r= pop(), l= pop(); push(l + r); } + / MINUS Product { int r= pop(), l= pop(); push(l - r); } + )* + +Product <- Value ( TIMES Value { int r= pop(), l= pop(); push(l * r); } + / DIVIDE Value { int r= pop(), l= pop(); push(l / r); } + )* + +Value <- NUMBER { push(atoi(yytext)); } + / < ID > !ASSIGN { push(vars[yytext[0] - 'a']); } + / OPEN Expr CLOSE + +# Lexemes + +NUMBER <- < [0-9]+ > SPACE +ID <- < [a-z] > SPACE +ASSIGN <- '=' SPACE +PLUS <- '+' SPACE +MINUS <- '-' SPACE +TIMES <- '*' SPACE +DIVIDE <- '/' SPACE +OPEN <- '(' SPACE +CLOSE <- ')' SPACE + +SPACE <- [ \t]* +EOL <- '\n' / '\r\n' / '\r' / ';' diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/dcv.ref b/supportlibs/pegmarkdown/peg-0.1.9/examples/dcv.ref new file mode 100644 index 000000000..dbd7d59ec --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/dcv.ref @@ -0,0 +1,3 @@ +6 +7 +42 diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/fibonacci.bas b/supportlibs/pegmarkdown/peg-0.1.9/examples/fibonacci.bas new file mode 100644 index 000000000..1872bd3b2 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/fibonacci.bas @@ -0,0 +1,17 @@ +100 let n=32 +110 gosub 200 +120 print "fibonacci(",n,") = ", m +130 end + +200 let c=n +210 let b=1 +220 if c<2 then goto 400 +230 let c=c-1 +240 let a=1 +300 let c=c-1 +310 let d=a+b +320 let a=b +330 let b=d+1 +340 if c<>0 then goto 300 +400 let m=b +410 return diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/left.c b/supportlibs/pegmarkdown/peg-0.1.9/examples/left.c new file mode 100644 index 000000000..ac8cd0bd8 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/left.c @@ -0,0 +1,17 @@ +#include + +#define YY_INPUT(buf, result, max) \ +{ \ + int c= getchar(); \ + result= (EOF == c) ? 0 : (*(buf)= c, 1); \ + if (EOF != c) printf("<%c>\n", c); \ +} + +#include "left.peg.c" + +int main() +{ + printf(yyparse() ? "success\n" : "failure\n"); + + return 0; +} diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/left.peg b/supportlibs/pegmarkdown/peg-0.1.9/examples/left.peg new file mode 100644 index 000000000..f282227d5 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/left.peg @@ -0,0 +1,3 @@ +# Grammar + +S <- (S 'a' / 'a') !'a' diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/localctx.c b/supportlibs/pegmarkdown/peg-0.1.9/examples/localctx.c new file mode 100644 index 000000000..837ebc884 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/localctx.c @@ -0,0 +1,13 @@ +#include + +#define YY_CTX_LOCAL + +#include "test.peg.c" + +int main() +{ + yycontext ctx; + memset(&ctx, 0, sizeof(yycontext)); + while (yyparse(&ctx)); + return 0; +} diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/localctx.ref b/supportlibs/pegmarkdown/peg-0.1.9/examples/localctx.ref new file mode 100644 index 000000000..2d181091a --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/localctx.ref @@ -0,0 +1,10 @@ +a1 ab1 . +a2 ac2 . +a3 ad3 . +a3 ae3 . +a4 af4 afg4 . +a4 af5 afh5 . +a4 af4 afg4 . +a4 af5 afh5 . +af6 afi6 a6 . +af6 af7 afj7 a6 . diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/rule.c b/supportlibs/pegmarkdown/peg-0.1.9/examples/rule.c new file mode 100644 index 000000000..15eb0c64b --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/rule.c @@ -0,0 +1,11 @@ +#include +#include + +#include "rule.peg.c" + +int main() +{ + while (yyparse()); + + return 0; +} diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/rule.peg b/supportlibs/pegmarkdown/peg-0.1.9/examples/rule.peg new file mode 100644 index 000000000..60a32faa1 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/rule.peg @@ -0,0 +1,8 @@ +start <- abcd+ + +abcd <- 'a' { printf("A %d\n", yypos); } bc { printf("ABC %d\n", yypos); } + / 'b' { printf("B %d\n", yypos); } cd { printf("BCD %d\n", yypos); } + +bc <- 'b' { printf("B %d\n", yypos); } 'c' { printf("C %d\n", yypos); } + +cd <- 'c' { printf("C %d\n", yypos); } 'd' { printf("D %d\n", yypos); } diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/rule.ref b/supportlibs/pegmarkdown/peg-0.1.9/examples/rule.ref new file mode 100644 index 000000000..4249ebec5 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/rule.ref @@ -0,0 +1,32 @@ +A 24 +B 24 +C 24 +ABC 24 +B 24 +C 24 +D 24 +BCD 24 +A 24 +B 24 +C 24 +ABC 24 +B 24 +C 24 +D 24 +BCD 24 +A 24 +B 24 +C 24 +ABC 24 +B 24 +C 24 +D 24 +BCD 24 +A 24 +B 24 +C 24 +ABC 24 +B 24 +C 24 +D 24 +BCD 24 diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/test.bas b/supportlibs/pegmarkdown/peg-0.1.9/examples/test.bas new file mode 100644 index 000000000..8a96e1070 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/test.bas @@ -0,0 +1,12 @@ +10 let i=1 +20 gosub 100 +30 let i=i+1 +40 if i<=10 then goto 20 +50 end + +100 let j=1 +110 print " ", i*j, +120 let j=j+1 +130 if j<=i then goto 110 +140 print +150 return diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/test.c b/supportlibs/pegmarkdown/peg-0.1.9/examples/test.c new file mode 100644 index 000000000..0403422c3 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/test.c @@ -0,0 +1,8 @@ +#include +#include "test.peg.c" + +int main() +{ + while (yyparse()); + return 0; +} diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/test.peg b/supportlibs/pegmarkdown/peg-0.1.9/examples/test.peg new file mode 100644 index 000000000..716d52372 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/test.peg @@ -0,0 +1,13 @@ +start <- body '.' { printf(".\n"); } + +body <- 'a' { printf("a1 "); } 'b' { printf("ab1 "); } + + / 'a' { printf("a2 "); } 'c' { printf("ac2 "); } + + / 'a' { printf("a3 "); } ( 'd' { printf("ad3 "); } / 'e' { printf("ae3 "); } ) + + / 'a' { printf("a4 "); } ( 'f' { printf("af4 "); } 'g' { printf("afg4 "); } + / 'f' { printf("af5 "); } 'h' { printf("afh5 "); } ) + + / 'a' { printf("a6 "); } ( 'f' &{ printf("af6 ") } 'i' &{ printf("afi6 ") } + / 'f' &{ printf("af7 ") } 'j' &{ printf("afj7 ") } ) diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/test.ref b/supportlibs/pegmarkdown/peg-0.1.9/examples/test.ref new file mode 100644 index 000000000..2d181091a --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/test.ref @@ -0,0 +1,10 @@ +a1 ab1 . +a2 ac2 . +a3 ad3 . +a3 ae3 . +a4 af4 afg4 . +a4 af5 afh5 . +a4 af4 afg4 . +a4 af5 afh5 . +af6 afi6 a6 . +af6 af7 afj7 a6 . diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/username.leg b/supportlibs/pegmarkdown/peg-0.1.9/examples/username.leg new file mode 100644 index 000000000..2170052aa --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/username.leg @@ -0,0 +1,14 @@ +%{ +#include +%} + +start = "username" { printf("%s", getlogin()); } +| < . > { putchar(yytext[0]); } + +%% + +int main() +{ + while (yyparse()); + return 0; +} diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/wc.leg b/supportlibs/pegmarkdown/peg-0.1.9/examples/wc.leg new file mode 100644 index 000000000..59199c89f --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/wc.leg @@ -0,0 +1,22 @@ +%{ +#include +int lines= 0, words= 0, chars= 0; +%} + +start = (line | word | char) + +line = < (( '\n' '\r'* ) | ( '\r' '\n'* )) > { lines++; chars += yyleng; } +word = < [a-zA-Z]+ > { words++; chars += yyleng; printf("<%s>\n", yytext); } +char = . { chars++; } + +%% + +int main() +{ + while (yyparse()) + ; + printf("%d lines\n", lines); + printf("%d chars\n", chars); + printf("%d words\n", words); + return 0; +} diff --git a/supportlibs/pegmarkdown/peg-0.1.9/examples/wc.ref b/supportlibs/pegmarkdown/peg-0.1.9/examples/wc.ref new file mode 100644 index 000000000..083a46e64 --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/examples/wc.ref @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + +22 lines +425 chars +52 words diff --git a/supportlibs/pegmarkdown/peg-0.1.9/leg.c b/supportlibs/pegmarkdown/peg-0.1.9/leg.c new file mode 100644 index 000000000..91b696d1e --- /dev/null +++ b/supportlibs/pegmarkdown/peg-0.1.9/leg.c @@ -0,0 +1,1209 @@ +/* A recursive-descent parser generated by peg 0.1.9 */ + +#include +#include +#include +#define YYRULECOUNT 36 + +# include "tree.h" +# include "version.h" + +# include +# include +# include +# include +# include +# include + + typedef struct Header Header; + + struct Header { + char *text; + Header *next; + }; + + FILE *input= 0; + + int verboseFlag= 0; + + static int lineNumber= 0; + static char *fileName= 0; + static char *trailer= 0; + static Header *headers= 0; + + void makeHeader(char *text); + void makeTrailer(char *text); + + void yyerror(char *message); + +# define YY_INPUT(buf, result, max) \ + { \ + int c= getc(input); \ + if ('\n' == c || '\r' == c) ++lineNumber; \ + result= (EOF == c) ? 0 : (*(buf)= c, 1); \ + } + +# define YY_LOCAL(T) static T +# define YY_RULE(T) static T + +#ifndef YY_LOCAL +#define YY_LOCAL(T) static T +#endif +#ifndef YY_ACTION +#define YY_ACTION(T) static T +#endif +#ifndef YY_RULE +#define YY_RULE(T) static T +#endif +#ifndef YY_PARSE +#define YY_PARSE(T) T +#endif +#ifndef YYPARSE +#define YYPARSE yyparse +#endif +#ifndef YYPARSEFROM +#define YYPARSEFROM yyparsefrom +#endif +#ifndef YY_INPUT +#define YY_INPUT(buf, result, max_size) \ + { \ + int yyc= getchar(); \ + result= (EOF == yyc) ? 0 : (*(buf)= yyc, 1); \ + yyprintf((stderr, "<%c>", yyc)); \ + } +#endif +#ifndef YY_BEGIN +#define YY_BEGIN ( ctx->begin= ctx->pos, 1) +#endif +#ifndef YY_END +#define YY_END ( ctx->end= ctx->pos, 1) +#endif +#ifdef YY_DEBUG +# define yyprintf(args) fprintf args +#else +# define yyprintf(args) +#endif +#ifndef YYSTYPE +#define YYSTYPE int +#endif + +#ifndef YY_PART + +typedef struct _yycontext yycontext; +typedef void (*yyaction)(yycontext *ctx, char *yytext, int yyleng); +typedef struct _yythunk { int begin, end; yyaction action; struct _yythunk *next; } yythunk; + +struct _yycontext { + char *buf; + int buflen; + int pos; + int limit; + char *text; + int textlen; + int begin; + int end; + int textmax; + yythunk *thunks; + int thunkslen; + int thunkpos; + YYSTYPE yy; + YYSTYPE *val; + YYSTYPE *vals; + int valslen; +#ifdef YY_CTX_MEMBERS + YY_CTX_MEMBERS +#endif +}; + +#ifdef YY_CTX_LOCAL +#define YY_CTX_PARAM_ yycontext *yyctx, +#define YY_CTX_PARAM yycontext *yyctx +#define YY_CTX_ARG_ yyctx, +#define YY_CTX_ARG yyctx +#else +#define YY_CTX_PARAM_ +#define YY_CTX_PARAM +#define YY_CTX_ARG_ +#define YY_CTX_ARG +yycontext yyctx0; +yycontext *yyctx= &yyctx0; +#endif + +YY_LOCAL(int) yyrefill(yycontext *ctx) +{ + int yyn; + while (ctx->buflen - ctx->pos < 512) + { + ctx->buflen *= 2; + ctx->buf= (char *)realloc(ctx->buf, ctx->buflen); + } + YY_INPUT((ctx->buf + ctx->pos), yyn, (ctx->buflen - ctx->pos)); + if (!yyn) return 0; + ctx->limit += yyn; + return 1; +} + +YY_LOCAL(int) yymatchDot(yycontext *ctx) +{ + if (ctx->pos >= ctx->limit && !yyrefill(ctx)) return 0; + ++ctx->pos; + return 1; +} + +YY_LOCAL(int) yymatchChar(yycontext *ctx, int c) +{ + if (ctx->pos >= ctx->limit && !yyrefill(ctx)) return 0; + if ((unsigned char)ctx->buf[ctx->pos] == c) + { + ++ctx->pos; + yyprintf((stderr, " ok yymatchChar(ctx, %c) @ %s\n", c, ctx->buf+ctx->pos)); + return 1; + } + yyprintf((stderr, " fail yymatchChar(ctx, %c) @ %s\n", c, ctx->buf+ctx->pos)); + return 0; +} + +YY_LOCAL(int) yymatchString(yycontext *ctx, char *s) +{ + int yysav= ctx->pos; + while (*s) + { + if (ctx->pos >= ctx->limit && !yyrefill(ctx)) return 0; + if (ctx->buf[ctx->pos] != *s) + { + ctx->pos= yysav; + return 0; + } + ++s; + ++ctx->pos; + } + return 1; +} + +YY_LOCAL(int) yymatchClass(yycontext *ctx, unsigned char *bits) +{ + int c; + if (ctx->pos >= ctx->limit && !yyrefill(ctx)) return 0; + c= (unsigned char)ctx->buf[ctx->pos]; + if (bits[c >> 3] & (1 << (c & 7))) + { + ++ctx->pos; + yyprintf((stderr, " ok yymatchClass @ %s\n", ctx->buf+ctx->pos)); + return 1; + } + yyprintf((stderr, " fail yymatchClass @ %s\n", ctx->buf+ctx->pos)); + return 0; +} + +YY_LOCAL(void) yyDo(yycontext *ctx, yyaction action, int begin, int end) +{ + while (ctx->thunkpos >= ctx->thunkslen) + { + ctx->thunkslen *= 2; + ctx->thunks= (yythunk *)realloc(ctx->thunks, sizeof(yythunk) * ctx->thunkslen); + } + ctx->thunks[ctx->thunkpos].begin= begin; + ctx->thunks[ctx->thunkpos].end= end; + ctx->thunks[ctx->thunkpos].action= action; + ++ctx->thunkpos; +} + +YY_LOCAL(int) yyText(yycontext *ctx, int begin, int end) +{ + int yyleng= end - begin; + if (yyleng <= 0) + yyleng= 0; + else + { + while (ctx->textlen < (yyleng + 1)) + { + ctx->textlen *= 2; + ctx->text= (char *)realloc(ctx->text, ctx->textlen); + } + memcpy(ctx->text, ctx->buf + begin, yyleng); + } + ctx->text[yyleng]= '\0'; + return yyleng; +} + +YY_LOCAL(void) yyDone(yycontext *ctx) +{ + int pos; + for (pos= 0; pos < ctx->thunkpos; ++pos) + { + yythunk *thunk= &ctx->thunks[pos]; + int yyleng= thunk->end ? yyText(ctx, thunk->begin, thunk->end) : thunk->begin; + yyprintf((stderr, "DO [%d] %p %s\n", pos, thunk->action, ctx->text)); + thunk->action(ctx, ctx->text, yyleng); + } + ctx->thunkpos= 0; +} + +YY_LOCAL(void) yyCommit(yycontext *ctx) +{ + if ((ctx->limit -= ctx->pos)) + { + memmove(ctx->buf, ctx->buf + ctx->pos, ctx->limit); + } + ctx->begin -= ctx->pos; + ctx->end -= ctx->pos; + ctx->pos= ctx->thunkpos= 0; +} + +YY_LOCAL(int) yyAccept(yycontext *ctx, int tp0) +{ + if (tp0) + { + fprintf(stderr, "accept denied at %d\n", tp0); + return 0; + } + else + { + yyDone(ctx); + yyCommit(ctx); + } + return 1; +} + +YY_LOCAL(void) yyPush(yycontext *ctx, char *text, int count) { ctx->val += count; } +YY_LOCAL(void) yyPop(yycontext *ctx, char *text, int count) { ctx->val -= count; } +YY_LOCAL(void) yySet(yycontext *ctx, char *text, int count) { ctx->val[count]= ctx->yy; } + +#endif /* YY_PART */ + +#define YYACCEPT yyAccept(ctx, yythunkpos0) + +YY_RULE(int) yy_end_of_line(yycontext *ctx); /* 36 */ +YY_RULE(int) yy_comment(yycontext *ctx); /* 35 */ +YY_RULE(int) yy_space(yycontext *ctx); /* 34 */ +YY_RULE(int) yy_braces(yycontext *ctx); /* 33 */ +YY_RULE(int) yy_range(yycontext *ctx); /* 32 */ +YY_RULE(int) yy_char(yycontext *ctx); /* 31 */ +YY_RULE(int) yy_END(yycontext *ctx); /* 30 */ +YY_RULE(int) yy_BEGIN(yycontext *ctx); /* 29 */ +YY_RULE(int) yy_DOT(yycontext *ctx); /* 28 */ +YY_RULE(int) yy_class(yycontext *ctx); /* 27 */ +YY_RULE(int) yy_literal(yycontext *ctx); /* 26 */ +YY_RULE(int) yy_CLOSE(yycontext *ctx); /* 25 */ +YY_RULE(int) yy_OPEN(yycontext *ctx); /* 24 */ +YY_RULE(int) yy_COLON(yycontext *ctx); /* 23 */ +YY_RULE(int) yy_PLUS(yycontext *ctx); /* 22 */ +YY_RULE(int) yy_STAR(yycontext *ctx); /* 21 */ +YY_RULE(int) yy_QUESTION(yycontext *ctx); /* 20 */ +YY_RULE(int) yy_primary(yycontext *ctx); /* 19 */ +YY_RULE(int) yy_NOT(yycontext *ctx); /* 18 */ +YY_RULE(int) yy_suffix(yycontext *ctx); /* 17 */ +YY_RULE(int) yy_action(yycontext *ctx); /* 16 */ +YY_RULE(int) yy_AND(yycontext *ctx); /* 15 */ +YY_RULE(int) yy_prefix(yycontext *ctx); /* 14 */ +YY_RULE(int) yy_BAR(yycontext *ctx); /* 13 */ +YY_RULE(int) yy_sequence(yycontext *ctx); /* 12 */ +YY_RULE(int) yy_SEMICOLON(yycontext *ctx); /* 11 */ +YY_RULE(int) yy_expression(yycontext *ctx); /* 10 */ +YY_RULE(int) yy_EQUAL(yycontext *ctx); /* 9 */ +YY_RULE(int) yy_identifier(yycontext *ctx); /* 8 */ +YY_RULE(int) yy_RPERCENT(yycontext *ctx); /* 7 */ +YY_RULE(int) yy_end_of_file(yycontext *ctx); /* 6 */ +YY_RULE(int) yy_trailer(yycontext *ctx); /* 5 */ +YY_RULE(int) yy_definition(yycontext *ctx); /* 4 */ +YY_RULE(int) yy_declaration(yycontext *ctx); /* 3 */ +YY_RULE(int) yy__(yycontext *ctx); /* 2 */ +YY_RULE(int) yy_grammar(yycontext *ctx); /* 1 */ + +YY_ACTION(void) yy_9_primary(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_9_primary\n")); + push(makePredicate("YY_END")); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_8_primary(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_8_primary\n")); + push(makePredicate("YY_BEGIN")); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_7_primary(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_7_primary\n")); + push(makeAction(yytext)); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_6_primary(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_6_primary\n")); + push(makeDot()); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_5_primary(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_5_primary\n")); + push(makeClass(yytext)); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_4_primary(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_4_primary\n")); + push(makeString(yytext)); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_3_primary(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_3_primary\n")); + push(makeName(findRule(yytext))); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_2_primary(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_primary\n")); + Node *name= makeName(findRule(yytext)); name->name.variable= pop(); push(name); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_primary(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_primary\n")); + push(makeVariable(yytext)); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_3_suffix(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_3_suffix\n")); + push(makePlus (pop())); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_2_suffix(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_suffix\n")); + push(makeStar (pop())); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_suffix(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_suffix\n")); + push(makeQuery(pop())); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_3_prefix(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_3_prefix\n")); + push(makePeekNot(pop())); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_2_prefix(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_prefix\n")); + push(makePeekFor(pop())); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_prefix(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_prefix\n")); + push(makePredicate(yytext)); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_sequence(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_sequence\n")); + Node *f= pop(); push(Sequence_append(pop(), f)); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_expression(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_expression\n")); + Node *f= pop(); push(Alternate_append(pop(), f)); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_2_definition(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_2_definition\n")); + Node *e= pop(); Rule_setExpression(pop(), e); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_definition(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_definition\n")); + if (push(beginRule(findRule(yytext)))->rule.expression) + fprintf(stderr, "rule '%s' redefined\n", yytext); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_trailer(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_trailer\n")); + makeTrailer(yytext); ; +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_1_declaration(yycontext *ctx, char *yytext, int yyleng) +{ +#define yy ctx->yy +#define yypos ctx->pos +#define yythunkpos ctx->thunkpos + yyprintf((stderr, "do yy_1_declaration\n")); + makeHeader(yytext); ; +#undef yythunkpos +#undef yypos +#undef yy +} + +YY_RULE(int) yy_end_of_line(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "end_of_line")); + { int yypos2= ctx->pos, yythunkpos2= ctx->thunkpos; if (!yymatchString(ctx, "\r\n")) goto l3; goto l2; + l3:; ctx->pos= yypos2; ctx->thunkpos= yythunkpos2; if (!yymatchChar(ctx, '\n')) goto l4; goto l2; + l4:; ctx->pos= yypos2; ctx->thunkpos= yythunkpos2; if (!yymatchChar(ctx, '\r')) goto l1; + } + l2:; + yyprintf((stderr, " ok %s @ %s\n", "end_of_line", ctx->buf+ctx->pos)); + return 1; + l1:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "end_of_line", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_comment(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "comment")); if (!yymatchChar(ctx, '#')) goto l5; + l6:; + { int yypos7= ctx->pos, yythunkpos7= ctx->thunkpos; + { int yypos8= ctx->pos, yythunkpos8= ctx->thunkpos; if (!yy_end_of_line(ctx)) goto l8; goto l7; + l8:; ctx->pos= yypos8; ctx->thunkpos= yythunkpos8; + } if (!yymatchDot(ctx)) goto l7; goto l6; + l7:; ctx->pos= yypos7; ctx->thunkpos= yythunkpos7; + } if (!yy_end_of_line(ctx)) goto l5; + yyprintf((stderr, " ok %s @ %s\n", "comment", ctx->buf+ctx->pos)); + return 1; + l5:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "comment", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_space(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "space")); + { int yypos10= ctx->pos, yythunkpos10= ctx->thunkpos; if (!yymatchChar(ctx, ' ')) goto l11; goto l10; + l11:; ctx->pos= yypos10; ctx->thunkpos= yythunkpos10; if (!yymatchChar(ctx, '\t')) goto l12; goto l10; + l12:; ctx->pos= yypos10; ctx->thunkpos= yythunkpos10; if (!yy_end_of_line(ctx)) goto l9; + } + l10:; + yyprintf((stderr, " ok %s @ %s\n", "space", ctx->buf+ctx->pos)); + return 1; + l9:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "space", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_braces(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "braces")); + { int yypos14= ctx->pos, yythunkpos14= ctx->thunkpos; if (!yymatchChar(ctx, '{')) goto l15; + l16:; + { int yypos17= ctx->pos, yythunkpos17= ctx->thunkpos; if (!yy_braces(ctx)) goto l17; goto l16; + l17:; ctx->pos= yypos17; ctx->thunkpos= yythunkpos17; + } if (!yymatchChar(ctx, '}')) goto l15; goto l14; + l15:; ctx->pos= yypos14; ctx->thunkpos= yythunkpos14; + { int yypos18= ctx->pos, yythunkpos18= ctx->thunkpos; if (!yymatchChar(ctx, '}')) goto l18; goto l13; + l18:; ctx->pos= yypos18; ctx->thunkpos= yythunkpos18; + } if (!yymatchDot(ctx)) goto l13; + } + l14:; + yyprintf((stderr, " ok %s @ %s\n", "braces", ctx->buf+ctx->pos)); + return 1; + l13:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "braces", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_range(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "range")); + { int yypos20= ctx->pos, yythunkpos20= ctx->thunkpos; if (!yy_char(ctx)) goto l21; if (!yymatchChar(ctx, '-')) goto l21; if (!yy_char(ctx)) goto l21; goto l20; + l21:; ctx->pos= yypos20; ctx->thunkpos= yythunkpos20; if (!yy_char(ctx)) goto l19; + } + l20:; + yyprintf((stderr, " ok %s @ %s\n", "range", ctx->buf+ctx->pos)); + return 1; + l19:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "range", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_char(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "char")); + { int yypos23= ctx->pos, yythunkpos23= ctx->thunkpos; if (!yymatchChar(ctx, '\\')) goto l24; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\204\040\000\000\000\000\000\070\146\100\124\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l24; goto l23; + l24:; ctx->pos= yypos23; ctx->thunkpos= yythunkpos23; if (!yymatchChar(ctx, '\\')) goto l25; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\017\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l25; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l25; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l25; goto l23; + l25:; ctx->pos= yypos23; ctx->thunkpos= yythunkpos23; if (!yymatchChar(ctx, '\\')) goto l26; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l26; + { int yypos27= ctx->pos, yythunkpos27= ctx->thunkpos; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\000\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l27; goto l28; + l27:; ctx->pos= yypos27; ctx->thunkpos= yythunkpos27; + } + l28:; goto l23; + l26:; ctx->pos= yypos23; ctx->thunkpos= yythunkpos23; + { int yypos29= ctx->pos, yythunkpos29= ctx->thunkpos; if (!yymatchChar(ctx, '\\')) goto l29; goto l22; + l29:; ctx->pos= yypos29; ctx->thunkpos= yythunkpos29; + } if (!yymatchDot(ctx)) goto l22; + } + l23:; + yyprintf((stderr, " ok %s @ %s\n", "char", ctx->buf+ctx->pos)); + return 1; + l22:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "char", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_END(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "END")); if (!yymatchChar(ctx, '>')) goto l30; if (!yy__(ctx)) goto l30; + yyprintf((stderr, " ok %s @ %s\n", "END", ctx->buf+ctx->pos)); + return 1; + l30:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "END", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_BEGIN(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "BEGIN")); if (!yymatchChar(ctx, '<')) goto l31; if (!yy__(ctx)) goto l31; + yyprintf((stderr, " ok %s @ %s\n", "BEGIN", ctx->buf+ctx->pos)); + return 1; + l31:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "BEGIN", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_DOT(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "DOT")); if (!yymatchChar(ctx, '.')) goto l32; if (!yy__(ctx)) goto l32; + yyprintf((stderr, " ok %s @ %s\n", "DOT", ctx->buf+ctx->pos)); + return 1; + l32:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "DOT", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_class(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "class")); if (!yymatchChar(ctx, '[')) goto l33; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l33; + l34:; + { int yypos35= ctx->pos, yythunkpos35= ctx->thunkpos; + { int yypos36= ctx->pos, yythunkpos36= ctx->thunkpos; if (!yymatchChar(ctx, ']')) goto l36; goto l35; + l36:; ctx->pos= yypos36; ctx->thunkpos= yythunkpos36; + } if (!yy_range(ctx)) goto l35; goto l34; + l35:; ctx->pos= yypos35; ctx->thunkpos= yythunkpos35; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l33; if (!yymatchChar(ctx, ']')) goto l33; if (!yy__(ctx)) goto l33; + yyprintf((stderr, " ok %s @ %s\n", "class", ctx->buf+ctx->pos)); + return 1; + l33:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "class", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_literal(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "literal")); + { int yypos38= ctx->pos, yythunkpos38= ctx->thunkpos; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l39; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l39; + l40:; + { int yypos41= ctx->pos, yythunkpos41= ctx->thunkpos; + { int yypos42= ctx->pos, yythunkpos42= ctx->thunkpos; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l42; goto l41; + l42:; ctx->pos= yypos42; ctx->thunkpos= yythunkpos42; + } if (!yy_char(ctx)) goto l41; goto l40; + l41:; ctx->pos= yypos41; ctx->thunkpos= yythunkpos41; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l39; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l39; if (!yy__(ctx)) goto l39; goto l38; + l39:; ctx->pos= yypos38; ctx->thunkpos= yythunkpos38; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l37; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l37; + l43:; + { int yypos44= ctx->pos, yythunkpos44= ctx->thunkpos; + { int yypos45= ctx->pos, yythunkpos45= ctx->thunkpos; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l45; goto l44; + l45:; ctx->pos= yypos45; ctx->thunkpos= yythunkpos45; + } if (!yy_char(ctx)) goto l44; goto l43; + l44:; ctx->pos= yypos44; ctx->thunkpos= yythunkpos44; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l37; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l37; if (!yy__(ctx)) goto l37; + } + l38:; + yyprintf((stderr, " ok %s @ %s\n", "literal", ctx->buf+ctx->pos)); + return 1; + l37:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "literal", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_CLOSE(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "CLOSE")); if (!yymatchChar(ctx, ')')) goto l46; if (!yy__(ctx)) goto l46; + yyprintf((stderr, " ok %s @ %s\n", "CLOSE", ctx->buf+ctx->pos)); + return 1; + l46:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "CLOSE", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_OPEN(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "OPEN")); if (!yymatchChar(ctx, '(')) goto l47; if (!yy__(ctx)) goto l47; + yyprintf((stderr, " ok %s @ %s\n", "OPEN", ctx->buf+ctx->pos)); + return 1; + l47:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "OPEN", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_COLON(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "COLON")); if (!yymatchChar(ctx, ':')) goto l48; if (!yy__(ctx)) goto l48; + yyprintf((stderr, " ok %s @ %s\n", "COLON", ctx->buf+ctx->pos)); + return 1; + l48:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "COLON", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_PLUS(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "PLUS")); if (!yymatchChar(ctx, '+')) goto l49; if (!yy__(ctx)) goto l49; + yyprintf((stderr, " ok %s @ %s\n", "PLUS", ctx->buf+ctx->pos)); + return 1; + l49:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "PLUS", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_STAR(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "STAR")); if (!yymatchChar(ctx, '*')) goto l50; if (!yy__(ctx)) goto l50; + yyprintf((stderr, " ok %s @ %s\n", "STAR", ctx->buf+ctx->pos)); + return 1; + l50:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "STAR", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_QUESTION(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "QUESTION")); if (!yymatchChar(ctx, '?')) goto l51; if (!yy__(ctx)) goto l51; + yyprintf((stderr, " ok %s @ %s\n", "QUESTION", ctx->buf+ctx->pos)); + return 1; + l51:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "QUESTION", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_primary(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "primary")); + { int yypos53= ctx->pos, yythunkpos53= ctx->thunkpos; if (!yy_identifier(ctx)) goto l54; yyDo(ctx, yy_1_primary, ctx->begin, ctx->end); if (!yy_COLON(ctx)) goto l54; if (!yy_identifier(ctx)) goto l54; + { int yypos55= ctx->pos, yythunkpos55= ctx->thunkpos; if (!yy_EQUAL(ctx)) goto l55; goto l54; + l55:; ctx->pos= yypos55; ctx->thunkpos= yythunkpos55; + } yyDo(ctx, yy_2_primary, ctx->begin, ctx->end); goto l53; + l54:; ctx->pos= yypos53; ctx->thunkpos= yythunkpos53; if (!yy_identifier(ctx)) goto l56; + { int yypos57= ctx->pos, yythunkpos57= ctx->thunkpos; if (!yy_EQUAL(ctx)) goto l57; goto l56; + l57:; ctx->pos= yypos57; ctx->thunkpos= yythunkpos57; + } yyDo(ctx, yy_3_primary, ctx->begin, ctx->end); goto l53; + l56:; ctx->pos= yypos53; ctx->thunkpos= yythunkpos53; if (!yy_OPEN(ctx)) goto l58; if (!yy_expression(ctx)) goto l58; if (!yy_CLOSE(ctx)) goto l58; goto l53; + l58:; ctx->pos= yypos53; ctx->thunkpos= yythunkpos53; if (!yy_literal(ctx)) goto l59; yyDo(ctx, yy_4_primary, ctx->begin, ctx->end); goto l53; + l59:; ctx->pos= yypos53; ctx->thunkpos= yythunkpos53; if (!yy_class(ctx)) goto l60; yyDo(ctx, yy_5_primary, ctx->begin, ctx->end); goto l53; + l60:; ctx->pos= yypos53; ctx->thunkpos= yythunkpos53; if (!yy_DOT(ctx)) goto l61; yyDo(ctx, yy_6_primary, ctx->begin, ctx->end); goto l53; + l61:; ctx->pos= yypos53; ctx->thunkpos= yythunkpos53; if (!yy_action(ctx)) goto l62; yyDo(ctx, yy_7_primary, ctx->begin, ctx->end); goto l53; + l62:; ctx->pos= yypos53; ctx->thunkpos= yythunkpos53; if (!yy_BEGIN(ctx)) goto l63; yyDo(ctx, yy_8_primary, ctx->begin, ctx->end); goto l53; + l63:; ctx->pos= yypos53; ctx->thunkpos= yythunkpos53; if (!yy_END(ctx)) goto l52; yyDo(ctx, yy_9_primary, ctx->begin, ctx->end); + } + l53:; + yyprintf((stderr, " ok %s @ %s\n", "primary", ctx->buf+ctx->pos)); + return 1; + l52:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "primary", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_NOT(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "NOT")); if (!yymatchChar(ctx, '!')) goto l64; if (!yy__(ctx)) goto l64; + yyprintf((stderr, " ok %s @ %s\n", "NOT", ctx->buf+ctx->pos)); + return 1; + l64:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "NOT", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_suffix(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "suffix")); if (!yy_primary(ctx)) goto l65; + { int yypos66= ctx->pos, yythunkpos66= ctx->thunkpos; + { int yypos68= ctx->pos, yythunkpos68= ctx->thunkpos; if (!yy_QUESTION(ctx)) goto l69; yyDo(ctx, yy_1_suffix, ctx->begin, ctx->end); goto l68; + l69:; ctx->pos= yypos68; ctx->thunkpos= yythunkpos68; if (!yy_STAR(ctx)) goto l70; yyDo(ctx, yy_2_suffix, ctx->begin, ctx->end); goto l68; + l70:; ctx->pos= yypos68; ctx->thunkpos= yythunkpos68; if (!yy_PLUS(ctx)) goto l66; yyDo(ctx, yy_3_suffix, ctx->begin, ctx->end); + } + l68:; goto l67; + l66:; ctx->pos= yypos66; ctx->thunkpos= yythunkpos66; + } + l67:; + yyprintf((stderr, " ok %s @ %s\n", "suffix", ctx->buf+ctx->pos)); + return 1; + l65:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "suffix", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_action(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "action")); if (!yymatchChar(ctx, '{')) goto l71; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l71; + l72:; + { int yypos73= ctx->pos, yythunkpos73= ctx->thunkpos; if (!yy_braces(ctx)) goto l73; goto l72; + l73:; ctx->pos= yypos73; ctx->thunkpos= yythunkpos73; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l71; if (!yymatchChar(ctx, '}')) goto l71; if (!yy__(ctx)) goto l71; + yyprintf((stderr, " ok %s @ %s\n", "action", ctx->buf+ctx->pos)); + return 1; + l71:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "action", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_AND(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "AND")); if (!yymatchChar(ctx, '&')) goto l74; if (!yy__(ctx)) goto l74; + yyprintf((stderr, " ok %s @ %s\n", "AND", ctx->buf+ctx->pos)); + return 1; + l74:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "AND", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_prefix(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "prefix")); + { int yypos76= ctx->pos, yythunkpos76= ctx->thunkpos; if (!yy_AND(ctx)) goto l77; if (!yy_action(ctx)) goto l77; yyDo(ctx, yy_1_prefix, ctx->begin, ctx->end); goto l76; + l77:; ctx->pos= yypos76; ctx->thunkpos= yythunkpos76; if (!yy_AND(ctx)) goto l78; if (!yy_suffix(ctx)) goto l78; yyDo(ctx, yy_2_prefix, ctx->begin, ctx->end); goto l76; + l78:; ctx->pos= yypos76; ctx->thunkpos= yythunkpos76; if (!yy_NOT(ctx)) goto l79; if (!yy_suffix(ctx)) goto l79; yyDo(ctx, yy_3_prefix, ctx->begin, ctx->end); goto l76; + l79:; ctx->pos= yypos76; ctx->thunkpos= yythunkpos76; if (!yy_suffix(ctx)) goto l75; + } + l76:; + yyprintf((stderr, " ok %s @ %s\n", "prefix", ctx->buf+ctx->pos)); + return 1; + l75:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "prefix", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_BAR(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "BAR")); if (!yymatchChar(ctx, '|')) goto l80; if (!yy__(ctx)) goto l80; + yyprintf((stderr, " ok %s @ %s\n", "BAR", ctx->buf+ctx->pos)); + return 1; + l80:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "BAR", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_sequence(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "sequence")); if (!yy_prefix(ctx)) goto l81; + l82:; + { int yypos83= ctx->pos, yythunkpos83= ctx->thunkpos; if (!yy_prefix(ctx)) goto l83; yyDo(ctx, yy_1_sequence, ctx->begin, ctx->end); goto l82; + l83:; ctx->pos= yypos83; ctx->thunkpos= yythunkpos83; + } + yyprintf((stderr, " ok %s @ %s\n", "sequence", ctx->buf+ctx->pos)); + return 1; + l81:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "sequence", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_SEMICOLON(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "SEMICOLON")); if (!yymatchChar(ctx, ';')) goto l84; if (!yy__(ctx)) goto l84; + yyprintf((stderr, " ok %s @ %s\n", "SEMICOLON", ctx->buf+ctx->pos)); + return 1; + l84:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "SEMICOLON", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_expression(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "expression")); if (!yy_sequence(ctx)) goto l85; + l86:; + { int yypos87= ctx->pos, yythunkpos87= ctx->thunkpos; if (!yy_BAR(ctx)) goto l87; if (!yy_sequence(ctx)) goto l87; yyDo(ctx, yy_1_expression, ctx->begin, ctx->end); goto l86; + l87:; ctx->pos= yypos87; ctx->thunkpos= yythunkpos87; + } + yyprintf((stderr, " ok %s @ %s\n", "expression", ctx->buf+ctx->pos)); + return 1; + l85:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "expression", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_EQUAL(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "EQUAL")); if (!yymatchChar(ctx, '=')) goto l88; if (!yy__(ctx)) goto l88; + yyprintf((stderr, " ok %s @ %s\n", "EQUAL", ctx->buf+ctx->pos)); + return 1; + l88:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "EQUAL", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_identifier(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "identifier")); yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l89; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\040\000\000\376\377\377\207\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l89; + l90:; + { int yypos91= ctx->pos, yythunkpos91= ctx->thunkpos; if (!yymatchClass(ctx, (unsigned char *)"\000\000\000\000\000\040\377\003\376\377\377\207\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l91; goto l90; + l91:; ctx->pos= yypos91; ctx->thunkpos= yythunkpos91; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l89; if (!yy__(ctx)) goto l89; + yyprintf((stderr, " ok %s @ %s\n", "identifier", ctx->buf+ctx->pos)); + return 1; + l89:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "identifier", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_RPERCENT(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "RPERCENT")); if (!yymatchString(ctx, "%}")) goto l92; if (!yy__(ctx)) goto l92; + yyprintf((stderr, " ok %s @ %s\n", "RPERCENT", ctx->buf+ctx->pos)); + return 1; + l92:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "RPERCENT", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_end_of_file(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "end_of_file")); + { int yypos94= ctx->pos, yythunkpos94= ctx->thunkpos; if (!yymatchDot(ctx)) goto l94; goto l93; + l94:; ctx->pos= yypos94; ctx->thunkpos= yythunkpos94; + } + yyprintf((stderr, " ok %s @ %s\n", "end_of_file", ctx->buf+ctx->pos)); + return 1; + l93:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "end_of_file", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_trailer(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "trailer")); if (!yymatchString(ctx, "%%")) goto l95; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l95; + l96:; + { int yypos97= ctx->pos, yythunkpos97= ctx->thunkpos; if (!yymatchDot(ctx)) goto l97; goto l96; + l97:; ctx->pos= yypos97; ctx->thunkpos= yythunkpos97; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l95; yyDo(ctx, yy_1_trailer, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "trailer", ctx->buf+ctx->pos)); + return 1; + l95:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "trailer", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_definition(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "definition")); if (!yy_identifier(ctx)) goto l98; yyDo(ctx, yy_1_definition, ctx->begin, ctx->end); if (!yy_EQUAL(ctx)) goto l98; if (!yy_expression(ctx)) goto l98; yyDo(ctx, yy_2_definition, ctx->begin, ctx->end); + { int yypos99= ctx->pos, yythunkpos99= ctx->thunkpos; if (!yy_SEMICOLON(ctx)) goto l99; goto l100; + l99:; ctx->pos= yypos99; ctx->thunkpos= yythunkpos99; + } + l100:; + yyprintf((stderr, " ok %s @ %s\n", "definition", ctx->buf+ctx->pos)); + return 1; + l98:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "definition", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy_declaration(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "declaration")); if (!yymatchString(ctx, "%{")) goto l101; yyText(ctx, ctx->begin, ctx->end); if (!(YY_BEGIN)) goto l101; + l102:; + { int yypos103= ctx->pos, yythunkpos103= ctx->thunkpos; + { int yypos104= ctx->pos, yythunkpos104= ctx->thunkpos; if (!yymatchString(ctx, "%}")) goto l104; goto l103; + l104:; ctx->pos= yypos104; ctx->thunkpos= yythunkpos104; + } if (!yymatchDot(ctx)) goto l103; goto l102; + l103:; ctx->pos= yypos103; ctx->thunkpos= yythunkpos103; + } yyText(ctx, ctx->begin, ctx->end); if (!(YY_END)) goto l101; if (!yy_RPERCENT(ctx)) goto l101; yyDo(ctx, yy_1_declaration, ctx->begin, ctx->end); + yyprintf((stderr, " ok %s @ %s\n", "declaration", ctx->buf+ctx->pos)); + return 1; + l101:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "declaration", ctx->buf+ctx->pos)); + return 0; +} +YY_RULE(int) yy__(yycontext *ctx) +{ + yyprintf((stderr, "%s\n", "_")); + l106:; + { int yypos107= ctx->pos, yythunkpos107= ctx->thunkpos; + { int yypos108= ctx->pos, yythunkpos108= ctx->thunkpos; if (!yy_space(ctx)) goto l109; goto l108; + l109:; ctx->pos= yypos108; ctx->thunkpos= yythunkpos108; if (!yy_comment(ctx)) goto l107; + } + l108:; goto l106; + l107:; ctx->pos= yypos107; ctx->thunkpos= yythunkpos107; + } + yyprintf((stderr, " ok %s @ %s\n", "_", ctx->buf+ctx->pos)); + return 1; +} +YY_RULE(int) yy_grammar(yycontext *ctx) +{ int yypos0= ctx->pos, yythunkpos0= ctx->thunkpos; + yyprintf((stderr, "%s\n", "grammar")); if (!yy__(ctx)) goto l110; + { int yypos113= ctx->pos, yythunkpos113= ctx->thunkpos; if (!yy_declaration(ctx)) goto l114; goto l113; + l114:; ctx->pos= yypos113; ctx->thunkpos= yythunkpos113; if (!yy_definition(ctx)) goto l110; + } + l113:; + l111:; + { int yypos112= ctx->pos, yythunkpos112= ctx->thunkpos; + { int yypos115= ctx->pos, yythunkpos115= ctx->thunkpos; if (!yy_declaration(ctx)) goto l116; goto l115; + l116:; ctx->pos= yypos115; ctx->thunkpos= yythunkpos115; if (!yy_definition(ctx)) goto l112; + } + l115:; goto l111; + l112:; ctx->pos= yypos112; ctx->thunkpos= yythunkpos112; + } + { int yypos117= ctx->pos, yythunkpos117= ctx->thunkpos; if (!yy_trailer(ctx)) goto l117; goto l118; + l117:; ctx->pos= yypos117; ctx->thunkpos= yythunkpos117; + } + l118:; if (!yy_end_of_file(ctx)) goto l110; + yyprintf((stderr, " ok %s @ %s\n", "grammar", ctx->buf+ctx->pos)); + return 1; + l110:; ctx->pos= yypos0; ctx->thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "grammar", ctx->buf+ctx->pos)); + return 0; +} + +#ifndef YY_PART + +typedef int (*yyrule)(yycontext *ctx); + +YY_PARSE(int) YYPARSEFROM(YY_CTX_PARAM_ yyrule yystart) +{ + int yyok; + if (!yyctx->buflen) + { + yyctx->buflen= 1024; + yyctx->buf= (char *)malloc(yyctx->buflen); + yyctx->textlen= 1024; + yyctx->text= (char *)malloc(yyctx->textlen); + yyctx->thunkslen= 32; + yyctx->thunks= (yythunk *)malloc(sizeof(yythunk) * yyctx->thunkslen); + yyctx->valslen= 32; + yyctx->vals= (YYSTYPE *)malloc(sizeof(YYSTYPE) * yyctx->valslen); + yyctx->begin= yyctx->end= yyctx->pos= yyctx->limit= yyctx->thunkpos= 0; + } + yyctx->begin= yyctx->end= yyctx->pos; + yyctx->thunkpos= 0; + yyctx->val= yyctx->vals; + yyok= yystart(yyctx); + if (yyok) yyDone(yyctx); + yyCommit(yyctx); + return yyok; +} + +YY_PARSE(int) YYPARSE(YY_CTX_PARAM) +{ + return YYPARSEFROM(YY_CTX_ARG_ yy_grammar); +} + +#endif + + +void yyerror(char *message) +{ + fprintf(stderr, "%s:%d: %s", fileName, lineNumber, message); + if (yyctx->text[0]) fprintf(stderr, " near token '%s'", yyctx->text); + if (yyctx->pos < yyctx->limit || !feof(input)) + { + yyctx->buf[yyctx->limit]= '\0'; + fprintf(stderr, " before text \""); + while (yyctx->pos < yyctx->limit) + { + if ('\n' == yyctx->buf[yyctx->pos] || '\r' == yyctx->buf[yyctx->pos]) break; + fputc(yyctx->buf[yyctx->pos++], stderr); + } + if (yyctx->pos == yyctx->limit) + { + int c; + while (EOF != (c= fgetc(input)) && '\n' != c && '\r' != c) + fputc(c, stderr); + } + fputc('\"', stderr); + } + fprintf(stderr, "\n"); + exit(1); +} + +void makeHeader(char *text) +{ + Header *header= (Header *)malloc(sizeof(Header)); + header->text= strdup(text); + header->next= headers; + headers= header; +} + +void makeTrailer(char *text) +{ + trailer= strdup(text); +} + +static void version(char *name) +{ + printf("%s version %d.%d.%d\n", name, PEG_MAJOR, PEG_MINOR, PEG_LEVEL); +} + +static void usage(char *name) +{ + version(name); + fprintf(stderr, "usage: %s [