remove old

This commit is contained in:
Kyle Maxwell 2009-03-03 22:22:19 -08:00
parent 67a27813de
commit 786d9cdde2
127 changed files with 1 additions and 67737 deletions

View File

@ -1 +0,0 @@
Kyle Maxwell

View File

43
INSTALL
View File

@ -1,43 +0,0 @@
Parsley depends on
- the JSON C library from http://oss.metaparadigm.com/json-c/ (I used 0.7)
- argp (standard with Linux, other platforms use argp-standalone package)
- pcre (with dev headers)
- libxml2
- libxslt (with exslt)
It's a standard ./configure && make && sudo make install once the
dependencies are installed. Examples below, assuming you're in the
current directory.
Debian/Ubuntu
------------------------------------------------------------------------
sudo apt-get install libxslt1-dev libpcre3-dev build-essential wget
wget http://oss.metaparadigm.com/json-c/json-c-0.7.tar.gz
tar -zxf json-c-0.7.tar.gz
cd json-c-0.7
./configure
make
sudo make install
cd -
./configure
make
sudo make install
Mac OS X with MacPorts:
------------------------------------------------------------------------
sudo port install argp-standalone json-c pcre
./configure
make
sudo make install
Ruby Binding (via Gems)
------------------------------------------------------------------------
http://github.com/fizx/parsley-ruby
Python Binding
------------------------------------------------------------------------
http://github.com/fizx/pyparsley
Other OS/Configurations:
------------------------------------------------------------------------
Haven't tried.

84
INTRO
View File

@ -1,84 +0,0 @@
<html><textarea style="width:100%;height:100%">
Towards a universal scraping API
or, an introduction to parsley
Web scraping is a chore. Scraper scripts are brittle and slow, and everyone writes their own custom implementation, resulting in countless hours of repeated work. Let's work together to make it easier. Let's do what regular expressions did for text processing, and what SQL did for databases. Let's create a universal domain-specific language for web scraping.
What features do we need? The must haves:
- Concise
- Easy-to-learn
- Powerful
- Idiomatic
- Portable
- FAST!!!
In order to make this easy to learn, let's keep the best of what's working today. I really like Hpricot's ability to use either xml or css to specify tags to extract. (For those that don't know, you can use "h1 a" [css] or "//h1//a" [xpath] to represent all of the hyperlinks inside paragraphs in a document). Sometimes, i'd even like to mix xpath and css, i.e.: "substring-after(h1, ':')". Regular expressions are *really* useful, so let's support them too. Lets use the XPath2 syntax.
Now for some examples:
- 3rd paragraph:
p:nth-child(3)
- First sentence in that paragraph (period-delimited):
substring-before(p:nth-child(3), '.')
- Any simple phone number in an ordered list called "numbers"
re:match(ul#numbers>li, '\d{3}-\d{4}', 'g')
We support all of CSS3, XPath1, as well as all functions in XSLT 1.0 and EXSLT (required+regexp).
I think this is a pretty good way to grab a single piece of data from a page. It's simple and gives you all of the tools (CSS for simplicity, XPath for power, regex for detailed text handling) you are used to, in one expression.
We'd like to make our scraper script both portable and fast. For both these reasons, we need to be able to express the structure of the scraped data independently of the general-purpose programming language you happen to be working in. Jumping from XPath to Python and back means multiple passes over the document, and Python idioms prevent easy use of your scraper by Rubyists. If we can represent the entire scrape in a language-independent way, we can compile it into something that libxml2 can handle in one pass, giving screaming-fast (milliseconds per parse) performance.
To describe the output structure, lets use json. It's compact, and the Ruby/Python/etc bindings can use hashes/lists/dictionaries to represent the same structure. We can also have the scraper output json or native data structures. Here's an example script that grabs the title and all hyperlinks on a page:
{
"title": "h1",
"links": ["a"]
}
Applying this to http://www.yelp.com/biz/amnesia-san-francisco yields:
{
"title": "Amnesia",
"links": ["Yelp", "Welcome", "About Me", ... ]
}
You'll note that the output structure mirrors the input structure. In the Ruby binding, you can get both input and output natively:
> require "open-uri"
> require "parsley"
> Parsley.new({"title" => "h1", "links" => ["a"]}).parse(:url => "http://www.yelp.com/biz/amnesia-san-francisco")
#=> {"title"=>"Amnesia", "links"=>["Yelp", "Welcome", "About Me"]}
We'll also add both explicit and implicit grouping Here's an extension of the previous example with explicit grouping:
{
"title": "h1",
"links(a)": [{
"text": ".",
"link": "@href"
}]
}
The json structure in the output still mirrors the input, but now you can get both the link text and the href.
Pages like craigslist are slightly trickier to group. Elements on this page go h4, p, p, p, h4, p, p, p. To group this, you could do:
{
"entry(p)":[{
"title": ".",
"date": "preceding::h4"
}]
}
If you instead wanted to group by date, you could use implicit grouping. It's implicit, because the parenthesized filter is omitted. Grouping happens by page order. We treat the first single (i.e. non-square-bracketed) value (the h4 in the below example) as the beginning of a new group, and adds following values to the group (i.e.: [h4, p, p, p], [h4, p, p], [h4, p]).
{
"entry":[{
"date": "h4",
"title": ["p"]
}]
}
</textarea></html>

View File

@ -1,41 +0,0 @@
AM_YFLAGS = -d
BUILT_SOURCES=parser.h
lib_LTLIBRARIES = libparsley.la
libparsley_la_SOURCES = parsley_mem.c xml2json.c regexp.c printbuf.c functions.c util.c kstring.c obstack.c scanner.l parser.y parsley.c
include_HEADERS = parsley.h obstack.h xml2json.h
bin_PROGRAMS = parsleyc parsley
parsleyc_SOURCES = parsleyc_main.c
parsleyc_LDADD = libparsley.la
parsley_SOURCES = parsley_main.c
parsley_LDADD = libparsley.la
bisect:
./bootstrap.sh && ./configure && make clean && make check
install-all:
./bootstrap.sh && ./configure && make && make install && cd ruby && rake install && cd ../python && python setup.py install
check-am:
@echo "fictional..."; ./parsley test/fictional.let test/fictional.html | diff test/fictional.json - && echo " success."
@echo "fictional-opt..."; ./parsley test/fictional-opt.let test/fictional-opt.html | diff test/fictional-opt.json - && echo " success."
@echo "function-magic..."; ./parsley test/function-magic.let test/function-magic.html | diff test/function-magic.json - && echo " success."
@echo "malformed-expr..."; ./parsley test/malformed-expr.let test/malformed-expr.html | diff test/malformed-expr.json - && echo " success."
@echo "malformed-json..."; ./parsley test/malformed-json.let test/malformed-json.html | diff test/malformed-json.json - && echo " success."
@echo "css_attr..."; ./parsley -x test/css_attr.let test/css_attr.html | diff test/css_attr.json - && echo " success."
@echo "match..."; ./parsley -x test/match.let test/match.xml | diff test/match.json - && echo " success."
@echo "position..."; ./parsley test/position.let test/position.html | diff test/position.json - && echo " success."
@echo "replace..."; ./parsley -x test/replace.let test/replace.xml | diff test/replace.json - && echo " success."
@echo "scope..."; ./parsley test/scope.let test/scope.html | diff test/scope.json - && echo " success."
@echo "test..."; ./parsley -x test/test.let test/test.xml | diff test/test.json - && echo " success."
@echo "yelp..."; ./parsley test/yelp.let test/yelp.html | diff test/yelp.json - && echo " success."
@echo "optional..."; ./parsley test/optional.let test/optional.html | diff test/optional.json - && echo " success."
@echo "malformed-function..."; ./parsley test/malformed-function.let test/malformed-function.html | diff test/malformed-function.json - && echo " success."
@echo "empty..."; ./parsley test/empty.let test/empty.html | diff test/empty.json - && echo " success."
@echo "trivial..."; ./parsley test/trivial.let test/trivial.html | diff test/trivial.json - && echo " success."
@echo "trivial2..."; ./parsley test/trivial2.let test/trivial2.html | diff test/trivial2.json - && echo " success."
@echo "craigs-simple..."; ./parsley test/craigs-simple.let test/craigs-simple.html | diff test/craigs-simple.json - && echo " success."
@echo "yelp-home..."; ./parsley test/yelp-home.let test/yelp-home.html | diff test/yelp-home.json - && echo " success."

View File

@ -1,748 +0,0 @@
# Makefile.in generated by automake 1.10.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = parsleyc$(EXEEXT) parsley$(EXEEXT)
subdir = .
DIST_COMMON = $(am__configure_deps) $(include_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/configure AUTHORS ChangeLog INSTALL NEWS TODO \
config.guess config.sub depcomp install-sh ltmain.sh missing \
parser.c parser.h scanner.c ylwrap
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(includedir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
libparsley_la_LIBADD =
am_libparsley_la_OBJECTS = parsley_mem.lo xml2json.lo regexp.lo \
printbuf.lo functions.lo util.lo kstring.lo obstack.lo \
scanner.lo parser.lo parsley.lo
libparsley_la_OBJECTS = $(am_libparsley_la_OBJECTS)
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_parsley_OBJECTS = parsley_main.$(OBJEXT)
parsley_OBJECTS = $(am_parsley_OBJECTS)
parsley_DEPENDENCIES = libparsley.la
am_parsleyc_OBJECTS = parsleyc_main.$(OBJEXT)
parsleyc_OBJECTS = $(am_parsleyc_OBJECTS)
parsleyc_DEPENDENCIES = libparsley.la
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS)
LTLEXCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS)
YLWRAP = $(top_srcdir)/ylwrap
YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
LTYACCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS)
SOURCES = $(libparsley_la_SOURCES) $(parsley_SOURCES) \
$(parsleyc_SOURCES)
DIST_SOURCES = $(libparsley_la_SOURCES) $(parsley_SOURCES) \
$(parsleyc_SOURCES)
includeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(include_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XML2_CONFIG = @XML2_CONFIG@
XSLT_CONFIG = @XSLT_CONFIG@
YACC = @YACC@
YFLAGS = @YFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_YFLAGS = -d
BUILT_SOURCES = parser.h
lib_LTLIBRARIES = libparsley.la
libparsley_la_SOURCES = parsley_mem.c xml2json.c regexp.c printbuf.c functions.c util.c kstring.c obstack.c scanner.l parser.y parsley.c
include_HEADERS = parsley.h obstack.h xml2json.h
parsleyc_SOURCES = parsleyc_main.c
parsleyc_LDADD = libparsley.la
parsley_SOURCES = parsley_main.c
parsley_LDADD = libparsley.la
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .l .lo .o .obj .y
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
cd $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
parser.h: parser.c
@if test ! -f $@; then \
rm -f parser.c; \
$(MAKE) $(AM_MAKEFLAGS) parser.c; \
else :; fi
libparsley.la: $(libparsley_la_OBJECTS) $(libparsley_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(libparsley_la_OBJECTS) $(libparsley_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
parsley$(EXEEXT): $(parsley_OBJECTS) $(parsley_DEPENDENCIES)
@rm -f parsley$(EXEEXT)
$(LINK) $(parsley_OBJECTS) $(parsley_LDADD) $(LIBS)
parsleyc$(EXEEXT): $(parsleyc_OBJECTS) $(parsleyc_DEPENDENCIES)
@rm -f parsleyc$(EXEEXT)
$(LINK) $(parsleyc_OBJECTS) $(parsleyc_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/functions.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kstring.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/obstack.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsley.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsley_main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsley_mem.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsleyc_main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printbuf.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regexp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanner.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xml2json.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
.l.c:
$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE)
.y.c:
$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool config.lt
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
$(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
done
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(include_HEADERS)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
rm -f "$(DESTDIR)$(includedir)/$$f"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d $(distdir) || mkdir $(distdir)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
install-binPROGRAMS: install-libLTLIBRARIES
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-rm -f parser.c
-rm -f parser.h
-rm -f scanner.c
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-includeHEADERS
install-dvi: install-dvi-am
install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
install-html: install-html-am
install-info: install-info-am
install-man:
install-pdf: install-pdf-am
install-ps: install-ps-am
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
uninstall-libLTLIBRARIES
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
clean-libtool ctags dist dist-all dist-bzip2 dist-gzip \
dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-includeHEADERS install-info \
install-info-am install-libLTLIBRARIES install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-includeHEADERS uninstall-libLTLIBRARIES
bisect:
./bootstrap.sh && ./configure && make clean && make check
install-all:
./bootstrap.sh && ./configure && make && make install && cd ruby && rake install && cd ../python && python setup.py install
check-am:
@echo "fictional..."; ./parsley test/fictional.let test/fictional.html | diff test/fictional.json - && echo " success."
@echo "fictional-opt..."; ./parsley test/fictional-opt.let test/fictional-opt.html | diff test/fictional-opt.json - && echo " success."
@echo "function-magic..."; ./parsley test/function-magic.let test/function-magic.html | diff test/function-magic.json - && echo " success."
@echo "malformed-expr..."; ./parsley test/malformed-expr.let test/malformed-expr.html | diff test/malformed-expr.json - && echo " success."
@echo "malformed-json..."; ./parsley test/malformed-json.let test/malformed-json.html | diff test/malformed-json.json - && echo " success."
@echo "css_attr..."; ./parsley -x test/css_attr.let test/css_attr.html | diff test/css_attr.json - && echo " success."
@echo "match..."; ./parsley -x test/match.let test/match.xml | diff test/match.json - && echo " success."
@echo "position..."; ./parsley test/position.let test/position.html | diff test/position.json - && echo " success."
@echo "replace..."; ./parsley -x test/replace.let test/replace.xml | diff test/replace.json - && echo " success."
@echo "scope..."; ./parsley test/scope.let test/scope.html | diff test/scope.json - && echo " success."
@echo "test..."; ./parsley -x test/test.let test/test.xml | diff test/test.json - && echo " success."
@echo "yelp..."; ./parsley test/yelp.let test/yelp.html | diff test/yelp.json - && echo " success."
@echo "optional..."; ./parsley test/optional.let test/optional.html | diff test/optional.json - && echo " success."
@echo "malformed-function..."; ./parsley test/malformed-function.let test/malformed-function.html | diff test/malformed-function.json - && echo " success."
@echo "empty..."; ./parsley test/empty.let test/empty.html | diff test/empty.json - && echo " success."
@echo "trivial..."; ./parsley test/trivial.let test/trivial.html | diff test/trivial.json - && echo " success."
@echo "trivial2..."; ./parsley test/trivial2.let test/trivial2.html | diff test/trivial2.json - && echo " success."
@echo "craigs-simple..."; ./parsley test/craigs-simple.let test/craigs-simple.html | diff test/craigs-simple.json - && echo " success."
@echo "yelp-home..."; ./parsley test/yelp-home.let test/yelp-home.html | diff test/yelp-home.json - && echo " success."
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

0
NEWS
View File

36
PAPER
View File

@ -1,36 +0,0 @@
Abstract
================================================================
A common programming task is data extraction from xml and html documents. I introduce parsley, an embedded language (ala SQL, regular expressions) that improves the usability and/or speed of current extraction techniques.
Introduction
================================================================
Today, developers use a couple toolsets to do data extraction. Many developers use libraries like Hpricot for Ruby and Beautiful Soup for Python. These libraries allow extraction of xml subtrees via XPath or CSS selectors. These subtrees are futher refined using the scripting language, often with the help of regular expressions.
Other developers use XSLT. While fast, mature, and conceptually elegant, XSLT
- current techniques
- benefits of standardization
- best of current
Features
================================================================
- integrated grammars
- with some expression examples
- multiple elements, one pass / context switching
- exslt / standard library
- json
- language integration
- pruning
- structural parsing
Examples
- Ruby/python/json
- structural parse
-
Benchmarks
- size comparision with XSLT
- speed comparision with nokogiri, hpricot
Conclusion

View File

@ -1,18 +0,0 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$
PortSystem 1.0
name parsley
version 0.1.5
categories net
maintainers kyle@kylemaxwell.com
description Data extractor
long_description Parsley is a system to extract data from HTML/XML documents
homepage http://github.com/fizx/parsley
platforms darwin
master_sites http://parslets.com
depends_lib port:argp-standalone \
port:json-c \
port:libxslt \
port:pcre
checksums md5 5e4d9080aa4ed2dfa7996c89a8e7f719 sha1 9508eea67212d9a9620eac3fe3719c91e00e11d9 rmd160 dfa9cee2fdb41ac750d47288d5128f1963a84334

View File

@ -1,17 +0,0 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$
PortSystem 1.0
name parsley
version <VERSION>
categories net
maintainers kyle@kylemaxwell.com
description Data extractor
long_description Parsley is a system to extract data from HTML/XML documents
homepage http://github.com/fizx/parsley
platforms darwin
master_sites http://parslets.com
depends_lib port:argp-standalone \
port:json-c \
port:libxslt \
port:pcre

View File

@ -1,80 +0,0 @@
To use parsley from C, the following functions are available from parsley.h. In
addition, there is a function to convert xml documents of the type returned by
parsley into json.
You will also need passing familiarity with libxml2 and json-c to print, manipulate, and free some of the generated objects.
- http://svn.metaparadigm.com/svn/json-c/trunk
- http://xmlsoft.org/
From parsley.h
=============
parsedParsleyPtr -- a struct that contains the following elements:
- xmlDocPtr xml -- the output of a parslet document parse, as a libxml2 document
- char *error -- an error message, or NULL if no error
- compiled_parsley *parsley -- reference to the parsley that did the parsing
parsleyPtr parsley_compile(char* parsley, char* incl)
Arguments:
- char* parsley -- a string of parsley to compile.
- char* incl -- arbitrary XSLT to inject directly into the stylesheet,
outside any templates.
Returns: A structure that you can pass to parsley_parse_* to do the actual
parsing. This structure contains the compiled XSLT.
Notes: This is *NOT* thread-safe. (Usage of the parslet via parsley_parse_* *IS*
thread-safe, however.)
void parsley_free(parsleyPtr);
Frees the parsleyPtr's memory.
void parsed_parsley_free(parsedParsleyPtr);
Frees the parsedParsleyPtr's memory.
parsedParsleyPtr parsley_parse_file(parsleyPtr parsley, char* file_name, boolean html);
Arguments:
- parsleyPtr parsley -- Compiled parsley struct
- char* file_name -- file to parse
- boolean html -- Use the html parser? (instead of xml)
Returns: A libxml2 document of the extracted data. You need to free this
with xmlFree(). To output, look at the libxml2 documentation for functions
like xmlSaveFormatFile(). If you want json output, look below for xml2json
docs.
parsedParsleyPtr parsley_parse_string(parsleyPtr parsley, char* string, size_t len, boolean html);
Parses the in-memory string/length combination given. See parsley_parse_file
docs.
parsedParsleyPtr parsley_parse_doc(parsleyPtr parsley, xmlDocPtr doc);
Uses the parsley parser to parse a libxml2 document.
From xml2json.h
===============
struct json_object * xml2json(xmlNodePtr);
Converts an xml subtree to json. The xml should be in the format returned
by parsley. Basically, xml attributes get ignored, and if you want an array
like [a,b], use:
<parsley:groups>
<parsley:group>a</parsley:group>
<parsley:group>b</parsley:group>
</parsley:groups>
To get a null-terminated string out, use:
json_object_to_json_string(struct json_object *)
To free (actually, to decrement the reference count), call:
json_object_put(struct json_object *)

View File

@ -1,103 +0,0 @@
<h3>Overview<a name="start-readme">&nbsp;</a></h3>
parsley is a simple language for data-extraction from XML-like documents (including HTML). parsley is:
1. Blazing fast -- Typical HTML parses are sub-50ms.
2. Easy to write and understand -- parsley uses your current knowledge of JSON, CSS, and XPath.
3. Powerful. parsley can understand full XPath, including standard and user-defined functions.
### Examples
A simple script, or "parslet", looks like this:
{
"title": "h1",
"links(a)": [
{
"text": ".",
"href": "@href"
}
]
}
This returns JSON or XML output with the same structure. Applying this parslet to http://www.yelp.com/biz/amnesia-san-francisco yields either:
{
"title": "Amnesia",
"links": [
{
"href": "\/",
"text": "Yelp"
},
{
"href": "\/",
"text": "Welcome"
},
{
"href": "\/signup?return_url=%2Fuser_details",
"text": " About Me"
},
.....
]
}
or equivalently:
<parsley:root>
<title>Amnesia</title>
<links>
<parsley:group>
<href>/</href>
<text>Yelp</text>
</parsley:group>
<parsley:group>
<href>/</href>
<text>Welcome</text>
</parsley:group>
<parsley:group>
<href>/signup?return_url=%2Fuser_details</href>
<text> About Me</text>
</parsley:group>
.....
</links>
</parsley:root>
This parslet could also have been expressed as:
{
"title": "h1",
"links(a)": [
{
"text": ".",
"href": "@href"
}
]
}
The "a" in links(a) is a "key selector" -- an explicit grouping (with scope) for the array. You can use any XPath 1.0 or CSS3 expression as a value or a key selector. Parsley will try to be smart, and figure out which you are using. You can use CSS selectors inside XPath functions -- "substring-after(h1>a, ':')" is a valid expression.
### Variables
You can use $foo to access the value of the key "foo" in the current scope (i.e. nested curly brace depth). Also available are $parent.foo, $parent.parent.foo, $root.foo, $root.foo.bar, etc.
### Custom Functions
You can write custom functions in XSLT (I'd like to also support C and JavaScript). They look like:
<func:function name="user:excited">
<xsl:param name="input" />
<func:result select="concat($input, '!!!!!!!')" />
</func:function>
If you run:
{
"title": "user:excited(h1)",
}
on the Yelp page, you'll get:
{
"title": "Amnesia!!!!!!!",
}

39
TODO
View File

@ -1,39 +0,0 @@
# - dexter executable argp
# - html:document
# - output raw xslt
# - define stable c api
# - p/br support explicit
# - p/br support needs div?!
# - parsley_parse_url support
# - ruby binding for parsley_parse_url
# - relative urls
# - p/br support needs multicase handling
# - reorganize project (at least tests, makefile.am src?!)
# - unfilter inside of nested explicit scope
# - functions inside magic groups?!?!
# - shortcut functions possible (need c hash table)
# - fix position()
# - regexp tests
# - define a bunch of shortcut functions
# - rescope function
# - sensible Exception/error handling
# - join function?!?!
# - check linux build
# - python
# - complain if empty / runtime no-match errors
- memory leaks
- thread-safe exceptions
--------- release --------
- no-prune
- force group key !
- debugging options
- fix not()/set-difference
- CSS equations
- saxon compatibility?!
- XML input converter?!
- check windows build
- flags?!
^ - force group-before
$ - force group-after

View File

@ -1 +0,0 @@
0.1.5

8844
aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +0,0 @@
#!/bin/sh
libtoolize || glibtoolize
aclocal
autoconf
automake -a
bison -yd parser.y

1472
config.guess vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1599
config.sub vendored

File diff suppressed because it is too large Load Diff

14751
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,48 +0,0 @@
AC_PREREQ(2.59)
AC_INIT([parsleyc], [1.0], [kyle@kylemaxwell.com])
AM_INIT_AUTOMAKE([1.9 foreign])
LDFLAGS="$LDFLAGS -L/opt/local/lib"
CPPFLAGS="$CPPFLAGS -I/opt/local/include"
AC_PROG_CC_C99
AM_PROG_LEX
AC_PROG_YACC
AC_PROG_LIBTOOL
AC_CHECK_HEADER(pcre.h, , AC_MSG_ERROR([could not find pcre.h]))
AC_CHECK_HEADER(argp.h, , AC_MSG_ERROR([could not find argp.h]))
AC_CHECK_HEADER(json/json.h, , AC_MSG_ERROR([could not find json.h]))
AC_PATH_PROG(XML2_CONFIG, xml2-config, , [$PATH])
if test x$XML2_CONFIG = x ; then
AC_MSG_ERROR([libxml2 not present or not configured])
else
XML2_CFLAGS="`$XML2_CONFIG --cflags`"
XML2_LIBS="`$XML2_CONFIG --libs`"
fi
AC_PATH_PROG(XSLT_CONFIG, xslt-config, , [$PATH])
if test x$XSLT_CONFIG = x ; then
AC_MSG_ERROR([libxslt not present or not configured])
else
XSLT_CFLAGS="`$XSLT_CONFIG --cflags`"
XSLT_LIBS="`$XSLT_CONFIG --libs`"
fi
CPPFLAGS="$CPPFLAGS $XML2_CFLAGS $XSLT_CFLAGS"
LIBS="$LIBS $XML2_LIBS $XSLT_LIBS"
AC_CHECK_LIB(pcre, pcre_compile, , AC_MSG_ERROR([could not find pcre]))
AC_CHECK_FUNC(argp_parse, , [AC_CHECK_LIB(argp, argp_parse, , AC_MSG_ERROR([could not find argp]))])
AC_CHECK_LIB(json, json_object_new_string, , AC_MSG_ERROR([could not find the json library]))
AC_CHECK_LIB(xslt, xsltApplyStylesheet, , AC_MSG_ERROR([could not find libxslt]))
AC_CHECK_LIB(xml2, htmlParseFile, , AC_MSG_ERROR([could not find libxml2 with html parsing]))
AC_CHECK_LIB(exslt, exsltRegisterAll, , AC_MSG_ERROR([could not find libexslt]))
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

584
depcomp
View File

@ -1,584 +0,0 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2006-10-15.18
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
# Foundation, Inc.
# 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, 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 Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test -f "$tmpdepfile"; then :
else
stripped=`echo "$stripped" | sed 's,^.*/,,'`
tmpdepfile="$stripped.u"
fi
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add `dependent.h:' lines.
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@ -1,318 +0,0 @@
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include <libxml/parserInternals.h>
#include <libxml/uri.h>
#include <libxml/xpointer.h>
#include <libxml/xinclude.h>
#include <libxml/HTMLparser.h>
#include <libxml/HTMLtree.h>
#include <libxslt/xslt.h>
#include <libxslt/imports.h>
#include <libxslt/xsltInternals.h>
#include <libxslt/security.h>
#include <libxslt/xsltutils.h>
#include <libxslt/transform.h>
#include <libxslt/extensions.h>
#include <libxslt/documents.h>
#include "functions.h"
void parsley_register_all(){
xsltRegisterExtModuleFunction ((const xmlChar *) "html-document", "http://parslets.com/stdlib",
xsltHtmlDocumentFunction);
}
void
xsltHtmlDocumentFunction(xmlXPathParserContextPtr ctxt, int nargs)
{
xmlXPathObjectPtr obj, obj2 = NULL;
xmlChar *base = NULL, *URI;
if ((nargs < 1) || (nargs > 2)) {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
"document() : invalid number of args %d\n",
nargs);
ctxt->error = XPATH_INVALID_ARITY;
return;
}
if (ctxt->value == NULL) {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
"document() : invalid arg value\n");
ctxt->error = XPATH_INVALID_TYPE;
return;
}
if (nargs == 2) {
if (ctxt->value->type != XPATH_NODESET) {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
"document() : invalid arg expecting a nodeset\n");
ctxt->error = XPATH_INVALID_TYPE;
return;
}
obj2 = valuePop(ctxt);
}
if (ctxt->value->type == XPATH_NODESET) {
int i;
xmlXPathObjectPtr newobj, ret;
obj = valuePop(ctxt);
ret = xmlXPathNewNodeSet(NULL);
if (obj->nodesetval) {
for (i = 0; i < obj->nodesetval->nodeNr; i++) {
valuePush(ctxt,
xmlXPathNewNodeSet(obj->nodesetval->nodeTab[i]));
xmlXPathStringFunction(ctxt, 1);
if (nargs == 2) {
valuePush(ctxt, xmlXPathObjectCopy(obj2));
} else {
valuePush(ctxt,
xmlXPathNewNodeSet(obj->nodesetval->
nodeTab[i]));
}
xsltHtmlDocumentFunction(ctxt, 2);
newobj = valuePop(ctxt);
ret->nodesetval = xmlXPathNodeSetMerge(ret->nodesetval,
newobj->nodesetval);
xmlXPathFreeObject(newobj);
}
}
xmlXPathFreeObject(obj);
if (obj2 != NULL)
xmlXPathFreeObject(obj2);
valuePush(ctxt, ret);
return;
}
/*
* Make sure it's converted to a string
*/
xmlXPathStringFunction(ctxt, 1);
if (ctxt->value->type != XPATH_STRING) {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
"document() : invalid arg expecting a string\n");
ctxt->error = XPATH_INVALID_TYPE;
if (obj2 != NULL)
xmlXPathFreeObject(obj2);
return;
}
obj = valuePop(ctxt);
if (obj->stringval == NULL) {
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
} else {
if ((obj2 != NULL) && (obj2->nodesetval != NULL) &&
(obj2->nodesetval->nodeNr > 0) &&
IS_XSLT_REAL_NODE(obj2->nodesetval->nodeTab[0])) {
xmlNodePtr target;
target = obj2->nodesetval->nodeTab[0];
if ((target->type == XML_ATTRIBUTE_NODE) ||
(target->type == XML_PI_NODE)) {
target = ((xmlAttrPtr) target)->parent;
}
base = xmlNodeGetBase(target->doc, target);
} else {
xsltTransformContextPtr tctxt;
tctxt = xsltXPathGetTransformContext(ctxt);
if ((tctxt != NULL) && (tctxt->inst != NULL)) {
base = xmlNodeGetBase(tctxt->inst->doc, tctxt->inst);
} else if ((tctxt != NULL) && (tctxt->style != NULL) &&
(tctxt->style->doc != NULL)) {
base = xmlNodeGetBase(tctxt->style->doc,
(xmlNodePtr) tctxt->style->doc);
}
}
URI = xmlBuildURI(obj->stringval, base);
if (base != NULL)
xmlFree(base);
if (URI == NULL) {
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
} else {
xsltHtmlDocumentFunctionLoadDocument( ctxt, URI );
xmlFree(URI);
}
}
xmlXPathFreeObject(obj);
if (obj2 != NULL)
xmlXPathFreeObject(obj2);
}
static void
xsltHtmlDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
{
xsltTransformContextPtr tctxt;
xmlURIPtr uri;
xmlChar *fragment;
xsltDocumentPtr idoc; /* document info */
xmlDocPtr doc;
xmlXPathContextPtr xptrctxt = NULL;
xmlXPathObjectPtr resObj = NULL;
tctxt = xsltXPathGetTransformContext(ctxt);
if (tctxt == NULL) {
xsltTransformError(NULL, NULL, NULL,
"document() : internal error tctxt == NULL\n");
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
return;
}
uri = xmlParseURI((const char *) URI);
if (uri == NULL) {
xsltTransformError(tctxt, NULL, NULL,
"document() : failed to parse URI\n");
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
return;
}
/*
* check for and remove fragment identifier
*/
fragment = (xmlChar *)uri->fragment;
if (fragment != NULL) {
xmlChar *newURI;
uri->fragment = NULL;
newURI = xmlSaveUri(uri);
idoc = xsltLoadHtmlDocument(tctxt, newURI);
xmlFree(newURI);
} else
idoc = xsltLoadHtmlDocument(tctxt, URI);
xmlFreeURI(uri);
if (idoc == NULL) {
if ((URI == NULL) ||
(URI[0] == '#') ||
((tctxt->style->doc != NULL) &&
(xmlStrEqual(tctxt->style->doc->URL, URI))))
{
/*
* This selects the stylesheet's doc itself.
*/
doc = tctxt->style->doc;
} else {
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
if (fragment != NULL)
xmlFree(fragment);
return;
}
} else
doc = idoc->doc;
if (fragment == NULL) {
valuePush(ctxt, xmlXPathNewNodeSet((xmlNodePtr) doc));
return;
}
/* use XPointer of HTML location for fragment ID */
#ifdef LIBXML_XPTR_ENABLED
xptrctxt = xmlXPtrNewContext(doc, NULL, NULL);
if (xptrctxt == NULL) {
xsltTransformError(tctxt, NULL, NULL,
"document() : internal error xptrctxt == NULL\n");
goto out_fragment;
}
resObj = xmlXPtrEval(fragment, xptrctxt);
xmlXPathFreeContext(xptrctxt);
#endif
xmlFree(fragment);
if (resObj == NULL)
goto out_fragment;
switch (resObj->type) {
case XPATH_NODESET:
break;
case XPATH_UNDEFINED:
case XPATH_BOOLEAN:
case XPATH_NUMBER:
case XPATH_STRING:
case XPATH_POINT:
case XPATH_USERS:
case XPATH_XSLT_TREE:
case XPATH_RANGE:
case XPATH_LOCATIONSET:
xsltTransformError(tctxt, NULL, NULL,
"document() : XPointer does not select a node set: #%s\n",
fragment);
goto out_object;
}
valuePush(ctxt, resObj);
return;
out_object:
xmlXPathFreeObject(resObj);
out_fragment:
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
}
xsltDocumentPtr
xsltLoadHtmlDocument(xsltTransformContextPtr ctxt, const xmlChar *URI) {
xsltDocumentPtr ret;
xmlDocPtr doc;
if ((ctxt == NULL) || (URI == NULL))
return(NULL);
/*
* Security framework check
*/
if (ctxt->sec != NULL) {
int res;
res = xsltCheckRead(ctxt->sec, ctxt, URI);
if (res == 0) {
xsltTransformError(ctxt, NULL, NULL,
"xsltLoadHtmlDocument: read rights for %s denied\n",
URI);
return(NULL);
}
}
/*
* Walk the context list to find the document if preparsed
*/
ret = ctxt->docList;
while (ret != NULL) {
if ((ret->doc != NULL) && (ret->doc->URL != NULL) &&
(xmlStrEqual(ret->doc->URL, URI)))
return(ret);
ret = ret->next;
}
doc = htmlReadFile(URI, NULL, ctxt->parserOptions | HTML_PARSE_RECOVER | HTML_PARSE_NOERROR |HTML_PARSE_NOWARNING);
if (doc == NULL)
return(NULL);
if (ctxt->xinclude != 0) {
#ifdef LIBXML_XINCLUDE_ENABLED
#if LIBXML_VERSION >= 20603
xmlXIncludeProcessFlags(doc, ctxt->parserOptions);
#else
xmlXIncludeProcess(doc);
#endif
#else
xsltTransformError(ctxt, NULL, NULL,
"xsltLoadHtmlDocument(%s) : XInclude processing not compiled in\n",
URI);
#endif
}
/*
* Apply white-space stripping if asked for
*/
if (xsltNeedElemSpaceHandling(ctxt))
xsltApplyStripSpaces(ctxt, xmlDocGetRootElement(doc));
if (ctxt->debugStatus == XSLT_DEBUG_NONE)
xmlXPathOrderDocElems(doc);
ret = xsltNewDocument(ctxt, doc);
return(ret);
}

View File

@ -1,17 +0,0 @@
#ifndef PARSLEY_FUNCTIONS_H_INCLUDED
#define PARSLEY_FUNCTIONS_H_INCLUDED
#include <libxml/xpath.h>
#include <libxml/HTMLparser.h>
#include <libxslt/xslt.h>
#include <libxslt/xsltInternals.h>
#include <libxslt/transform.h>
#include <libxslt/documents.h>
void parsley_register_all();
static void xsltHtmlDocumentFunction(xmlXPathParserContextPtr, int);
static void xsltHtmlDocumentFunctionLoadDocument(xmlXPathParserContextPtr, xmlChar*);
xsltDocumentPtr xsltLoadHtmlDocument(xsltTransformContextPtr, const xmlChar *);
#endif

View File

@ -1,507 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2006-10-14.15
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# 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
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
posix_glob=
posix_mkdir=
# Desired mode of installed file.
mode=0755
chmodcmd=$chmodprog
chowncmd=
chgrpcmd=
stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=
dst=
dir_arg=
dstarg=
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
-c (ignored)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) shift
continue;;
-d) dir_arg=true
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
shift
shift
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t) dstarg=$2
shift
shift
continue;;
-T) no_target_directory=true
shift
continue;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
done
if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dstarg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dstarg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix=/ ;;
-*) prefix=./ ;;
*) prefix= ;;
esac
case $posix_glob in
'')
if (set -f) 2>/dev/null; then
posix_glob=true
else
posix_glob=false
fi ;;
esac
oIFS=$IFS
IFS=/
$posix_glob && set -f
set fnord $dstdir
shift
$posix_glob && set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dst"; then
$doit $rmcmd -f "$dst" 2>/dev/null \
|| { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
&& { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
|| {
echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
} || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@ -1,86 +0,0 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include "kstring.h"
#include "printbuf.h"
#include "parsley_mem.h"
#include "parsley.h"
char* arepl(char* orig, char* old, char* new) {
// printf("y\n");
char* ptr = astrdup(orig);
int nlen = strlen(new);
int olen = strlen(old);
char* i;
struct printbuf * buf = printbuf_new();
while((i = strstr(ptr, old)) != NULL) {
printbuf_memappend(buf, ptr, i - ptr);
printbuf_memappend(buf, new, nlen);
ptr = i + olen;
}
printbuf_memappend(buf, ptr, strlen(ptr));
ptr = astrdup(buf->buf);
printbuf_free(buf);
// printf("z\n");
return ptr;
}
char* astrdup(char* c) {
if(c == NULL) return NULL;
return astrcat(c, "");
}
char* astrcat(char* a, char* b) {
char* output = (char*) parsley_alloc(sizeof(char) * (strlen(a) + strlen(b) + 1));
sprintf(output, "%s%s", a, b);
return output;
}
char* astrcat3(char* a, char* b, char* c) {
char* output = (char*) parsley_alloc(sizeof(char) * (strlen(a) + strlen(b) + strlen(c) + 1));
sprintf(output, "%s%s%s", a, b, c);
return output;
}
char* astrcat4(char* a, char* b, char* c, char* d) {
char* output = (char*) parsley_alloc(sizeof(char) * (strlen(a) + strlen(b) + strlen(c) + strlen(d) + 1));
sprintf(output, "%s%s%s%s", a, b, c, d);
return output;
}
char* astrcat5(char* a, char* b, char* c, char* d, char* e) {
char* output = (char*) parsley_alloc(sizeof(char) * (strlen(a) + strlen(b) + strlen(c) + strlen(d) + strlen(e) + 1));
sprintf(output, "%s%s%s%s%s", a, b, c, d, e);
return output;
}
char* astrcat6(char* a, char* b, char* c, char* d, char* e, char* f) {
char* output = (char*) parsley_alloc(sizeof(char) * (strlen(a) + strlen(b) + strlen(c) + strlen(d) + strlen(e) + strlen(f) + 1));
sprintf(output, "%s%s%s%s%s%s", a, b, c, d, e, f);
return output;
}
char* astrcat7(char* a, char* b, char* c, char* d, char* e, char* f, char* g) {
char* output = (char*) parsley_alloc(sizeof(char) * (strlen(a) + strlen(b) + strlen(c) + strlen(d) + strlen(e) + strlen(f) + strlen(g) + 1));
sprintf(output, "%s%s%s%s%s%s%s", a, b, c, d, e, f, g);
return output;
}
char* astrcat8(char* a, char* b, char* c, char* d, char* e, char* f, char* g, char* h) {
char* output = (char*) parsley_alloc(sizeof(char) * (strlen(a) + strlen(b) + strlen(c) + strlen(d) + strlen(e) + strlen(f) + strlen(g) + strlen(h) + 1));
sprintf(output, "%s%s%s%s%s%s%s%s", a, b, c, d, e, f, g, h);
return output;
}
char* astrcat9(char* a, char* b, char* c, char* d, char* e, char* f, char* g, char* h, char* i) {
char* output = (char*) parsley_alloc(sizeof(char) * (strlen(a) + strlen(b) + strlen(c) + strlen(d) + strlen(e) + strlen(f) + strlen(g) + strlen(h) + strlen(i) + 1));
sprintf(output, "%s%s%s%s%s%s%s%s%s", a, b, c, d, e, f, g, h, i);
return output;
}
char* astrcat10(char* a, char* b, char* c, char* d, char* e, char* f, char* g, char* h, char* i, char* j) {
char* output = (char*) parsley_alloc(sizeof(char) * (strlen(a) + strlen(b) + strlen(c) + strlen(d) + strlen(e) + strlen(f) + strlen(g) + strlen(h) + strlen(i) + strlen(j) + 1));
sprintf(output, "%s%s%s%s%s%s%s%s%s%s", a, b, c, d, e, f, g, h, i, j);
return output;
}

View File

@ -1,15 +0,0 @@
#ifndef KSTRING_INCLUDED
#define KSTRING_INCLUDED
extern char* arepl(char*, char*, char*);
extern char* astrdup(char*);
extern char* astrcat(char*, char*);
extern char* astrcat3(char*, char*, char*);
extern char* astrcat4(char*, char*, char*, char*);
extern char* astrcat5(char*, char*, char*, char*, char*);
extern char* astrcat6(char*, char*, char*, char*, char*, char*);
extern char* astrcat7(char*, char*, char*, char*, char*, char*, char*);
extern char* astrcat8(char*, char*, char*, char*, char*, char*, char*, char*);
extern char* astrcat9(char*, char*, char*, char*, char*, char*, char*, char*, char*);
extern char* astrcat10(char*, char*, char*, char*, char*, char*, char*, char*, char*, char*);
#endif

8890
libtool

File diff suppressed because it is too large Load Diff

8406
ltmain.sh

File diff suppressed because it is too large Load Diff

367
missing
View File

@ -1,367 +0,0 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2006-05-10.23
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# 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, 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 Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case $1 in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $1 in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

510
obstack.c
View File

@ -1,510 +0,0 @@
/* obstack.c - subroutines used implicitly by object stack macros
Copyright (C) 1988,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
NOTE: This source is derived from an old version taken from the GNU C
Library (glibc).
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, 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 Street - Fifth Floor, Boston, MA 02110-1301,
USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "obstack.h"
/* NOTE BEFORE MODIFYING THIS FILE: This version number must be
incremented whenever callers compiled using an old obstack.h can no
longer properly call the functions in this obstack.c. */
#define OBSTACK_INTERFACE_VERSION 1
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself, and the installed library
supports the same library interface we do. This code is part of the GNU
C Library, but also included in many other GNU distributions. Compiling
and linking in this code is a waste when using the GNU C library
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object
files, it is simpler to just do this in the source for each such file. */
#include <stdio.h> /* Random thing to get __GNU_LIBRARY__. */
#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
#include <gnu-versions.h>
#if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
#define ELIDE_CODE
#endif
#endif
#ifndef ELIDE_CODE
#define POINTER void *
/* Determine default alignment. */
struct fooalign {char x; double d;};
#define DEFAULT_ALIGNMENT \
((PTR_INT_TYPE) ((char *) &((struct fooalign *) 0)->d - (char *) 0))
/* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT.
But in fact it might be less smart and round addresses to as much as
DEFAULT_ROUNDING. So we prepare for it to do that. */
union fooround {long x; double d;};
#define DEFAULT_ROUNDING (sizeof (union fooround))
/* When we copy a long block of data, this is the unit to do it with.
On some machines, copying successive ints does not work;
in such a case, redefine COPYING_UNIT to `long' (if that works)
or `char' as a last resort. */
#ifndef COPYING_UNIT
#define COPYING_UNIT int
#endif
/* The functions allocating more room by calling `obstack_chunk_alloc'
jump to the handler pointed to by `obstack_alloc_failed_handler'.
This variable by default points to the internal function
`print_and_abort'. */
static void print_and_abort (void);
void (*obstack_alloc_failed_handler) (void) = print_and_abort;
/* Exit value used when `print_and_abort' is used. */
// Kyle: #if defined __GNU_LIBRARY__ || defined HAVE_STDLIB_H
#include <stdlib.h>
// Kyle: #endif
#ifndef EXIT_FAILURE
#define EXIT_FAILURE 1
#endif
int obstack_exit_failure = EXIT_FAILURE;
/* The non-GNU-C macros copy the obstack into this global variable
to avoid multiple evaluation. */
struct obstack *_obstack;
/* Define a macro that either calls functions with the traditional malloc/free
calling interface, or calls functions with the mmalloc/mfree interface
(that adds an extra first argument), based on the state of use_extra_arg.
For free, do not use ?:, since some compilers, like the MIPS compilers,
do not allow (expr) ? void : void. */
#if defined (__STDC__) && __STDC__
#define CALL_CHUNKFUN(h, size) \
(((h) -> use_extra_arg) \
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
: (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size)))
#define CALL_FREEFUN(h, old_chunk) \
do { \
if ((h) -> use_extra_arg) \
(*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
else \
(*(void (*) (void *)) (h)->freefun) ((old_chunk)); \
} while (0)
#else
#define CALL_CHUNKFUN(h, size) \
(((h) -> use_extra_arg) \
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
: (*(struct _obstack_chunk *(*) ()) (h)->chunkfun) ((size)))
#define CALL_FREEFUN(h, old_chunk) \
do { \
if ((h) -> use_extra_arg) \
(*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
else \
(*(void (*) ()) (h)->freefun) ((old_chunk)); \
} while (0)
#endif
/* Initialize an obstack H for use. Specify chunk size SIZE (0 means default).
Objects start on multiples of ALIGNMENT (0 means use default).
CHUNKFUN is the function to use to allocate chunks,
and FREEFUN the function to free them.
Return nonzero if successful, zero if out of memory.
To recover from an out of memory error,
free up some memory, then call this again. */
int
_obstack_begin (struct obstack *h, int size, int alignment,
POINTER (*chunkfun) (long), void (*freefun) (void *))
{
register struct _obstack_chunk *chunk; /* points to new chunk */
if (alignment == 0)
alignment = (int) DEFAULT_ALIGNMENT;
if (size == 0)
/* Default size is what GNU malloc can fit in a 4096-byte block. */
{
/* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc.
Use the values for range checking, because if range checking is off,
the extra bytes won't be missed terribly, but if range checking is on
and we used a larger request, a whole extra 4096 bytes would be
allocated.
These number are irrelevant to the new GNU malloc. I suspect it is
less sensitive to the size of the request. */
int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1))
+ 4 + DEFAULT_ROUNDING - 1)
& ~(DEFAULT_ROUNDING - 1));
size = 4096 - extra;
}
h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun;
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
h->chunk_size = size;
h->alignment_mask = alignment - 1;
h->use_extra_arg = 0;
chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
if (!chunk)
(*obstack_alloc_failed_handler) ();
h->next_free = h->object_base = chunk->contents;
h->chunk_limit = chunk->limit
= (char *) chunk + h->chunk_size;
chunk->prev = 0;
/* The initial chunk now contains no empty object. */
h->maybe_empty_object = 0;
h->alloc_failed = 0;
return 1;
}
int
_obstack_begin_1 (struct obstack *h, int size, int alignment,
POINTER (*chunkfun) (POINTER, long),
void (*freefun) (POINTER, POINTER), POINTER arg)
{
register struct _obstack_chunk *chunk; /* points to new chunk */
if (alignment == 0)
alignment = (int) DEFAULT_ALIGNMENT;
if (size == 0)
/* Default size is what GNU malloc can fit in a 4096-byte block. */
{
/* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc.
Use the values for range checking, because if range checking is off,
the extra bytes won't be missed terribly, but if range checking is on
and we used a larger request, a whole extra 4096 bytes would be
allocated.
These number are irrelevant to the new GNU malloc. I suspect it is
less sensitive to the size of the request. */
int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1))
+ 4 + DEFAULT_ROUNDING - 1)
& ~(DEFAULT_ROUNDING - 1));
size = 4096 - extra;
}
h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun;
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
h->chunk_size = size;
h->alignment_mask = alignment - 1;
h->extra_arg = arg;
h->use_extra_arg = 1;
chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
if (!chunk)
(*obstack_alloc_failed_handler) ();
h->next_free = h->object_base = chunk->contents;
h->chunk_limit = chunk->limit
= (char *) chunk + h->chunk_size;
chunk->prev = 0;
/* The initial chunk now contains no empty object. */
h->maybe_empty_object = 0;
h->alloc_failed = 0;
return 1;
}
/* Allocate a new current chunk for the obstack *H
on the assumption that LENGTH bytes need to be added
to the current object, or a new object of length LENGTH allocated.
Copies any partial object from the end of the old chunk
to the beginning of the new one. */
void
_obstack_newchunk (struct obstack *h, int length)
{
register struct _obstack_chunk *old_chunk = h->chunk;
register struct _obstack_chunk *new_chunk;
register long new_size;
register long obj_size = h->next_free - h->object_base;
register long i;
long already;
/* Compute size for new chunk. */
new_size = (obj_size + length) + (obj_size >> 3) + 100;
if (new_size < h->chunk_size)
new_size = h->chunk_size;
/* Allocate and initialize the new chunk. */
new_chunk = CALL_CHUNKFUN (h, new_size);
if (!new_chunk)
(*obstack_alloc_failed_handler) ();
h->chunk = new_chunk;
new_chunk->prev = old_chunk;
new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size;
/* Move the existing object to the new chunk.
Word at a time is fast and is safe if the object
is sufficiently aligned. */
if (h->alignment_mask + 1 >= DEFAULT_ALIGNMENT)
{
for (i = obj_size / sizeof (COPYING_UNIT) - 1;
i >= 0; i--)
((COPYING_UNIT *)new_chunk->contents)[i]
= ((COPYING_UNIT *)h->object_base)[i];
/* We used to copy the odd few remaining bytes as one extra COPYING_UNIT,
but that can cross a page boundary on a machine
which does not do strict alignment for COPYING_UNITS. */
already = obj_size / sizeof (COPYING_UNIT) * sizeof (COPYING_UNIT);
}
else
already = 0;
/* Copy remaining bytes one by one. */
for (i = already; i < obj_size; i++)
new_chunk->contents[i] = h->object_base[i];
/* If the object just copied was the only data in OLD_CHUNK,
free that chunk and remove it from the chain.
But not if that chunk might contain an empty object. */
if (h->object_base == old_chunk->contents && ! h->maybe_empty_object)
{
new_chunk->prev = old_chunk->prev;
CALL_FREEFUN (h, old_chunk);
}
h->object_base = new_chunk->contents;
h->next_free = h->object_base + obj_size;
/* The new chunk certainly contains no empty object yet. */
h->maybe_empty_object = 0;
}
/* Return nonzero if object OBJ has been allocated from obstack H.
This is here for debugging.
If you use it in a program, you are probably losing. */
/* Suppress -Wmissing-prototypes warning. We don't want to declare this in
obstack.h because it is just for debugging. */
int _obstack_allocated_p (struct obstack *h, POINTER obj);
int
_obstack_allocated_p (struct obstack *h, POINTER obj)
{
register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
register struct _obstack_chunk *plp; /* point to previous chunk if any */
lp = (h)->chunk;
/* We use >= rather than > since the object cannot be exactly at
the beginning of the chunk but might be an empty object exactly
at the end of an adjacent chunk. */
while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj))
{
plp = lp->prev;
lp = plp;
}
return lp != 0;
}
/* Free objects in obstack H, including OBJ and everything allocate
more recently than OBJ. If OBJ is zero, free everything in H. */
#undef obstack_free
/* This function has two names with identical definitions.
This is the first one, called from non-ANSI code. */
void
_obstack_free (struct obstack *h, POINTER obj)
{
register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
register struct _obstack_chunk *plp; /* point to previous chunk if any */
lp = h->chunk;
/* We use >= because there cannot be an object at the beginning of a chunk.
But there can be an empty object at that address
at the end of another chunk. */
while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj))
{
plp = lp->prev;
CALL_FREEFUN (h, lp);
lp = plp;
/* If we switch chunks, we can't tell whether the new current
chunk contains an empty object, so assume that it may. */
h->maybe_empty_object = 1;
}
if (lp)
{
h->object_base = h->next_free = (char *) (obj);
h->chunk_limit = lp->limit;
h->chunk = lp;
}
else if (obj != 0)
/* obj is not in any of the chunks! */
abort ();
}
/* This function is used from ANSI code. */
void
obstack_free (struct obstack *h, POINTER obj)
{
register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
register struct _obstack_chunk *plp; /* point to previous chunk if any */
lp = h->chunk;
/* We use >= because there cannot be an object at the beginning of a chunk.
But there can be an empty object at that address
at the end of another chunk. */
while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj))
{
plp = lp->prev;
CALL_FREEFUN (h, lp);
lp = plp;
/* If we switch chunks, we can't tell whether the new current
chunk contains an empty object, so assume that it may. */
h->maybe_empty_object = 1;
}
if (lp)
{
h->object_base = h->next_free = (char *) (obj);
h->chunk_limit = lp->limit;
h->chunk = lp;
}
else if (obj != 0)
/* obj is not in any of the chunks! */
abort ();
}
int
_obstack_memory_used (struct obstack *h)
{
register struct _obstack_chunk* lp;
register int nbytes = 0;
for (lp = h->chunk; lp != 0; lp = lp->prev)
{
nbytes += lp->limit - (char *) lp;
}
return nbytes;
}
/* Define the error handler. */
#ifndef _
# if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
# include <libintl.h>
# ifndef _
# define _(Str) gettext (Str)
# endif
# else
# define _(Str) (Str)
# endif
#endif
static void
print_and_abort (void)
{
fputs (_("memory exhausted\n"), stderr);
exit (obstack_exit_failure);
}
#if 0
/* These are now turned off because the applications do not use it
and it uses bcopy via obstack_grow, which causes trouble on sysV. */
/* Now define the functional versions of the obstack macros.
Define them to simply use the corresponding macros to do the job. */
/* The function names appear in parentheses in order to prevent
the macro-definitions of the names from being expanded there. */
POINTER (obstack_base) (struct obstack *obstack)
{
return obstack_base (obstack);
}
POINTER (obstack_next_free) (struct obstack *obstack)
{
return obstack_next_free (obstack);
}
int (obstack_object_size) (struct obstack *obstack)
{
return obstack_object_size (obstack);
}
int (obstack_room) (struct obstack *obstack)
{
return obstack_room (obstack);
}
int (obstack_make_room) (struct obstack *obstack, int length)
{
return obstack_make_room (obstack, length);
}
void (obstack_grow) (struct obstack *obstack, POINTER pointer, int length)
{
obstack_grow (obstack, pointer, length);
}
void (obstack_grow0) (struct obstack *obstack, POINTER pointer, int length)
{
obstack_grow0 (obstack, pointer, length);
}
void (obstack_1grow) (struct obstack *obstack, int character)
{
obstack_1grow (obstack, character);
}
void (obstack_blank) (struct obstack *obstack, int length)
{
obstack_blank (obstack, length);
}
void (obstack_1grow_fast) (struct obstack *obstack, int character)
{
obstack_1grow_fast (obstack, character);
}
void (obstack_blank_fast) (struct obstack *obstack, int length)
{
obstack_blank_fast (obstack, length);
}
POINTER (obstack_finish) (struct obstack *obstack)
{
return obstack_finish (obstack);
}
POINTER (obstack_alloc) (struct obstack *obstack, int length)
{
return obstack_alloc (obstack, length);
}
POINTER (obstack_copy) (struct obstack *obstack, POINTER pointer, int length)
{
return obstack_copy (obstack, pointer, length);
}
POINTER (obstack_copy0) (struct obstack *obstack, POINTER pointer, int length)
{
return obstack_copy0 (obstack, pointer, length);
}
#endif /* 0 */
#endif /* !ELIDE_CODE */

545
obstack.h
View File

@ -1,545 +0,0 @@
/* obstack.h - object stack macros
Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
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, 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 Street - Fifth Floor, Boston, MA 02110-1301,
USA. */
/* Summary:
All the apparent functions defined here are macros. The idea
is that you would use these pre-tested macros to solve a
very specific set of problems, and they would run fast.
Caution: no side-effects in arguments please!! They may be
evaluated MANY times!!
These macros operate a stack of objects. Each object starts life
small, and may grow to maturity. (Consider building a word syllable
by syllable.) An object can move while it is growing. Once it has
been "finished" it never changes address again. So the "top of the
stack" is typically an immature growing object, while the rest of the
stack is of mature, fixed size and fixed address objects.
These routines grab large chunks of memory, using a function you
supply, called `obstack_chunk_alloc'. On occasion, they free chunks,
by calling `obstack_chunk_free'. You must define them and declare
them before using any obstack macros.
Each independent stack is represented by a `struct obstack'.
Each of the obstack macros expects a pointer to such a structure
as the first argument.
One motivation for this package is the problem of growing char strings
in symbol tables. Unless you are "fascist pig with a read-only mind"
--Gosper's immortal quote from HAKMEM item 154, out of context--you
would not like to put any arbitrary upper limit on the length of your
symbols.
In practice this often means you will build many short symbols and a
few long symbols. At the time you are reading a symbol you don't know
how long it is. One traditional method is to read a symbol into a
buffer, realloc()ating the buffer every time you try to read a symbol
that is longer than the buffer. This is beaut, but you still will
want to copy the symbol from the buffer to a more permanent
symbol-table entry say about half the time.
With obstacks, you can work differently. Use one obstack for all symbol
names. As you read a symbol, grow the name in the obstack gradually.
When the name is complete, finalize it. Then, if the symbol exists already,
free the newly read name.
The way we do this is to take a large chunk, allocating memory from
low addresses. When you want to build a symbol in the chunk you just
add chars above the current "high water mark" in the chunk. When you
have finished adding chars, because you got to the end of the symbol,
you know how long the chars are, and you can create a new object.
Mostly the chars will not burst over the highest address of the chunk,
because you would typically expect a chunk to be (say) 100 times as
long as an average object.
In case that isn't clear, when we have enough chars to make up
the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed)
so we just point to it where it lies. No moving of chars is
needed and this is the second win: potentially long strings need
never be explicitly shuffled. Once an object is formed, it does not
change its address during its lifetime.
When the chars burst over a chunk boundary, we allocate a larger
chunk, and then copy the partly formed object from the end of the old
chunk to the beginning of the new larger chunk. We then carry on
accreting characters to the end of the object as we normally would.
A special macro is provided to add a single char at a time to a
growing object. This allows the use of register variables, which
break the ordinary 'growth' macro.
Summary:
We allocate large chunks.
We carve out one object at a time from the current chunk.
Once carved, an object never moves.
We are free to append data of any size to the currently
growing object.
Exactly one object is growing in an obstack at any one time.
You can run one obstack per control block.
You may have as many control blocks as you dare.
Because of the way we do it, you can `unwind' an obstack
back to a previous state. (You may remove objects much
as you would with a stack.)
*/
/* Don't do the contents of this file more than once. */
#ifndef _OBSTACK_H
#define _OBSTACK_H 1
#ifdef __cplusplus
extern "C" {
#endif
/* We use subtraction of (char *) 0 instead of casting to int
because on word-addressable machines a simple cast to int
may ignore the byte-within-word field of the pointer. */
#ifndef __PTR_TO_INT
# define __PTR_TO_INT(P) ((P) - (char *) 0)
#endif
#ifndef __INT_TO_PTR
# define __INT_TO_PTR(P) ((P) + (char *) 0)
#endif
/* We need the type of the resulting object. If __PTRDIFF_TYPE__ is
defined, as with GNU C, use that; that way we don't pollute the
namespace with <stddef.h>'s symbols. Otherwise, if <stddef.h> is
available, include it and use ptrdiff_t. In traditional C, long is
the best that we can do. */
#ifdef __PTRDIFF_TYPE__
# define PTR_INT_TYPE __PTRDIFF_TYPE__
#else
# ifdef HAVE_STDDEF_H
# include <stddef.h>
# define PTR_INT_TYPE ptrdiff_t
# else
# define PTR_INT_TYPE long
# endif
#endif
#if defined _LIBC || defined HAVE_STRING_H
# include <string.h>
# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
#else
# ifdef memcpy
# define _obstack_memcpy(To, From, N) memcpy ((To), (char *)(From), (N))
# else
# define _obstack_memcpy(To, From, N) bcopy ((char *)(From), (To), (N))
# endif
#endif
struct _obstack_chunk /* Lives at front of each chunk. */
{
char *limit; /* 1 past end of this chunk */
struct _obstack_chunk *prev; /* address of prior chunk or NULL */
char contents[4]; /* objects begin here */
};
struct obstack /* control current object in current chunk */
{
long chunk_size; /* preferred size to allocate chunks in */
struct _obstack_chunk *chunk; /* address of current struct obstack_chunk */
char *object_base; /* address of object we are building */
char *next_free; /* where to add next char to current object */
char *chunk_limit; /* address of char after current chunk */
PTR_INT_TYPE temp; /* Temporary for some macros. */
int alignment_mask; /* Mask of alignment for each object. */
/* These prototypes vary based on `use_extra_arg', and we use
casts to the prototypeless function type in all assignments,
but having prototypes here quiets -Wstrict-prototypes. */
struct _obstack_chunk *(*chunkfun) (void *, long);
void (*freefun) (void *, struct _obstack_chunk *);
void *extra_arg; /* first arg for chunk alloc/dealloc funcs */
unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */
unsigned maybe_empty_object:1;/* There is a possibility that the current
chunk contains a zero-length object. This
prevents freeing the chunk if we allocate
a bigger chunk to replace it. */
unsigned alloc_failed:1; /* No longer used, as we now call the failed
handler on error, but retained for binary
compatibility. */
};
/* Declare the external functions we use; they are in obstack.c. */
extern void _obstack_newchunk (struct obstack *, int);
extern void _obstack_free (struct obstack *, void *);
extern int _obstack_begin (struct obstack *, int, int,
void *(*) (long), void (*) (void *));
extern int _obstack_begin_1 (struct obstack *, int, int,
void *(*) (void *, long),
void (*) (void *, void *), void *);
extern int _obstack_memory_used (struct obstack *);
/* Do the function-declarations after the structs
but before defining the macros. */
void obstack_init (struct obstack *obstack);
void * obstack_alloc (struct obstack *obstack, int size);
void * obstack_copy (struct obstack *obstack, void *address, int size);
void * obstack_copy0 (struct obstack *obstack, void *address, int size);
void obstack_free (struct obstack *obstack, void *block);
void obstack_blank (struct obstack *obstack, int size);
void obstack_grow (struct obstack *obstack, void *data, int size);
void obstack_grow0 (struct obstack *obstack, void *data, int size);
void obstack_1grow (struct obstack *obstack, int data_char);
void obstack_ptr_grow (struct obstack *obstack, void *data);
void obstack_int_grow (struct obstack *obstack, int data);
void * obstack_finish (struct obstack *obstack);
int obstack_object_size (struct obstack *obstack);
int obstack_room (struct obstack *obstack);
void obstack_make_room (struct obstack *obstack, int size);
void obstack_1grow_fast (struct obstack *obstack, int data_char);
void obstack_ptr_grow_fast (struct obstack *obstack, void *data);
void obstack_int_grow_fast (struct obstack *obstack, int data);
void obstack_blank_fast (struct obstack *obstack, int size);
void * obstack_base (struct obstack *obstack);
void * obstack_next_free (struct obstack *obstack);
int obstack_alignment_mask (struct obstack *obstack);
int obstack_chunk_size (struct obstack *obstack);
int obstack_memory_used (struct obstack *obstack);
/* Error handler called when `obstack_chunk_alloc' failed to allocate
more memory. This can be set to a user defined function. The
default action is to print a message and abort. */
extern void (*obstack_alloc_failed_handler) (void);
/* Exit value used when `print_and_abort' is used. */
extern int obstack_exit_failure;
/* Pointer to beginning of object being allocated or to be allocated next.
Note that this might not be the final address of the object
because a new chunk might be needed to hold the final size. */
#define obstack_base(h) ((h)->object_base)
/* Size for allocating ordinary chunks. */
#define obstack_chunk_size(h) ((h)->chunk_size)
/* Pointer to next byte not yet allocated in current chunk. */
#define obstack_next_free(h) ((h)->next_free)
/* Mask specifying low bits that should be clear in address of an object. */
#define obstack_alignment_mask(h) ((h)->alignment_mask)
/* To prevent prototype warnings provide complete argument list in
standard C version. */
# define obstack_init(h) \
_obstack_begin ((h), 0, 0, \
(void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
# define obstack_begin(h, size) \
_obstack_begin ((h), (size), 0, \
(void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
_obstack_begin ((h), (size), (alignment), \
(void *(*) (long)) (chunkfun), (void (*) (void *)) (freefun))
# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
_obstack_begin_1 ((h), (size), (alignment), \
(void *(*) (void *, long)) (chunkfun), \
(void (*) (void *, void *)) (freefun), (arg))
# define obstack_chunkfun(h, newchunkfun) \
((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun))
# define obstack_freefun(h, newfreefun) \
((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun))
#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar))
#define obstack_blank_fast(h,n) ((h)->next_free += (n))
#define obstack_memory_used(h) _obstack_memory_used (h)
#if defined __GNUC__ && defined __STDC__ && __STDC__
/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
does not implement __extension__. But that compiler doesn't define
__GNUC_MINOR__. */
# if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
# define __extension__
# endif
/* For GNU C, if not -traditional,
we can define these macros to compute all args only once
without using a global variable.
Also, we can avoid using the `temp' slot, to make faster code. */
# define obstack_object_size(OBSTACK) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
(unsigned) (__o->next_free - __o->object_base); })
# define obstack_room(OBSTACK) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
(unsigned) (__o->chunk_limit - __o->next_free); })
# define obstack_make_room(OBSTACK,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
if (__o->chunk_limit - __o->next_free < __len) \
_obstack_newchunk (__o, __len); \
(void) 0; })
# define obstack_empty_p(OBSTACK) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
(__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); })
# define obstack_grow(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
if (__o->next_free + __len > __o->chunk_limit) \
_obstack_newchunk (__o, __len); \
_obstack_memcpy (__o->next_free, (where), __len); \
__o->next_free += __len; \
(void) 0; })
# define obstack_grow0(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
if (__o->next_free + __len + 1 > __o->chunk_limit) \
_obstack_newchunk (__o, __len + 1); \
_obstack_memcpy (__o->next_free, (where), __len); \
__o->next_free += __len; \
*(__o->next_free)++ = 0; \
(void) 0; })
# define obstack_1grow(OBSTACK,datum) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
if (__o->next_free + 1 > __o->chunk_limit) \
_obstack_newchunk (__o, 1); \
obstack_1grow_fast (__o, datum); \
(void) 0; })
/* These assume that the obstack alignment is good enough for pointers or ints,
and that the data added so far to the current object
shares that much alignment. */
# define obstack_ptr_grow(OBSTACK,datum) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
_obstack_newchunk (__o, sizeof (void *)); \
obstack_ptr_grow_fast (__o, datum); })
# define obstack_int_grow(OBSTACK,datum) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
if (__o->next_free + sizeof (int) > __o->chunk_limit) \
_obstack_newchunk (__o, sizeof (int)); \
obstack_int_grow_fast (__o, datum); })
# define obstack_ptr_grow_fast(OBSTACK,aptr) \
__extension__ \
({ struct obstack *__o1 = (OBSTACK); \
*(const void **) __o1->next_free = (aptr); \
__o1->next_free += sizeof (const void *); \
(void) 0; })
# define obstack_int_grow_fast(OBSTACK,aint) \
__extension__ \
({ struct obstack *__o1 = (OBSTACK); \
*(int *) __o1->next_free = (aint); \
__o1->next_free += sizeof (int); \
(void) 0; })
# define obstack_blank(OBSTACK,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
if (__o->chunk_limit - __o->next_free < __len) \
_obstack_newchunk (__o, __len); \
obstack_blank_fast (__o, __len); \
(void) 0; })
# define obstack_alloc(OBSTACK,length) \
__extension__ \
({ struct obstack *__h = (OBSTACK); \
obstack_blank (__h, (length)); \
obstack_finish (__h); })
# define obstack_copy(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__h = (OBSTACK); \
obstack_grow (__h, (where), (length)); \
obstack_finish (__h); })
# define obstack_copy0(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__h = (OBSTACK); \
obstack_grow0 (__h, (where), (length)); \
obstack_finish (__h); })
/* The local variable is named __o1 to avoid a name conflict
when obstack_blank is called. */
# define obstack_finish(OBSTACK) \
__extension__ \
({ struct obstack *__o1 = (OBSTACK); \
void *value; \
value = (void *) __o1->object_base; \
if (__o1->next_free == value) \
__o1->maybe_empty_object = 1; \
__o1->next_free \
= __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\
& ~ (__o1->alignment_mask)); \
if (__o1->next_free - (char *)__o1->chunk \
> __o1->chunk_limit - (char *)__o1->chunk) \
__o1->next_free = __o1->chunk_limit; \
__o1->object_base = __o1->next_free; \
value; })
# define obstack_free(OBSTACK, OBJ) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
void *__obj = (void *) (OBJ); \
if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \
__o->next_free = __o->object_base = (char *) __obj; \
else (obstack_free) (__o, __obj); })
#else /* not __GNUC__ or not __STDC__ */
# define obstack_object_size(h) \
(unsigned) ((h)->next_free - (h)->object_base)
# define obstack_room(h) \
(unsigned) ((h)->chunk_limit - (h)->next_free)
# define obstack_empty_p(h) \
((h)->chunk->prev == 0 && (h)->next_free - (h)->chunk->contents == 0)
/* Note that the call to _obstack_newchunk is enclosed in (..., 0)
so that we can avoid having void expressions
in the arms of the conditional expression.
Casting the third operand to void was tried before,
but some compilers won't accept it. */
# define obstack_make_room(h,length) \
( (h)->temp = (length), \
(((h)->next_free + (h)->temp > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp), 0) : 0))
# define obstack_grow(h,where,length) \
( (h)->temp = (length), \
(((h)->next_free + (h)->temp > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
_obstack_memcpy ((h)->next_free, (where), (h)->temp), \
(h)->next_free += (h)->temp)
# define obstack_grow0(h,where,length) \
( (h)->temp = (length), \
(((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \
_obstack_memcpy ((h)->next_free, (where), (h)->temp), \
(h)->next_free += (h)->temp, \
*((h)->next_free)++ = 0)
# define obstack_1grow(h,datum) \
( (((h)->next_free + 1 > (h)->chunk_limit) \
? (_obstack_newchunk ((h), 1), 0) : 0), \
obstack_1grow_fast (h, datum))
# define obstack_ptr_grow(h,datum) \
( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \
? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \
obstack_ptr_grow_fast (h, datum))
# define obstack_int_grow(h,datum) \
( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \
? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \
obstack_int_grow_fast (h, datum))
# define obstack_ptr_grow_fast(h,aptr) \
(((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr))
# define obstack_int_grow_fast(h,aint) \
(((int *) ((h)->next_free += sizeof (int)))[-1] = (aptr))
# define obstack_blank(h,length) \
( (h)->temp = (length), \
(((h)->chunk_limit - (h)->next_free < (h)->temp) \
? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
obstack_blank_fast (h, (h)->temp))
# define obstack_alloc(h,length) \
(obstack_blank ((h), (length)), obstack_finish ((h)))
# define obstack_copy(h,where,length) \
(obstack_grow ((h), (where), (length)), obstack_finish ((h)))
# define obstack_copy0(h,where,length) \
(obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))
# define obstack_finish(h) \
( ((h)->next_free == (h)->object_base \
? (((h)->maybe_empty_object = 1), 0) \
: 0), \
(h)->temp = __PTR_TO_INT ((h)->object_base), \
(h)->next_free \
= __INT_TO_PTR ((__PTR_TO_INT ((h)->next_free)+(h)->alignment_mask) \
& ~ ((h)->alignment_mask)), \
(((h)->next_free - (char *) (h)->chunk \
> (h)->chunk_limit - (char *) (h)->chunk) \
? ((h)->next_free = (h)->chunk_limit) : 0), \
(h)->object_base = (h)->next_free, \
__INT_TO_PTR ((h)->temp))
# define obstack_free(h,obj) \
( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
(((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
? (int) ((h)->next_free = (h)->object_base \
= (h)->temp + (char *) (h)->chunk) \
: (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0)))
#endif /* not __GNUC__ or not __STDC__ */
#ifdef __cplusplus
} /* C++ */
#endif
#endif /* obstack.h */

590
parser.y
View File

@ -1,590 +0,0 @@
%{
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "kstring.h"
#include <libxml/hash.h>
#ifndef PARSER_Y_H_INCLUDED
#define PARSER_Y_H_INCLUDED
#define YYSTYPE char *
static char* parsed_answer;
int yylex (void);
void yyerror (char const *);
void prepare_parse(char*);
void cleanup_parse(void);
void start_debugging(void);
static xmlHashTablePtr alias_hash;
char* xpath_alias(char*);
void init_xpath_alias();
int yyparse(void);
char* myparse(char*);
void answer(char*);
#endif
%}
%glr-parser
%token_table
%debug
%token NUMBER
%token S
%token AT
%token LPAREN
%token RPAREN
%token PIPE
%token LT
%token SLASH
%token DBLSLASH
%token BANG
%token COLON
%token DBLCOLON
%token QUERY
%token HASH
%token COMMA
%token DOT
%token DBLDOT
%token GT
%token LBRA
%token RBRA
%token TILDE
%token SPLAT
%token PLUS
%token DASH
%token EQ
%token LTE
%token GTE
%token DOLLAR
%token BSLASHLIT
%token OTHER
%token XANCESTOR
%token XANCESTORSELF
%token XATTR
%token XCHILD
%token XDESC
%token XDESCSELF
%token XFOLLOW
%token XFOLLOWSIB
%token XNS
%token XPARENT
%token XPRE
%token XPRESIB
%token XSELF
%token XOR
%token XAND
%token XDIV
%token XMOD
%token XCOMMENT
%token XTEXT
%token XPI
%token XNODE
%token CXEQUATION
%token CXOPHE
%token CXOPNE
%token CXOPSTARTEQ
%token CXOPENDEQ
%token CXOPCONTAINS
%token CXOPCONTAINS2
%token CXFIRST
%token CXLAST
%token CXNOT
%token CXEVEN
%token CXODD
%token CXEQ
%token CXGT
%token CXLT
%token CXHEADER
%token CXCONTAINS
%token CXEMPTY
%token CXHAS
%token CXPARENT
%token CXNTHCH
%token CXNTHLASTCH
%token CXNTHTYPE
%token CXNTHLASTTYPE
%token CXFIRSTCH
%token CXLASTCH
%token CXFIRSTTYPE
%token CXLASTTYPE
%token CXONLYCH
%token CXONLYTYPE
%token CXINPUT
%token CXTEXT
%token CXPASSWORD
%token CXRADIO
%token CXCHECKBOX
%token CXSUBMIT
%token CXIMAGE
%token CXRESET
%token CXBUTTON
%token CXFILE
%token CXENABLED
%token CXDISABLED
%token CXCHECKED
%token CXSELECTED
%token NAME
%token STRING
%%
Root
: Expr OptS { answer($1); }
;
LocationPath
: RelativeLocationPath %dprec 1
| AbsoluteLocationPath %dprec 1
| selectors_group %dprec 3
;
AbsoluteLocationPath
: SLASH RelativeLocationPath { $$ = astrcat($1, $2); }
| SLASH
| AbbreviatedAbsoluteLocationPath
;
RelativeLocationPath
: Step
| RelativeLocationPath SLASH Step { $$ = astrcat3($1, $2, $3); }
| AbbreviatedRelativeLocationPath
;
Step
: AxisSpecifier NodeTest { $$ = astrcat($1, $2); }
| AxisSpecifier NodeTest Predicate { $$ = astrcat3($1, $2, $3); }
| AbbreviatedStep
;
AxisSpecifier
: AxisName DBLCOLON { $$ = astrcat($1, $2); }
| AbbreviatedAxisSpecifier
;
AxisName
: XANCESTOR
| XANCESTORSELF
| XATTR
| XCHILD
| XDESC
| XDESCSELF
| XFOLLOW
| XFOLLOWSIB
| XNS
| XPARENT
| XPRE
| XPRESIB
| XSELF
;
NodeTest
: NameTest
| NodeType LPAREN RPAREN { $$ = astrcat3($1, $2, $3); }
| XPI LPAREN Literal RPAREN { $$ = astrcat4($1, $2, $3, $4); }
;
Predicate
: LBRA PredicateExpr RBRA { $$ = astrcat3($1, $2, $3); }
;
PredicateExpr
: Expr
;
AbbreviatedAbsoluteLocationPath
: DBLSLASH RelativeLocationPath { $$ = astrcat($1, $2); }
;
AbbreviatedRelativeLocationPath
: RelativeLocationPath DBLSLASH Step { $$ = astrcat3($1, $2, $3); }
;
AbbreviatedStep
: DOT
| DBLDOT
;
AbbreviatedAxisSpecifier
: AT
| { $$ = ""; }
;
Expr
: LPAREN Expr RPAREN %dprec 2 { $$ = $2; }
| OrExpr %dprec 1
;
PrimaryExpr
: VariableReference
| LPAREN Expr RPAREN { $$ = astrcat3($1, $2, $3); }
| Literal
| Number
| FunctionCall
;
FunctionCall
: FunctionName LPAREN Arguments RPAREN { $$ = astrcat4(xpath_alias($1), $2, $3, $4); }
;
Arguments
: ArgumentSet
| { $$ = ""; }
;
ArgumentSet
: Argument COMMA ArgumentSet %dprec 2 { $$ = astrcat3($1, $2, $3); }
| Argument %dprec 1
;
Argument
: OptS Expr OptS { $$ = $2; }
;
UnionExpr
: PathExpr
| UnionExpr PIPE PathExpr { $$ = astrcat3($1, $2, $3); }
;
PathExpr
: LocationPath
| FilterExpr
| FilterExpr SLASH RelativeLocationPath { $$ = astrcat3($1, $2, $3); }
| FilterExpr DBLSLASH RelativeLocationPath { $$ = astrcat3($1, $2, $3); }
;
FilterExpr
: PrimaryExpr
| FilterExpr Predicate { $$ = astrcat($1, $2); }
;
OrExpr
: AndExpr
| OrExpr XOR AndExpr { $$ = astrcat3($1, $2, $3); }
;
AndExpr
: EqualityExpr
| AndExpr XAND EqualityExpr { $$ = astrcat3($1, $2, $3); }
;
EqualityExpr
: RelationalExpr
| EqualityExpr EQ RelationalExpr { $$ = astrcat3($1, $2, $3); }
| EqualityExpr CXOPNE RelationalExpr { $$ = astrcat3($1, $2, $3); }
;
RelationalExpr
: AdditiveExpr
| RelationalExpr LT AdditiveExpr { $$ = astrcat3($1, $2, $3); }
| RelationalExpr GT AdditiveExpr { $$ = astrcat3($1, $2, $3); }
| RelationalExpr LTE AdditiveExpr { $$ = astrcat3($1, $2, $3); }
| RelationalExpr GTE AdditiveExpr { $$ = astrcat3($1, $2, $3); }
;
AdditiveExpr
: MultiplicativeExpr
| AdditiveExpr PLUS MultiplicativeExpr { $$ = astrcat3($1, $2, $3); }
| AdditiveExpr DASH MultiplicativeExpr { $$ = astrcat3($1, $2, $3); }
;
MultiplicativeExpr
: UnaryExpr
| MultiplicativeExpr MultiplyOperator UnaryExpr { $$ = astrcat3($1, $2, $3); }
| MultiplicativeExpr XDIV UnaryExpr { $$ = astrcat3($1, $2, $3); }
| MultiplicativeExpr XMOD UnaryExpr { $$ = astrcat3($1, $2, $3); }
;
UnaryExpr
: UnionExpr
| DASH UnaryExpr { $$ = astrcat($1, $2); }
;
ExprToken
: LPAREN
| RPAREN
| LBRA
| RBRA
| DOT
| DBLDOT
| AT
| COMMA
| DBLCOLON
| NameTest
| NodeType
| Operator
| FunctionName
| AxisName
| Literal
| Number
| VariableReference
;
Literal
: STRING
;
Number
: NUMBER
| NUMBER DOT { $$ = astrcat($1, $2); }
| NUMBER DOT NUMBER { $$ = astrcat3($1, $2, $3); }
| DOT NUMBER { $$ = astrcat($1, $2); }
;
Operator
: OperatorName
| MultiplyOperator
| SLASH
| DBLSLASH
| PIPE
| PLUS
| DASH
| EQ
| CXOPNE
| LT
| LTE
| GT
| GTE
;
OperatorName
: XAND
| XOR
| XMOD
| XDIV
;
MultiplyOperator
: SPLAT
;
VariableReference
: DOLLAR QName { $$ = astrcat($1, $2); }
;
NameTest
: SPLAT
| NCName COLON SPLAT { $$ = astrcat3($1, $2, $3); }
| QName
;
NodeType
: XCOMMENT
| XTEXT
| XPI
| XNODE
;
ExprWhitespace
: S
FunctionName
: QName
;
QName
: PrefixedName
| UnprefixedName
;
PrefixedName
: Prefix COLON LocalPart { $$ = astrcat3($1, $2, $3); }
;
UnprefixedName
: LocalPart
;
Prefix
: NCName
;
LocalPart
: NCName
;
NCName
: NAME
;
selectors_group
: attribute_extended_selector COMMA OptS selectors_group { $$ = astrcat4(".//", $1, "|", $4); }
| attribute_extended_selector { $$ = astrcat(".//", $1); }
;
attribute_extended_selector
: selector
| selector S AT NAME { $$ = astrcat3($1, "/@", $4); }
;
selector
: simple_selector_sequence combinator selector { $$ = astrcat3($1, $2, $3); }
| simple_selector_sequence
;
combinator
: PLUS OptS { $$ = "/following-sibling::*[1]/self::"; }
| GT OptS { $$ = "/"; }
| TILDE OptS { $$ = "/following-sibling::*/self::"; }
| S { $$ = "//"; }
;
simple_selector_sequence
: simple_selector_anchor
| possibly_empty_sequence HASH Ident { $$ = astrcat4($1, "[@id='", $3,"']"); }
| possibly_empty_sequence DOT Ident { $$ = astrcat4($1, "[contains(concat( ' ', @class, ' ' ), concat( ' ', '", $3, "', ' ' ))]"); }
| possibly_empty_sequence LBRA type_selector RBRA { $$ = astrcat4($1, "[@", $3, "]"); }
| possibly_empty_sequence LBRA type_selector OptS EQ OptS StringLike OptS RBRA { $$ = astrcat6($1, "[@", $3, " = ", $7, "]"); }
| possibly_empty_sequence LBRA type_selector OptS CXOPHE OptS StringLike OptS RBRA { $$ = astrcat10($1, "[@", $3, " = ", $7, " or starts-with(@", $3, ", concat(", $7, ", '-' ))]"); }
| possibly_empty_sequence LBRA type_selector OptS CXOPNE OptS StringLike OptS RBRA { $$ = astrcat6($1, "[@", $3, " != ", $7, "]"); }
| possibly_empty_sequence LBRA type_selector OptS CXOPSTARTEQ OptS StringLike OptS RBRA { $$ = astrcat6($1, "[starts-with(@", $3, ", ", $7, ")]"); }
| possibly_empty_sequence LBRA type_selector OptS CXOPENDEQ OptS StringLike OptS RBRA { $$ = astrcat6($1, "[ends-with(@", $3, ", ", $7, ")]"); }
| possibly_empty_sequence LBRA type_selector OptS CXOPCONTAINS OptS StringLike OptS RBRA { $$ = astrcat6($1, "[contains(@", $3, ", ", $7, ")]"); }
| possibly_empty_sequence LBRA type_selector OptS CXOPCONTAINS2 OptS StringLike OptS RBRA { $$ = astrcat6($1, "[contains(@", $3, ", ", $7, ")]"); }
| possibly_empty_sequence CXFIRST { $$ = astrcat($1, "[1]"); }
| possibly_empty_sequence CXLAST { $$ = astrcat($1, "[last()]"); }
| possibly_empty_sequence CXNOT LPAREN selectors_group RPAREN { $$ = astrcat5("set-difference(", $1, ", ", $4, ")"); }
| possibly_empty_sequence CXEVEN { $$ = astrcat($1, "[position() % 2 = 0]"); }
| possibly_empty_sequence CXODD { $$ = astrcat($1, "[position() % 2 = 1]"); }
| possibly_empty_sequence CXEQ LPAREN NumberLike RPAREN { $$ = astrcat4($1, "[position() = ", $4, "]"); }
| possibly_empty_sequence CXGT LPAREN NumberLike RPAREN { $$ = astrcat4($1, "[position() > ", $4, "]"); }
| possibly_empty_sequence CXLT LPAREN NumberLike RPAREN { $$ = astrcat4($1, "[position() < ", $4, "]"); }
| possibly_empty_sequence CXHEADER { $$ = astrcat($1, "[contains('h1 h2 h3 h4 h5 h6', lower-case(local-name()))]"); }
| possibly_empty_sequence CXCONTAINS LPAREN StringLike RPAREN { $$ = astrcat4($1, "[contains(., ", $4, "]"); }
| possibly_empty_sequence CXEMPTY { $$ = astrcat($1, "[not(node())]"); }
| possibly_empty_sequence CXHAS LPAREN selectors_group RPAREN { $$ = astrcat4($1, "[", $4, "]"); }
| possibly_empty_sequence CXPARENT { $$ = astrcat($1, "[node()]"); }
| possibly_empty_sequence CXNTHCH LPAREN NumberLike RPAREN { $$ = astrcat4("*[", $4, "]/self::", $1); }
| possibly_empty_sequence CXNTHLASTCH LPAREN NumberLike RPAREN { $$ = astrcat4("*[last() - ", $4, "]/self::", $1); }
| possibly_empty_sequence CXNTHTYPE LPAREN NumberLike RPAREN { $$ = astrcat4($1, "[position() = ", $4, "]"); }
| possibly_empty_sequence CXNTHLASTTYPE LPAREN NumberLike RPAREN { $$ = astrcat4($1, "[position() = last() - ", $4, "]"); }
| possibly_empty_sequence CXFIRSTCH { $$ = astrcat("*[1]/self::", $1); }
| possibly_empty_sequence CXLASTCH { $$ = astrcat("*[last()]/self::", $1); }
| possibly_empty_sequence CXFIRSTTYPE { $$ = astrcat($1, "[1]"); }
| possibly_empty_sequence CXLASTTYPE { $$ = astrcat($1, "[last()]"); }
| possibly_empty_sequence CXONLYCH { $$ = astrcat("*[count()=1]/self::", $1); }
| possibly_empty_sequence CXONLYTYPE { $$ = astrcat($1, "[count()=1]"); }
| possibly_empty_sequence CXINPUT { $$ = astrcat($1, "[lower-case(name)='input']"); }
| possibly_empty_sequence CXTEXT { $$ = astrcat($1, "[lower-case(name)='input' and lower-case(@type)='text']"); }
| possibly_empty_sequence CXPASSWORD { $$ = astrcat($1, "[lower-case(name)='input' and lower-case(@type)='password']"); }
| possibly_empty_sequence CXRADIO { $$ = astrcat($1, "[lower-case(name)='input' and lower-case(@type)='radio']"); }
| possibly_empty_sequence CXCHECKBOX { $$ = astrcat($1, "[lower-case(name)='input' and lower-case(@type)='checkbox']"); }
| possibly_empty_sequence CXSUBMIT { $$ = astrcat($1, "[lower-case(name)='input' and lower-case(@type)='submit']"); }
| possibly_empty_sequence CXIMAGE { $$ = astrcat($1, "[lower-case(name)='input' and lower-case(@type)='image']"); }
| possibly_empty_sequence CXRESET { $$ = astrcat($1, "[lower-case(name)='input' and lower-case(@type)='reset']"); }
| possibly_empty_sequence CXBUTTON { $$ = astrcat($1, "[lower-case(name)='input' and lower-case(@type)='button']"); }
| possibly_empty_sequence CXFILE { $$ = astrcat($1, "[lower-case(name)='input' and lower-case(@type)='file']"); }
| possibly_empty_sequence CXENABLED { $$ = astrcat($1, "[lower-case(name)='input' and not(@disabled)]"); }
| possibly_empty_sequence CXDISABLED { $$ = astrcat($1, "[lower-case(name)='input' and @disabled]"); }
| possibly_empty_sequence CXCHECKED { $$ = astrcat($1, "[@checked]"); }
| possibly_empty_sequence CXSELECTED { $$ = astrcat($1, "[@selected]"); }
;
possibly_empty_sequence
: simple_selector_sequence
| { $$ = "*"; }
;
simple_selector_anchor
: type_selector
| universal
;
type_selector
: namespace_prefix element_name { $$ = astrcat3($1, ":", $2); }
| element_name
;
namespace_prefix
: SPLAT PIPE { $$ = "*"; }
| Ident PIPE { $$ = $1; }
| PIPE { $$ = "*"; }
;
element_name
: Ident
;
universal
: namespace_prefix SPLAT { $$ = astrcat3($1, ":", $2); }
| SPLAT
;
NumberLike
: NUMBER
;
Ident
: NAME
| BSLASHLIT { *$$ = *astrdup($1) + 1; }
| NAME Ident { $$ = strcat($1, $2); }
| BSLASHLIT Ident { *$$ = (*astrcat($1, $2) + 1); }
| keyword
;
keyword
: XANCESTOR
| XANCESTORSELF
| XATTR
| XCHILD
| XDESC
| XDESCSELF
| XFOLLOW
| XFOLLOWSIB
| XNS
| XPARENT
| XPRE
| XPRESIB
| XSELF
| XOR
| XAND
| XDIV
| XMOD
| XCOMMENT
| XTEXT
| XPI
| XNODE
;
StringLike
: Ident { $$ = astrcat3("'", $1, "'"); }
| STRING
;
OptS
: S { $$ = " "; }
| { $$ = ""; }
;
%%
char* xpath_alias(char* key) {
char* value = (char*) xmlHashLookup(alias_hash, key);
return value == NULL ? key : value;
}
void init_xpath_alias() {
alias_hash = xmlHashCreate(100);
xmlHashAddEntry(alias_hash, "html", "lib:html-document");
xmlHashAddEntry(alias_hash, "match", "regexp:match");
xmlHashAddEntry(alias_hash, "replace", "regexp:replace");
xmlHashAddEntry(alias_hash, "test", "regexp:test");
xmlHashAddEntry(alias_hash, "with-newlines", "lib:nl");
}
char* myparse(char* string){
// start_debugging();
prepare_parse(string);
yyparse();
cleanup_parse();
return parsed_answer;
}
void answer(char* a){
parsed_answer = a;
}
void start_debugging(){
yydebug = 1;
return;
}

419
parsley.c
View File

@ -1,419 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <argp.h>
#include <stdarg.h>
#include <json/json.h>
#include "kstring.h"
#include "parsley.h"
#include "y.tab.h"
#include "printbuf.h"
#include "functions.h"
#include "util.h"
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include <stdbool.h>
#include <libxslt/xslt.h>
#include <libxslt/xsltInternals.h>
#include <libxslt/transform.h>
#include <libxml/parser.h>
#include <libxml/HTMLparser.h>
#include <libxml/HTMLtree.h>
#include <libxml/xmlwriter.h>
#include <libexslt/exslt.h>
int yywrap(void){
return 1;
}
void parsed_parsley_free(parsedParsleyPtr ptr) {
if(ptr->xml != NULL) xmlFree(ptr->xml);
if(ptr->error != NULL) free(ptr->error);
free(ptr);
}
static parsedParsleyPtr parse_error(char* format, ...) {
parsedParsleyPtr ptr = (parsedParsleyPtr) calloc(sizeof(parsed_parsley), 1);
ptr->xml = NULL;
va_list args;
va_start(args, format);
vasprintf(&ptr->error, format, args);
va_end(args);
return ptr;
}
parsedParsleyPtr parsley_parse_file(parsleyPtr parsley, char* file, bool html) {
if(html) {
htmlParserCtxtPtr htmlCtxt = htmlNewParserCtxt();
htmlDocPtr html = htmlCtxtReadFile(htmlCtxt, file, NULL, HTML_PARSE_RECOVER | HTML_PARSE_NOERROR |HTML_PARSE_NOWARNING);
htmlFreeParserCtxt(htmlCtxt);
if(html == NULL) return parse_error("Couldn't parse file: %s\n", file);
return parsley_parse_doc(parsley, html);
} else {
xmlParserCtxtPtr ctxt = xmlNewParserCtxt();
xmlDocPtr xml = xmlCtxtReadFile(ctxt, file, NULL, HTML_PARSE_RECOVER | HTML_PARSE_NOERROR |HTML_PARSE_NOWARNING);
xmlFreeParserCtxt(ctxt);
if(xml == NULL) return parse_error("Couldn't parse file: %s\n", file);
return parsley_parse_doc(parsley, xml);
}
}
parsedParsleyPtr parsley_parse_string(parsleyPtr parsley, char* string, size_t size, bool html) {
if(html) {
htmlParserCtxtPtr htmlCtxt = htmlNewParserCtxt();
htmlDocPtr html = htmlCtxtReadMemory(htmlCtxt, string, size, "http://parslets.com/in-memory-string", NULL, HTML_PARSE_RECOVER | HTML_PARSE_NOERROR |HTML_PARSE_NOWARNING);
if(html == NULL) return parse_error("Couldn't parse string");
return parsley_parse_doc(parsley, html);
} else {
xmlParserCtxtPtr ctxt = xmlNewParserCtxt();
xmlDocPtr xml = xmlCtxtReadMemory(ctxt, string, size, "http://parslets.com/in-memory-string", NULL, HTML_PARSE_RECOVER | HTML_PARSE_NOERROR |HTML_PARSE_NOWARNING);
if(xml == NULL) return parse_error("Couldn't parse string");
return parsley_parse_doc(parsley, xml);
}
}
static char *
xpath_of(xmlNodePtr node) {
char *out = NULL;
while(node->name != NULL && node->parent != NULL) {
out = out == NULL ? node->name : astrcat3(node->name, "/", out);
node = node->parent;
}
return astrcat("/", out);
}
static void
unlink(xmlNodePtr xml) {
if(xml == NULL || xml->parent == NULL) return;
xmlNodePtr sibling = xml->parent->children;
if(sibling == xml) {
xml->parent->children = xml->next;
return;
}
while(sibling != NULL) {
if(sibling == xml) {
xml->prev->next = xml->next;
if(xml->next) xml->next->prev = xml->prev;
}
sibling = sibling->next;
}
}
static bool
is_root(xmlElementPtr xml) {
return xml != NULL && xml->name != NULL && xml->prefix !=NULL && !strcmp(xml->name, "root") && !strcmp(xml->prefix, "parsley");
}
static void
prune(parsedParsleyPtr ptr, xmlNodePtr xml, char* err) {
if(xml == NULL) return;
bool optional = ((xmlElementPtr )xml)->attributes != NULL;
if(optional) {
unlink(xml);
visit(ptr, xml->parent, true);
return;
} else {
if(err == NULL) asprintf(&err, "%s was empty", xpath_of(xml));
if(xml->parent != xml->doc->children) {
prune(ptr, xml->parent, err);
} else {
ptr->error = err;
}
}
}
static void
visit(parsedParsleyPtr ptr, xmlNodePtr xml, bool bubbling) {
if(xml->type != XML_ELEMENT_NODE) return;
xmlNodePtr child = xml->children;
xmlNodePtr parent = xml->parent;
if(parent == NULL) return;
if(xml_empty(xml)) prune(ptr, xml, NULL);
while(!bubbling && child != NULL){
visit(ptr, child, bubbling);
child = child->next;
}
}
static bool
xml_empty(xmlNodePtr xml) {
xmlNodePtr child = xml->children;
while(child != NULL) {
if(child->type != XML_TEXT_NODE) return false;
if(strlen(child->content)) return false;
child = child->next;
}
return true;
}
parsedParsleyPtr parsley_parse_doc(parsleyPtr parsley, xmlDocPtr doc) {
parsedParsleyPtr ptr = (parsedParsleyPtr) calloc(sizeof(parsed_parsley), 1);
ptr->parsley = parsley;
ptr->xml = xsltApplyStylesheet(parsley->stylesheet, doc, NULL);
if(ptr->xml != NULL && ptr->error == NULL) visit(ptr, ptr->xml->children, false);
if(ptr->xml == NULL && ptr->error == NULL) { // == NULL
ptr->error = strdup("Internal runtime error");
}
return ptr;
}
parsleyPtr parsley_compile(char* parsley_str, char* incl) {
parsleyPtr parsley = (parsleyPtr) calloc(sizeof(compiled_parsley), 1);
if(last_parsley_error != NULL) {
free(last_parsley_error);
last_parsley_error = NULL;
}
registerEXSLT();
struct json_object *json = json_tokener_parse(parsley_str);
if(is_error(json)) {
parsley->error = strdup("Your parslet is not valid json.");
// json_object_put(json); // frees json
return parsley;
}
struct printbuf* buf = printbuf_new();
sprintbuf_parsley_header(buf);
sprintbuf(buf, "%s\n", incl);
sprintbuf(buf, "<xsl:template match=\"/\">\n");
sprintbuf(buf, "<parsley:root>\n");
contextPtr context = new_context(json, buf);
__parsley_recurse(context);
json_object_put(json); // frees json
parsley->error = last_parsley_error;
sprintbuf(buf, "</parsley:root>\n");
sprintbuf(buf, "</xsl:template>\n");
sprintbuf(buf, context->key_buf->buf);
sprintbuf(buf, "</xsl:stylesheet>\n");
if(parsley->error == NULL) {
xmlParserCtxtPtr ctxt = xmlNewParserCtxt();
xmlDocPtr doc = xmlCtxtReadMemory(ctxt, buf->buf, buf->size, "http://parslets.com/compiled", NULL, 3);
xmlFreeParserCtxt(ctxt);
parsley->raw_stylesheet = strdup(buf->buf);
parsley->stylesheet = xsltParseStylesheetDoc(doc);
}
printbuf_free(buf);
parsley_collect();
return parsley;
}
static contextPtr new_context(struct json_object * json, struct printbuf *buf) {
contextPtr c = parsley_alloc(sizeof(parsley_context));
c->key_buf = printbuf_new();
sprintbuf(c->key_buf, "");
c->name = "root";
c->tag = "root";
c->full_expr = "/";
c->expr = NULL;
c->magic = NULL;
c->filter = NULL;
c->buf = buf;
c->json = json;
c->parent = NULL;
c->array = 0;
c->string = 0;
c->flags = 0;
c->keys = NULL;
c->zipped = 0;
return c;
}
contextPtr deeper_context(contextPtr context, char* key, struct json_object * val) {
contextPtr c = parsley_alloc(sizeof(parsley_context));
c->key_buf = context->key_buf;
c->keys = context->keys;
c->tag = parsley_key_tag(key);
c->flags = parsley_key_flags(key);
c->name = astrcat3(context->name, ".", c->tag);
parsley_parsing_context = c;
c->array = val != NULL && json_object_is_type(val, json_type_array);
c->json = c->array ? json_object_array_get_idx(val, 0) : val;
c->string = val != NULL && json_object_is_type(c->json, json_type_string);
c->filter = parsley_key_filter(key);
c->magic = ((c->filter == NULL) && c->array && !(c->string)) ? c->name : context->magic;
if(context->filter != NULL && !c->array) c->magic = NULL;
c->buf = context->buf;
c->raw_expr = c->string ? myparse(astrdup(json_object_get_string(c->json))) : NULL;
c->full_expr = full_expr(context, c->filter);
c->full_expr = full_expr(c, c->raw_expr);
c->expr = filter_intersection(c->magic, c->raw_expr);
c->filter = filter_intersection(c->magic, c->filter);
c->parent = context;
return c;
}
static char* filter_intersection(char* key, char* expr) {
if(key != NULL && expr != NULL) {
return astrcat7("set:intersection(key('", key, "__key', $", key, "__index), ", expr, ")");
} else {
return expr;
}
}
void parsley_free(parsleyPtr ptr) {
if(ptr->error != NULL)
free(ptr->error);
if(ptr->raw_stylesheet != NULL)
free(ptr->raw_stylesheet);
if(ptr->stylesheet != NULL)
xsltFreeStylesheet(ptr->stylesheet);
free(ptr);
}
void yyerror(const char * s) {
struct printbuf *buf = printbuf_new();
if(last_parsley_error !=NULL) sprintbuf(buf, "%s\n", last_parsley_error);
sprintbuf(buf, "%s in key: %s", s, parsley_parsing_context->name);
last_parsley_error = strdup(buf->buf);
printbuf_free(buf);
}
static char* optional(contextPtr c) {
return (c->flags & PARSLEY_OPTIONAL) ? " optional=\"true\"" : "";
}
static bool
all_strings(struct json_object * json) {
json_object_object_foreach(json, key, val) {
if(val == NULL || !json_object_is_type(val, json_type_string)) return false;
}
return true;
}
void __parsley_recurse(contextPtr context) {
// printf("a\n");
char* tmp;
struct printbuf * buf;
keyPtr keys;
contextPtr c;
if(context->json == NULL) return;
json_object_object_foreach(context->json, key, val) {
c = deeper_context(context, key, val);
sprintbuf(c->buf, "<%s%s>\n", c->tag, optional(c));
if(c->string) {
if(c->array || context->zipped) {
if(c->filter){
// printf("b\n");
sprintbuf(c->buf, "<parsley:groups optional=\"true\"><xsl:for-each select=\"%s\"><parsley:group optional=\"true\">\n", c->filter);
sprintbuf(c->buf, "<xsl:value-of select=\"%s\" />\n", c->raw_expr);
sprintbuf(c->buf, "</parsley:group></xsl:for-each></parsley:groups>\n");
} else {
// printf("c\n");
sprintbuf(c->buf, "<parsley:groups optional=\"true\"><xsl:for-each select=\"%s\"><parsley:group optional=\"true\">\n", c->expr);
sprintbuf(c->buf, "<xsl:value-of select=\".\" />\n");
sprintbuf(c->buf, "</parsley:group></xsl:for-each></parsley:groups>\n");
}
} else {
if(c->filter){
// printf("d\n");
sprintbuf(c->buf, "<xsl:for-each select=\"%s\"><xsl:if test=\"position()=1\">\n", c->filter);
sprintbuf(c->buf, "<xsl:value-of select=\"%s\" />\n", c->raw_expr);
sprintbuf(c->buf, "</xsl:if></xsl:for-each>\n");
} else {
// printf("e\n");
sprintbuf(c->buf, "<xsl:value-of select=\"%s\" />\n", c->expr);
}
}
} else { // if c->object !string
if(c->array) { // scoped
if(c->filter != NULL) {
// printf("f\n");
sprintbuf(c->buf, "<parsley:groups optional=\"true\"><xsl:for-each select=\"%s\"><parsley:group optional=\"true\">\n", c->filter);
__parsley_recurse(c);
sprintbuf(c->buf, "</parsley:group></xsl:for-each></parsley:groups>\n");
} else { // magic
if(all_strings(c->json)) {
c->magic = NULL;
c->zipped = 1;
sprintbuf(c->buf, "<parsley:zipped>\n");
__parsley_recurse(c);
sprintbuf(c->buf, "</parsley:zipped>\n");
} else {
// printf("h\n");
sprintbuf(c->buf, "<xsl:variable name=\"%s__context\" select=\".\"/>\n", c->name);
parsley_parsing_context = c;
char * str = inner_key_of(c->json);
if(str != NULL) {
// printf("i\n");
tmp = myparse(astrdup(str));
sprintbuf(c->buf, "<parsley:groups optional=\"true\"><xsl:for-each select=\"%s\">\n", filter_intersection(context->magic, tmp));
// keys
keys = parsley_alloc(sizeof(key_node));
keys->name = c->name;
keys->use = full_expr(c, tmp);
keys->next = c->keys;
c->keys = keys;
buf = printbuf_new();
sprintbuf(buf, "concat(");
while(keys != NULL){
sprintbuf(buf, "count(set:intersection(following::*, %s)), '-',", keys->use);
keys = keys->next;
}
sprintbuf(buf, "'')");
tmp = astrdup(buf->buf);
printbuf_free(buf);
sprintbuf(c->key_buf, "<xsl:key name=\"%s__key\" match=\"%s\" use=\"%s\"/>\n", c->name,
full_expr(c, "./descendant-or-self::*"),
tmp
);
sprintbuf(c->buf, "<xsl:variable name=\"%s__index\" select=\"%s\"/>\n", c->name, tmp);
sprintbuf(c->buf, "<xsl:for-each select=\"$%s__context\"><parsley:group optional=\"true\">\n", c->name);
__parsley_recurse(c);
sprintbuf(c->buf, "</parsley:group></xsl:for-each></xsl:for-each></parsley:groups>\n");
}
}
}
} else {
// printf("j\n");
if(c->filter == NULL) {
__parsley_recurse(c);
} else {
// printf("k\n");
sprintbuf(c->buf, "<xsl:for-each select=\"%s\"><xsl:if test=\"position() = 1\">\n", c->filter);
__parsley_recurse(c);
sprintbuf(c->buf, "</xsl:if></xsl:for-each>\n");
}
}
}
sprintbuf(c->buf, "</%s>\n", c->tag);
}
}
static char* full_expr(contextPtr context, char* expr) {
if(expr == NULL) return context->full_expr;
char* merged = arepl(expr, ".", context->full_expr);
return arepl(merged, "///", "//");
}
static char* inner_key_of(struct json_object * json) {
switch(json_object_get_type(json)) {
case json_type_string:
return json_object_get_string(json);
case json_type_array:
return NULL;
case json_type_object:
return inner_key_each(json);
}
}
static char* inner_key_each(struct json_object * json) {
json_object_object_foreach(json, key, val) {
char* inner = inner_key_of(val);
if(inner != NULL) return inner;
}
return NULL;
}

View File

@ -1,96 +0,0 @@
#ifndef PARSLEY_H_INCLUDED
#define PARSLEY_H_INCLUDED
#define PARSLEY_BUF_SIZE 1024
#include <stdbool.h>
#include <libxslt/xslt.h>
#include <libxslt/xsltInternals.h>
#include <libxslt/transform.h>
static int parsley_debug_mode = 0;
static char* last_parsley_error;
#include <json/json.h>
typedef struct __compiled_parsley {
char* raw_stylesheet;
xsltStylesheetPtr stylesheet;
char* error;
} compiled_parsley;
typedef struct __parsed_parsley {
xmlDocPtr xml;
char *error;
compiled_parsley *parsley;
} parsed_parsley;
typedef compiled_parsley * parsleyPtr;
typedef parsed_parsley * parsedParsleyPtr;
typedef struct __key_node {
char* name;
char* use;
struct __key_node * next;
} key_node;
typedef key_node * keyPtr;
typedef struct __parsley_context {
struct printbuf * buf;
struct printbuf * key_buf;
keyPtr keys;
struct json_object * json;
struct __parsley_context * parent;
char* tag;
char* filter;
char* expr;
char* raw_expr;
char* full_expr;
char* name;
char* magic;
int array;
int string;
int flags;
int zipped;
} parsley_context;
typedef parsley_context * contextPtr;
void parsed_parsley_free(parsedParsleyPtr);
void parsley_free(parsleyPtr);
parsleyPtr parsley_compile(char* parsley, char* incl);
parsedParsleyPtr parsley_parse_file(parsleyPtr, char*, bool);
parsedParsleyPtr parsley_parse_string(parsleyPtr, char*, size_t, bool);
parsedParsleyPtr parsley_parse_doc(parsleyPtr, xmlDocPtr);
enum {
PARSLEY_OPTIONAL = 1,
};
static contextPtr parsley_parsing_context;
static char* full_expr(contextPtr, char*);
static char* expr_join(char*, char*);
static char* inner_key_of(struct json_object *);
static char* inner_key_each(struct json_object *);
static void free_context(contextPtr);
static contextPtr init_context();
static contextPtr clone_context(contextPtr);
static contextPtr tagged_context(contextPtr, char*);
static contextPtr new_context(struct json_object *, struct printbuf *);
static contextPtr deeper_context(contextPtr, char*, struct json_object *);
static void __parsley_recurse(contextPtr);
static char* filter_intersection(char*, char*);
static char* inner_key_of(struct json_object *);
static char* inner_key_each(struct json_object *);
static void visit(parsedParsleyPtr ptr, xmlNodePtr xml, bool bubbling);
static bool xml_empty(xmlNodePtr xml);
#endif

View File

@ -1,142 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "kstring.h"
#include "printbuf.h"
#include "parsley.h"
#include "xml2json.h"
#include <libxslt/xslt.h>
#include <libxslt/xsltInternals.h>
#include <libxslt/transform.h>
#include <libxml/parser.h>
#include <libxml/HTMLparser.h>
#include <libxml/HTMLtree.h>
#include <libxml/xmlwriter.h>
#include <json/json.h>
#include <argp.h>
#include "util.h"
struct arguments
{
struct list_elem *include_files;
int input_xml;
int output_xml;
char *parsley;
char *input_file;
char *output_file;
};
struct list_elem {
int has_next;
struct list_elem *next;
char *string;
};
const char *argp_program_version = "parsley 0.1";
const char *argp_program_bug_address = "<kyle@kylemaxwell.com>";
static char args_doc[] = "DEX_FILE FILE_TO_PARSE";
static char doc[] = "Parsley is a parslet parser.";
static struct argp_option options[] = {
{"input-xml", 'x', 0, 0, "Use the XML parser (not HTML)" },
{"output-xml", 'X', 0, 0, "Output XML (not JSON)" },
{"output", 'o', "FILE", 0, "Output to FILE instead of standard output" },
{"include", 'i', "FILE", 0, "Include the contents of FILE in the compiled XSLT" },
{ 0 }
};
static error_t parse_opt (int key, char *arg, struct argp_state *state)
{
struct arguments *arguments = state->input;
struct list_elem *base = arguments->include_files;
struct list_elem *e;
switch (key)
{
case 'x':
arguments->input_xml = 1;
break;
case 'X':
arguments->output_xml = 1;
break;
case 'i':
e = (struct list_elem *) calloc(1, sizeof(e));
e->string = arg;
while(base->has_next) base = base->next;
base->next = e;
base->has_next = 1;
break;
case 'o':
arguments->output_file = arg;
break;
case ARGP_KEY_ARG:
switch(state->arg_num){
case 0:
arguments->parsley = arg;
break;
case 1:
arguments->input_file = arg;
break;
default:
argp_usage (state);
}
break;
case ARGP_KEY_END:
if (state->arg_num < 2) argp_usage (state);
break;
default:
return ARGP_ERR_UNKNOWN;
}
return 0;
}
static struct argp argp = { options, parse_opt, args_doc, doc };
int main (int argc, char **argv) {
struct arguments arguments;
struct list_elem elem;
struct list_elem *elemptr = &elem;
elem.has_next = 0;
arguments.input_xml = 0;
arguments.output_xml = 0;
arguments.include_files = elemptr;
arguments.output_file = "-";
argp_parse (&argp, argc, argv, 0, 0, &arguments);
struct printbuf *buf = printbuf_new();
struct printbuf *incl = printbuf_new();
FILE * fd = parsley_fopen(arguments.parsley, "r");
printbuf_file_read(fd, buf);
while(elemptr->has_next) {
elemptr = elemptr->next;
FILE* f = parsley_fopen(elemptr->string, "r");
printbuf_file_read(f, incl);
fclose(f);
}
parsleyPtr compiled = parsley_compile(buf->buf, incl->buf);
if(compiled->error != NULL) {
fprintf(stderr, "%s\n", compiled->error);
exit(1);
}
parsedParsleyPtr ptr = parsley_parse_file(compiled, arguments.input_file, !(arguments.input_xml));
if(ptr->error != NULL) {
fprintf(stderr, "Parsing failed: %s\n", ptr->error);
exit(1);
}
if(arguments.output_xml) {
xmlSaveFormatFile(arguments.output_file, ptr->xml, 1);
} else {
struct json_object *json = xml2json(ptr->xml->children->children);
FILE* f = parsley_fopen(arguments.output_file, "w");
fprintf(f, "%s\n", json_object_to_json_string(json));
fclose(f);
}
return 0;
}

View File

@ -1,26 +0,0 @@
#include "parsley_mem.h"
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
static struct obstack parsley_obstack;
static bool parsley_obstack_initialized = false;
void parsley_collect() {
obstack_free(&parsley_obstack, NULL);
obstack_init(&parsley_obstack);
}
void * parsley_alloc(int size) {
if(!parsley_obstack_initialized) {
obstack_init(&parsley_obstack);
parsley_obstack_initialized = true;
}
void * mem = obstack_alloc(&parsley_obstack, size);
void * ptr = mem;
for(int i = 0; i < size; i++)
{
*(char *)(mem + i) = '\0';
}
return mem;
}

View File

@ -1,13 +0,0 @@
#ifndef PARSLEY_MEM_H_INCLUDED
#define PARSLEY_MEM_H_INCLUDED
#define obstack_chunk_alloc malloc
#define obstack_chunk_free free
#include "obstack.h"
void parsley_collect();
void * parsley_alloc(int size);
#endif

View File

@ -1,107 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <argp.h>
#include <string.h>
#include "kstring.h"
#include "printbuf.h"
#include "parsley.h"
#include "util.h"
struct list_elem {
int has_next;
struct list_elem *next;
char *string;
};
struct arguments
{
struct list_elem *include_files;
char *parsley;
char *output_file;
};
const char *argp_program_version = "parsleyc 0.1";
const char *argp_program_bug_address = "<kyle@kylemaxwell.com>";
static char args_doc[] = "DEX_FILE";
static char doc[] = "Parsleyc is a parslet to XSLT compiler";
static struct argp_option options[] = {
{"debug", 'd', 0, 0, "Turn on Bison parser debugging" },
{"output", 'o', "FILE", 0, "Output to FILE instead of standard output" },
{"include", 'i', "FILE", 0, "Include the contents of FILE in the produced XSLT" },
{ 0 }
};
static error_t parse_opt (int key, char *arg, struct argp_state *state)
{
struct arguments *arguments = state->input;
struct list_elem *base = arguments->include_files;
struct list_elem *e;
switch (key)
{
case 'i':
e = (struct list_elem *) calloc(1, sizeof(e));
e->string = arg;
while(base->has_next) base = base->next;
base->next = e;
base->has_next = 1;
break;
case 'd':
// parsley_set_debug_mode(1);
break;
case 'o':
arguments->output_file = arg;
break;
case ARGP_KEY_ARG:
if (state->arg_num >= 1) argp_usage (state);
arguments->parsley = arg;
break;
case ARGP_KEY_END:
if (state->arg_num < 1) argp_usage (state);
break;
default:
return ARGP_ERR_UNKNOWN;
}
return 0;
}
static struct argp argp = { options, parse_opt, args_doc, doc };
int main (int argc, char **argv) {
struct arguments arguments;
struct list_elem elem;
struct list_elem *elemptr = &elem;
elem.has_next = 0;
arguments.include_files = elemptr;
arguments.output_file = "-";
arguments.parsley = "-";
argp_parse (&argp, argc, argv, 0, 0, &arguments);
struct printbuf* parsley = printbuf_new();
struct printbuf* incl = printbuf_new();
FILE* in = parsley_fopen(arguments.parsley, "r");
printbuf_file_read(in, parsley);
while(elemptr->has_next) {
elemptr = elemptr->next;
FILE* f = parsley_fopen(elemptr->string, "r");
printbuf_file_read(f, incl);
fclose(f);
}
parsleyPtr compiled = parsley_compile(parsley->buf, incl->buf);
if(compiled->error != NULL) {
fprintf(stderr, "%s\n", compiled->error);
exit(1);
}
FILE* fo = parsley_fopen(arguments.output_file, "w");
fprintf(fo, compiled->raw_stylesheet);
fclose(fo);
return 0;
}

View File

@ -1,104 +0,0 @@
/*
* $Id: printbuf.c,v 1.5 2006/01/26 02:16:28 mclark Exp $
*
* Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
* Michael Clark <michael@metaparadigm.com>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See COPYING for details.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "printbuf.h"
#define max(a,b) ((a) > (b) ? (a) : (b))
struct printbuf* printbuf_new()
{
struct printbuf *p;
if(!(p = calloc(1, sizeof(struct printbuf)))) return NULL;
p->size = 32;
p->bpos = 0;
if(!(p->buf = malloc(p->size))) {
free(p);
return NULL;
}
return p;
}
int printbuf_memappend(struct printbuf *p, char *buf, int size)
{
char *t;
if(p->size - p->bpos <= size) {
int new_size = max(p->size * 2, p->bpos + size + 8);
if(!(t = realloc(p->buf, new_size))) return -1;
p->size = new_size;
p->buf = t;
}
memcpy(p->buf + p->bpos, buf, size);
p->bpos += size;
p->buf[p->bpos]= '\0';
return size;
}
int sprintbuf(struct printbuf *p, const char *msg, ...)
{
va_list ap;
char *t;
int size;
char buf[128];
/* user stack buffer first */
va_start(ap, msg);
size = vsnprintf(buf, 128, msg, ap);
va_end(ap);
/* if string is greater than stack buffer, then use dynamic string
with vasprintf. Note: some implementation of vsnprintf return -1
if output is truncated whereas some return the number of bytes that
would have been writen - this code handles both cases. */
if(size == -1 || size > 127) {
int ret;
va_start(ap, msg);
if((size = vasprintf(&t, msg, ap)) == -1) return -1;
va_end(ap);
ret = printbuf_memappend(p, t, size);
free(t);
return ret;
} else {
return printbuf_memappend(p, buf, size);
}
}
void printbuf_reset(struct printbuf *p)
{
p->buf[0] = '\0';
p->bpos = 0;
}
void printbuf_free(struct printbuf *p)
{
if(p) {
free(p->buf);
free(p);
}
}
void printbuf_file_read(FILE* file, struct printbuf* pb){
int size = 1024;
char t[size];
while(fgets(t, size, file) != NULL) {
printbuf_memappend(pb, t, strlen(t));
}
if(ferror(file) != 0) {
fprintf(stderr, "IO error\n");
exit(1);
}
}

View File

@ -1,41 +0,0 @@
/*
* $Id: printbuf.h,v 1.4 2006/01/26 02:16:28 mclark Exp $
*
* Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
* Michael Clark <michael@metaparadigm.com>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See COPYING for details.
*
*/
#ifndef _printbuf_h_
#define _printbuf_h_
#undef PRINTBUF_DEBUG
struct printbuf {
char *buf;
int bpos;
int size;
};
extern void
printbuf_file_read(FILE*, struct printbuf *);
extern struct printbuf*
printbuf_new();
extern int
printbuf_memappend(struct printbuf *p, char *buf, int size);
extern int
sprintbuf(struct printbuf *p, const char *msg, ...);
extern void
printbuf_reset(struct printbuf *p);
extern void
printbuf_free(struct printbuf *p);
#endif

View File

@ -11,7 +11,7 @@ class TestPyParsley(unittest.TestCase):
self.alt_parsley = PyParsley('{"title": "title"}')
self.__file__ = currentframe().f_code.co_filename
self.__dir__ = dirname(self.__file__)
self.file = self.__dir__ + '/../../test/yelp.html'
self.file = self.__dir__ + '/yelp.html'
self.json = '{ "title": "\\t\\tNick\'s Crispy Tacos - Russian Hill - San Francisco, CA\\n" }'
def test_file_xml(self):

383
regexp.c
View File

@ -1,383 +0,0 @@
/*
* regexp.c: Implementation of the EXSLT -- Regular Expressions module
*
* References:
* http://exslt.org/regexp/index.html
*
* See Copyright for the status of this software.
*
* Authors:
* Joel W. Reed <joelwreed@gmail.com>
*
* TODO:
* functions:
* regexp:match
* regexp:replace
* regexp:test
*/
#include <libxml/tree.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include <libxslt/xsltconfig.h>
#include <libxslt/xsltutils.h>
#include <libxslt/xsltInternals.h>
#include <libxslt/extensions.h>
#include <libexslt/exsltexports.h>
#include <pcre.h>
#include <string.h>
/* make sure init function is exported on win32 */
#if defined(_WIN32)
#define PLUGINPUBFUN __declspec(dllexport)
#else
#define PLUGINPUBFUN
#endif
/**
* EXSLT_REGEXP_NAMESPACE:
*
* Namespace for EXSLT regexp functions
*/
#define EXSLT_REGEXP_NAMESPACE ((const xmlChar *) "http://exslt.org/regular-expressions")
static void
exsltRegexpFlagsFromString(const xmlChar* flagstr,
int* global, int* flags)
{
const xmlChar* i = flagstr;
/* defaults */
(*flags) = PCRE_UTF8;
(*global) = 0;
while (*i != '\0')
{
if (*i == 'i') (*flags) |= PCRE_CASELESS;
else if (*i == 'g') (*global)= 1;
/* TODO: support other flags? */
i++;
}
}
static int
exsltRegexpExecute(xmlXPathParserContextPtr ctxt,
const xmlChar* haystack, const xmlChar* regexp,
int flags, int ovector[], int ovector_len)
{
int haystack_len = 0;
pcre *compiled_regexp = NULL;
int rc = 0, erroffset = 0;
const char *error = 0;
compiled_regexp = pcre_compile(regexp, /* the pattern */
flags, /* default options */
&error, /* for error message */
&erroffset, /* for error offset */
NULL); /* use default character tables */
if (compiled_regexp == NULL) {
xsltTransformError (xsltXPathGetTransformContext (ctxt), NULL, NULL,
"exslt:regexp failed to compile %s (char: %d). %s", regexp, erroffset, error);
return -1;
}
haystack_len = xmlUTF8Strlen (haystack);
rc = pcre_exec(compiled_regexp, /* result of pcre_compile() */
NULL, /* we didn't study the pattern */
haystack, /* the subject string */
haystack_len, /* the length of the subject string */
0, /* start at offset 0 in the subject */
0, /* default options */
(int*)ovector, /* vector of integers for substring information */
ovector_len); /* number of elements in the vector (NOT size in bytes) */
if (rc < -1) {
xsltTransformError (xsltXPathGetTransformContext (ctxt), NULL, NULL,
"exslt:regexp failed to execute %s for %s", regexp, haystack);
rc = 0;
}
if (compiled_regexp != NULL)
pcre_free(compiled_regexp);
return rc;
}
/**
* exsltRegexpMatchFunction:
* @ns:
*
* Returns a node set of string matches
*/
static void
exsltRegexpMatchFunction (xmlXPathParserContextPtr ctxt, int nargs)
{
xsltTransformContextPtr tctxt;
xmlNodePtr node;
xmlDocPtr container;
xmlXPathObjectPtr ret = NULL;
xmlChar *haystack, *regexp, *flagstr, *working, *match;
int rc, x, flags, global, ovector[3];
if ((nargs < 1) || (nargs > 3)) {
xmlXPathSetArityError(ctxt);
return;
}
if (nargs > 2) {
flagstr = xmlXPathPopString(ctxt);
if (xmlXPathCheckError(ctxt) || (flagstr == NULL)) {
return;
}
} else {
flagstr = xmlStrdup("");
}
regexp = xmlXPathPopString(ctxt);
if (xmlXPathCheckError(ctxt) || (regexp == NULL)) {
xmlFree(flagstr);
return;
}
haystack = xmlXPathPopString(ctxt);
if (xmlXPathCheckError(ctxt) || (haystack == NULL)) {
xmlFree(regexp);
xmlFree(flagstr);
return;
}
/* Return a result tree fragment */
tctxt = xsltXPathGetTransformContext(ctxt);
if (tctxt == NULL) {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
"exslt:regexp : internal error tctxt == NULL\n");
goto fail;
}
container = xsltCreateRVT(tctxt);
if (container != NULL) {
xsltRegisterTmpRVT(tctxt, container);
ret = xmlXPathNewNodeSet(NULL);
if (ret != NULL) {
ret->boolval = 0;
exsltRegexpFlagsFromString(flagstr, &global, &flags);
working = haystack;
rc = exsltRegexpExecute(ctxt, working, regexp, flags,
ovector, sizeof(ovector)/sizeof(int));
while (rc > 0) {
match = xmlStrsub(working, ovector[0], ovector[1]-ovector[0]);
if (NULL == match) goto fail;
node = xmlNewDocRawNode(container, NULL, "match", match);
xmlFree(match);
xmlAddChild((xmlNodePtr) container, node);
xmlXPathNodeSetAddUnique(ret->nodesetval, node);
if (!global) break;
working = working + ovector[1];
rc = exsltRegexpExecute(ctxt, working, regexp, flags,
ovector, sizeof(ovector)/sizeof(int));
}
}
}
fail:
if (flagstr != NULL)
xmlFree(flagstr);
if (regexp != NULL)
xmlFree(regexp);
if (haystack != NULL)
xmlFree(haystack);
if (ret != NULL)
valuePush(ctxt, ret);
else
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
}
/**
* exsltRegexpReplaceFunction:
* @ns:
*
* Returns a node set of string matches
*/
static void
exsltRegexpReplaceFunction (xmlXPathParserContextPtr ctxt, int nargs)
{
xmlChar *haystack, *regexp, *flagstr, *replace, *tmp;
xmlChar *result = NULL, *working, *end;
int rc, x, flags, global, ovector[3];
if ((nargs < 1) || (nargs > 4)) {
xmlXPathSetArityError(ctxt);
return;
}
replace = xmlXPathPopString(ctxt);
if (xmlXPathCheckError(ctxt) || (replace == NULL)) {
return;
}
flagstr = xmlXPathPopString(ctxt);
if (xmlXPathCheckError(ctxt) || (flagstr == NULL)) {
xmlFree(replace);
return;
}
regexp = xmlXPathPopString(ctxt);
if (xmlXPathCheckError(ctxt) || (regexp == NULL)) {
xmlFree(flagstr);
xmlFree(replace);
return;
}
haystack = xmlXPathPopString(ctxt);
if (xmlXPathCheckError(ctxt) || (haystack == NULL)) {
xmlFree(regexp);
xmlFree(flagstr);
xmlFree(replace);
return;
}
exsltRegexpFlagsFromString(flagstr, &global, &flags);
working = haystack;
rc = exsltRegexpExecute(ctxt, working, regexp, flags,
ovector, sizeof(ovector)/sizeof(int));
while (rc > 0 ) {
if (0==ovector[0]) {
if (NULL==result) result = xmlStrdup(replace);
else result = xmlStrcat(result, replace);
}
else {
tmp = xmlStrsub(working, 0, ovector[0]);
if (NULL==result) result = tmp;
else {
result = xmlStrcat(result, tmp);
xmlFree(tmp);
}
result = xmlStrcat(result, replace);
}
working = working + ovector[1];
if (!global) break;
rc = exsltRegexpExecute(ctxt, working, regexp, flags,
ovector, sizeof(ovector)/sizeof(int));
}
end = haystack + xmlUTF8Strlen(haystack);
if (working < end ) {
if (NULL==result) result = xmlStrdup(working);
else {
result = xmlStrcat(result, working);
}
}
fail:
if (replace != NULL)
xmlFree(replace);
if (flagstr != NULL)
xmlFree(flagstr);
if (regexp != NULL)
xmlFree(regexp);
if (haystack != NULL)
xmlFree(haystack);
xmlXPathReturnString(ctxt, result);
}
/**
* exsltRegexpTestFunction:
* @ns:
*
* returns true if the string given as the first argument
* matches the regular expression given as the second argument
*
*/
static void
exsltRegexpTestFunction (xmlXPathParserContextPtr ctxt, int nargs)
{
xmlChar *haystack, *regexp_middle, *regexp, *flagstr;
int rc = 0, flags, global, ovector[3];
if ((nargs < 1) || (nargs > 3)) {
xmlXPathSetArityError(ctxt);
return;
}
if(nargs > 2) {
flagstr = xmlXPathPopString(ctxt);
if (xmlXPathCheckError(ctxt) || (flagstr == NULL)) {
return;
}
} else {
flagstr = xmlStrdup("");
}
regexp_middle = xmlXPathPopString(ctxt);
if (xmlXPathCheckError(ctxt) || (regexp_middle == NULL)) {
xmlFree(flagstr);
return;
}
haystack = xmlXPathPopString(ctxt);
if (xmlXPathCheckError(ctxt) || (haystack == NULL)) {
xmlFree(regexp_middle);
xmlFree(flagstr);
return;
}
/* build the regexp */
regexp = xmlStrdup("\\A");
regexp = xmlStrcat(regexp, regexp_middle);
regexp = xmlStrcat(regexp, "\\Z");
exsltRegexpFlagsFromString(flagstr, &global, &flags);
rc = exsltRegexpExecute(ctxt, haystack, regexp, flags,
ovector, sizeof(ovector)/sizeof(int));
fail:
if (flagstr != NULL)
xmlFree(flagstr);
if (regexp != NULL)
xmlFree(regexp);
if (regexp_middle != NULL)
xmlFree(regexp_middle);
if (haystack != NULL)
xmlFree(haystack);
xmlXPathReturnBoolean(ctxt, (rc > 0));
}
/**
* exsltRegexpRegister:
*
* Registers the EXSLT - Regexp module
*/
void
PLUGINPUBFUN exslt_org_regular_expressions_init (void)
{
xsltRegisterExtModuleFunction ((const xmlChar *) "match",
(const xmlChar *) EXSLT_REGEXP_NAMESPACE,
exsltRegexpMatchFunction);
xsltRegisterExtModuleFunction ((const xmlChar *) "replace",
(const xmlChar *) EXSLT_REGEXP_NAMESPACE,
exsltRegexpReplaceFunction);
xsltRegisterExtModuleFunction ((const xmlChar *) "test",
(const xmlChar *) EXSLT_REGEXP_NAMESPACE,
exsltRegexpTestFunction);
}

View File

View File

@ -1,22 +0,0 @@
task :default => :test
task :test => :build do
Dir["test/*test*.rb"].each {|f| load f }
end
task :build => :configure do
system "cd ext && make"
end
task :clean => :configure do
system "cd ext && make clean"
end
task :configure do
system "cd ext && ruby extconf.rb" unless File.exists?("ext/Makefile")
end
task :install do
system "gem build parsley-ruby.gemspec"
system "gem install parsley-ruby"
end

View File

@ -1,118 +0,0 @@
#include "ruby.h"
#include <stdio.h>
#include <libxslt/xslt.h>
#include <libexslt/exslt.h>
#include <libxslt/xsltInternals.h>
#include <libxslt/transform.h>
#include <libxml/parser.h>
#include <libxml/HTMLparser.h>
#include <libxml/HTMLtree.h>
#include <libxml/xmlwriter.h>
#include <parsley.h>
#include <json/json.h>
#include <xml2json.h>
VALUE _new(VALUE, VALUE, VALUE);
VALUE _parse_file(VALUE, VALUE, VALUE, VALUE);
VALUE _parse_string(VALUE, VALUE, VALUE, VALUE);
VALUE _parse_doc(parsedParsleyPtr, VALUE);
VALUE rubify_recurse(xmlNodePtr xml);
VALUE c_parsley_err;
VALUE c_parsley;
void Init_cparsley()
{
c_parsley = rb_define_class("CParsley", rb_cObject);
c_parsley_err = rb_define_class("ParsleyError", rb_eRuntimeError);
rb_define_singleton_method(c_parsley, "new", _new, 2);
rb_define_method(c_parsley, "parse_file", _parse_file, 3);
rb_define_method(c_parsley, "parse_string", _parse_string, 3);
}
VALUE _new(VALUE self, VALUE parsley, VALUE incl){
parsleyPtr ptr = parsley_compile(STR2CSTR(parsley), STR2CSTR(incl));
if(ptr->error != NULL) {
rb_raise(c_parsley_err, ptr->error);
parsley_free(ptr);
return Qnil;
}
return Data_Wrap_Struct(c_parsley, 0, parsley_free, ptr);
}
VALUE _parse_file(VALUE self, VALUE name, VALUE input, VALUE output){
parsleyPtr parsley;
Data_Get_Struct(self, parsleyPtr, parsley);
return _parse_doc(parsley_parse_file(parsley, STR2CSTR(name), input == ID2SYM(rb_intern("html"))), output);
}
VALUE _parse_string(VALUE self, VALUE string, VALUE input, VALUE output) {
parsleyPtr parsley;
Data_Get_Struct(self, parsleyPtr, parsley);
char* cstr = STR2CSTR(string);
return _parse_doc(parsley_parse_string(parsley, cstr, strlen(cstr), input == ID2SYM(rb_intern("html"))), output);
}
VALUE _parse_doc(parsedParsleyPtr ptr, VALUE type) {
if(ptr->error != NULL || ptr->xml == NULL) {
if(ptr->error == NULL) ptr->error = strdup("Unknown parsley error");
rb_raise(c_parsley_err, ptr->error);
parsed_parsley_free(ptr);
return Qnil;
}
VALUE output;
if(type == ID2SYM(rb_intern("json"))) {
struct json_object *json = xml2json(ptr->xml->children->children);
char* str = json_object_to_json_string(json);
output = rb_str_new2(str);
json_object_put(json);
} else if(type == ID2SYM(rb_intern("xml"))) {
char* str;
int size;
xmlDocDumpMemory(ptr->xml, &str, &size);
output = rb_str_new(str, size);
} else {
output = rubify_recurse(ptr->xml->children->children);
if(output == NULL) output = Qnil;
}
parsed_parsley_free(ptr);
return output;
}
VALUE rubify_recurse(xmlNodePtr xml) {
if(xml == NULL) return NULL;
xmlNodePtr child;
VALUE obj = Qnil;
switch(xml->type) {
case XML_ELEMENT_NODE:
child = xml->children;
if(xml->ns == NULL) {
child = xml;
obj = rb_hash_new();
while(child != NULL) {
rb_hash_aset(obj, rb_str_new2(child->name), rubify_recurse(child->children));
child = child->next;
}
} else if(!strcmp(xml->ns->prefix, "parsley")) {
if(!strcmp(xml->name, "groups")) {
obj = rb_ary_new();
while(child != NULL) {
rb_ary_push(obj, rubify_recurse(child->children));
child = child->next;
}
} else if(!strcmp(xml->name, "group")) {
// Implicitly handled by parsley:groups handler
}
}
break;
case XML_TEXT_NODE:
obj = rb_str_new2(xml->content);
break;
}
// inspect(obj);
return obj;
}

View File

@ -1,67 +0,0 @@
#!/usr/bin/env ruby
ENV["ARCHFLAGS"] = "-arch #{`uname -p` =~ /powerpc/ ? 'ppc' : 'i386'}"
require 'mkmf'
ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
LIBDIR = Config::CONFIG['libdir']
INCLUDEDIR = Config::CONFIG['includedir']
$CFLAGS << " #{ENV["CFLAGS"]}"
if Config::CONFIG['target_os'] == 'mingw32'
$CFLAGS << " -DXP_WIN -DXP_WIN32"
else
$CFLAGS << " -g -DXP_UNIX"
end
$CFLAGS << " -O3 -Wall -Wextra -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline"
if Config::CONFIG['target_os'] == 'mingw32'
find_library('xml2', 'xmlParseDoc',
File.join(ROOT, 'cross', 'libxml2-2.7.2.win32', 'bin'))
find_library('xslt', 'xsltParseStylesheetDoc',
File.join(ROOT, 'cross', 'libxslt-1.1.24.win32', 'bin'))
else
find_library('xml2', 'xmlParseDoc', LIBDIR)
find_library('xslt', 'xsltParseStylesheetDoc', LIBDIR)
end
if Config::CONFIG['target_os'] == 'mingw32'
header = File.join(ROOT, 'cross', 'libxml2-2.7.2.win32', 'include')
unless find_header('libxml/xmlversion.h', header)
abort "need libxml"
end
header = File.join(ROOT, 'cross', 'libxslt-1.1.24.win32', 'include')
unless find_header('libxslt/libxslt.h', header)
abort "need libxslt"
end
header = File.join(ROOT, 'cross', 'iconv-1.9.2.win32', 'include')
unless find_header('iconv.h', header)
abort "need iconv"
end
else
unless find_header('libxml/xmlversion.h',
File.join(INCLUDEDIR, "libxml2"), '/usr/include/libxml2'
)
abort "need libxml"
end
unless find_header('libxslt/xslt.h', INCLUDEDIR, '/usr/include')
abort "need libxslt"
end
version = try_constant('LIBXML_VERSION', 'libxml/xmlversion.h')
end
myincl = %w[/usr/local/include /opt/local/include /usr/include]
mylib = %w[/usr/local/lib /opt/local/lib /usr/lib]
find_header('json/json.h', INCLUDEDIR, *myincl) or abort "need json/json.h"
find_library('json', 'json_object_new_string', LIBDIR, *mylib) or abort "need libjson"
find_header('parsley.h', INCLUDEDIR, *myincl) or abort "need parsley.h"
find_library('parsley', 'parsley_compile', LIBDIR, *mylib) or abort "need libparsley"
create_makefile('cparsley')

View File

@ -1,39 +0,0 @@
require File.dirname(__FILE__) + "/../ext/cparsley"
require "rubygems"
require "json"
require "thread"
class Parsley
def initialize(parsley, incl = "")
if(parsley.is_a?(Hash))
parsley = parsley.to_json
end
@@mutex ||= Mutex.new
@@mutex.synchronize do
@parsley = CParsley.new(parsley, incl)
end
end
# Valid options:
#
# Requires one of:
# :file -- the input file path
# :string -- the input string
#
# And optionally:
# :input => [:xml, :html]
# :output => [:json, :xml, :ruby]
# :allow_empty -- If false, throws an exception if any value is empty.
#
# Defaults are :input => :html, :output => :ruby, :allow_empty => false
def parse(options = {})
options[:file] || options[:string] || throw("must specify what to parse")
options[:input] ||= :html
options[:output]||= :ruby
if options[:file]
@parsley.parse_file options[:file], options[:input], options[:output]
else
@parsley.parse_string options[:string], options[:input], options[:output]
end
end
end

View File

@ -1,17 +0,0 @@
Gem::Specification.new do |s|
s.name = "parsley-ruby"
s.version = "0.1.0"
s.date = "2008-08-10"
s.summary = "Ruby binding for parsley"
s.email = "kyle@kylemaxwell.com"
s.homepage = "http://github.com/fizx/parsley-ruby"
s.description = "Ruby binding for parsley"
s.has_rdoc = true
s.require_paths = ["lib", "ext"]
s.extensions = "ext/extconf.rb"
s.authors = ["Kyle Maxwell"]
s.files = Dir["**/*"]
s.rdoc_options = ["--main", "README"]
s.extra_rdoc_files = ["README"]
s.add_dependency("json", ["> 0.0.0"])
end

View File

@ -1,7 +0,0 @@
cd ext/ &&
gcc -I/opt/local/include -I/usr/local/include -L/opt/local/lib -L/usr/local/lib -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -I/usr/include/libxml2 -L/usr/lib -lxslt -lxml2 -lz -lpthread -licucore -lm -fno-common -arch i386 -Os -pipe -fno-common -c dexterous.c &&
make &&
cd .. &&
gem build dexterous.gemspec &&
sudo gem install dexterous &&
irb -rdexterous

View File

@ -1,54 +0,0 @@
require "test/unit"
require File.dirname(__FILE__) + "/../lib/parsley"
class TestParsley < Test::Unit::TestCase
def setup
@file = File.dirname(__FILE__) + "/../../test/yelp.html"
end
def test_yelp
@parsley = Parsley.new(File.read(File.dirname(__FILE__) + "/../../test/yelp-home.let"))
out = @parsley.parse(:file => File.dirname(__FILE__) + "/../../test/yelp-home.html")
assert_equal "/c/sf/shopping", out["categories"][0]["href"]
end
def test_yelp_xml
@parsley = Parsley.new(File.read(File.dirname(__FILE__) + "/../../test/yelp-home.let"))
out = @parsley.parse(:file => File.dirname(__FILE__) + "/../../test/yelp-home.html", :output => :xml)
end
def test_simple
@parsley = Parsley.new("hi" => "h1")
assert_equal({"hi" => "Nick's Crispy Tacos"}, @parsley.parse(:file => @file))
end
def test_simple_string
@parsley = Parsley.new("hi" => "h1")
assert_equal({"hi" => "Nick's Crispy Tacos"}, @parsley.parse(:string => "<html><body><h1>Nick's Crispy Tacos</h1></body></html>"))
end
def test_xml
@parsley = Parsley.new("hi" => "h1")
xml = "<?xml version=\"1.0\"?>\n<parsley:root xmlns:parsley=\"http://parslets.com/json\"><hi>Nick's Crispy Tacos</hi></parsley:root>\n"
assert_equal(xml, @parsley.parse(:file => @file, :output => :xml))
end
def test_json
@parsley = Parsley.new("hi" => "h1")
assert_equal('{ "hi": "Nick\'s Crispy Tacos" }', @parsley.parse(:file => @file, :output => :json))
end
def test_rescuable_file_error
@parsley = Parsley.new("hi" => "h1")
@nonexistant_file = File.dirname(__FILE__) + "/../fixtures/yelp.html"
assert_equal({"hi" => "Nick's Crispy Tacos"}, @parsley.parse(:file => @nonexistant_file)) rescue nil
end
def test_array_string
@parsley = Parsley.new({"foo" => ["li"]})
out = @parsley.parse(:file => @file)
assert_kind_of Hash, out
assert_kind_of Array, out["foo"], out.inspect
assert out["foo"].length > 1
end
end

220
scanner.l
View File

@ -1,220 +0,0 @@
%{
#include <stdio.h>
#include "kstring.h"
#include "parser.h"
YY_BUFFER_STATE mybuffer;
void prepare_parse(char* msg) {
mybuffer = yy_scan_string(msg);
}
void cleanup_parse() {
yy_delete_buffer(mybuffer);
}
%}
%option stack
%x DSTR
%x SSTR
NUMBER [0-9]+
S [\t\r \n]+
AT "@"
LPAREN "("
RPAREN ")"
PIPE "|"
LT "<"
SLASH "/"
DBLSLASH "//"
BANG "!"
COLON ":"
DBLCOLON "::"
QUERY "?"
HASH "#"
COMMA {S}?","
DOT "."
DBLDOT ".."
GT {S}?">"
LBRA "["
RBRA "]"
TILDE {S}?"~"
SPLAT "*"
PLUS {S}?"+"
DASH "-"
EQ "="
LTE "<="
GTE ">="
DOLLAR "$"
STRING (['][^']*['])|(["][^"]*["])
BSLASHLIT \\(.|\n)
OTHER (.|\n)
XANCESTOR "ancestor"
XANCESTORSELF "ancestor-or-self"
XATTR "attribute"
XCHILD "child"
XDESC "descendant"
XDESCSELF "descendant-or-self"
XFOLLOW "following"
XFOLLOWSIB "following-sibling"
XNS "namespace"
XPARENT "parent"
XPRE "preceding"
XPRESIB "preceding-sibling"
XSELF "self"
XOR "or"
XAND "and"
XDIV "div"
XMOD "mod"
XCOMMENT "comment"
XTEXT "text"
XPI "processing-instruction"
XNODE "node"
CXEQUATION [0-9]+n
CXOPHE "|="
CXOPNE "!="
CXOPSTARTEQ "^="
CXOPENDEQ "$="
CXOPCONTAINS "*="
CXOPCONTAINS2 "~="
CXFIRST ":first"
CXLAST ":last"
CXNOT ":not"
CXEVEN ":even"
CXODD ":odd"
CXEQ ":eq"
CXGT ":gt"
CXLT ":lt"
CXHEADER ":header"
CXCONTAINS ":contains"
CXEMPTY ":empty"
CXHAS ":has"
CXPARENT ":parent"
CXNTHCH ":nth-child"
CXNTHLASTCH ":nth-last-child"
CXNTHTYPE ":nth-of-type"
CXNTHLASTTYPE ":nth-last-of-type"
CXFIRSTCH ":first-child"
CXLASTCH ":last-child"
CXFIRSTTYPE ":first-of-type"
CXLASTTYPE ":last-of-type"
CXONLYCH ":only-child"
CXONLYTYPE ":only-of-type"
CXINPUT ":input"
CXTEXT ":text"
CXPASSWORD ":password"
CXRADIO ":radio"
CXCHECKBOX ":checkbox"
CXSUBMIT ":submit"
CXIMAGE ":image"
CXRESET ":reset"
CXBUTTON ":button"
CXFILE ":file"
CXENABLED ":enabled"
CXDISABLED ":disabled"
CXCHECKED ":checked"
CXSELECTED ":selected"
NAME [a-zA-Z_][a-zA-Z0-9\-_]*
%%
{NUMBER} yylval = strdup(yytext); return NUMBER;
{S} yylval = strdup(yytext); return S;
{AT} yylval = strdup(yytext); return AT;
{LPAREN} yylval = strdup(yytext); return LPAREN;
{RPAREN} yylval = strdup(yytext); return RPAREN;
{PIPE} yylval = strdup(yytext); return PIPE;
{LT} yylval = strdup(yytext); return LT;
{SLASH} yylval = strdup(yytext); return SLASH;
{DBLSLASH} yylval = strdup(yytext); return DBLSLASH;
{BANG} yylval = strdup(yytext); return BANG;
{COLON} yylval = strdup(yytext); return COLON;
{DBLCOLON} yylval = strdup(yytext); return DBLCOLON;
{QUERY} yylval = strdup(yytext); return QUERY;
{HASH} yylval = strdup(yytext); return HASH;
{COMMA} yylval = strdup(yytext); return COMMA;
{DOT} yylval = strdup(yytext); return DOT;
{DBLDOT} yylval = strdup(yytext); return DBLDOT;
{GT} yylval = strdup(yytext); return GT;
{LBRA} yylval = strdup(yytext); return LBRA;
{RBRA} yylval = strdup(yytext); return RBRA;
{TILDE} yylval = strdup(yytext); return TILDE;
{SPLAT} yylval = strdup(yytext); return SPLAT;
{PLUS} yylval = strdup(yytext); return PLUS;
{DASH} yylval = strdup(yytext); return DASH;
{EQ} yylval = strdup(yytext); return EQ;
{LTE} yylval = strdup(yytext); return LTE;
{GTE} yylval = strdup(yytext); return GTE;
{DOLLAR} yylval = strdup(yytext); return DOLLAR;
{BSLASHLIT} yylval = strdup(yytext); return BSLASHLIT;
{XANCESTOR} yylval = strdup(yytext); return XANCESTOR;
{XANCESTORSELF} yylval = strdup(yytext); return XANCESTORSELF;
{XATTR} yylval = strdup(yytext); return XATTR;
{XCHILD} yylval = strdup(yytext); return XCHILD;
{XDESC} yylval = strdup(yytext); return XDESC;
{XDESCSELF} yylval = strdup(yytext); return XDESCSELF;
{XFOLLOW} yylval = strdup(yytext); return XFOLLOW;
{XFOLLOWSIB} yylval = strdup(yytext); return XFOLLOWSIB;
{XNS} yylval = strdup(yytext); return XNS;
{XPARENT} yylval = strdup(yytext); return XPARENT;
{XPRE} yylval = strdup(yytext); return XPRE;
{XPRESIB} yylval = strdup(yytext); return XPRESIB;
{XSELF} yylval = strdup(yytext); return XSELF;
{XOR} yylval = strdup(yytext); return XOR;
{XAND} yylval = strdup(yytext); return XAND;
{XDIV} yylval = strdup(yytext); return XDIV;
{XMOD} yylval = strdup(yytext); return XMOD;
{XCOMMENT} yylval = strdup(yytext); return XCOMMENT;
{XTEXT} yylval = strdup(yytext); return XTEXT;
{XPI} yylval = strdup(yytext); return XPI;
{XNODE} yylval = strdup(yytext); return XNODE;
{CXEQUATION} yylval = strdup(yytext); return CXEQUATION;
{CXOPHE} yylval = strdup(yytext); return CXOPHE;
{CXOPNE} yylval = strdup(yytext); return CXOPNE;
{CXOPSTARTEQ} yylval = strdup(yytext); return CXOPSTARTEQ;
{CXOPENDEQ} yylval = strdup(yytext); return CXOPENDEQ;
{CXOPCONTAINS} yylval = strdup(yytext); return CXOPCONTAINS;
{CXOPCONTAINS2} yylval = strdup(yytext); return CXOPCONTAINS2;
{CXFIRST} yylval = strdup(yytext); return CXFIRST;
{CXLAST} yylval = strdup(yytext); return CXLAST;
{CXNOT} yylval = strdup(yytext); return CXNOT;
{CXEVEN} yylval = strdup(yytext); return CXEVEN;
{CXODD} yylval = strdup(yytext); return CXODD;
{CXEQ} yylval = strdup(yytext); return CXEQ;
{CXGT} yylval = strdup(yytext); return CXGT;
{CXLT} yylval = strdup(yytext); return CXLT;
{CXHEADER} yylval = strdup(yytext); return CXHEADER;
{CXCONTAINS} yylval = strdup(yytext); return CXCONTAINS;
{CXEMPTY} yylval = strdup(yytext); return CXEMPTY;
{CXHAS} yylval = strdup(yytext); return CXHAS;
{CXPARENT} yylval = strdup(yytext); return CXPARENT;
{CXNTHCH} yylval = strdup(yytext); return CXNTHCH;
{CXNTHLASTCH} yylval = strdup(yytext); return CXNTHLASTCH;
{CXNTHTYPE} yylval = strdup(yytext); return CXNTHTYPE;
{CXNTHLASTTYPE} yylval = strdup(yytext); return CXNTHLASTTYPE;
{CXFIRSTCH} yylval = strdup(yytext); return CXFIRSTCH;
{CXLASTCH} yylval = strdup(yytext); return CXLASTCH;
{CXFIRSTTYPE} yylval = strdup(yytext); return CXFIRSTTYPE;
{CXLASTTYPE} yylval = strdup(yytext); return CXLASTTYPE;
{CXONLYCH} yylval = strdup(yytext); return CXONLYCH;
{CXONLYTYPE} yylval = strdup(yytext); return CXONLYTYPE;
{CXINPUT} yylval = strdup(yytext); return CXINPUT;
{CXTEXT} yylval = strdup(yytext); return CXTEXT;
{CXPASSWORD} yylval = strdup(yytext); return CXPASSWORD;
{CXRADIO} yylval = strdup(yytext); return CXRADIO;
{CXCHECKBOX} yylval = strdup(yytext); return CXCHECKBOX;
{CXSUBMIT} yylval = strdup(yytext); return CXSUBMIT;
{CXIMAGE} yylval = strdup(yytext); return CXIMAGE;
{CXRESET} yylval = strdup(yytext); return CXRESET;
{CXBUTTON} yylval = strdup(yytext); return CXBUTTON;
{CXFILE} yylval = strdup(yytext); return CXFILE;
{CXENABLED} yylval = strdup(yytext); return CXENABLED;
{CXDISABLED} yylval = strdup(yytext); return CXDISABLED;
{CXCHECKED} yylval = strdup(yytext); return CXCHECKED;
{CXSELECTED} yylval = strdup(yytext); return CXSELECTED;
{NAME} yylval = strdup(yytext); return NAME;
{STRING} yylval = strdup(yytext); return STRING;
{OTHER} yylval = strdup(yytext); return OTHER;

View File

@ -1,207 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>austin activity partners classifieds - craigslist</title>
<meta name="description" content="craigslist activity partners classifieds for austin ">
<meta name="keywords" content="austin activity partners craigslist, classifieds, want ads ">
<link rel=alternate type="application/rss+xml" href="index.rss" title="RSS feed for craigslist | activity partners in austin ">
<link rel="stylesheet" title="craigslist" href="http://www.craigslist.org/styles/craigslist.css" type="text/css" media="all">
</head>
<body class="toc">
<a name="top"></a>
<div class="bchead"><span id="ef">
[ <a href="http://www.craigslist.org/about/help/">help</a> ]
[ <a href="https://post.craigslist.org/aus/C">post</a> ]</span>
<a href="/"> austin craigslist</a> &gt; <a href="/act/">activity partners</a></div>
<blockquote>
<form action="/search/act" method="get" onsubmit="ckCAbb();">
<script type="text/javascript"><!--
function ckCAbb() {
t = document.getElementById("cAbb");
if (t.value == "act") { t.disabled = true; }
}
-->
</script>
<table width="95%" cellpadding="2" style="white-space: nowrap; background:#eee; border:1px solid gray;" summary="">
<tr>
<td align="right" width="1">search for:</td>
<td width="30%"><input id="query" name="query" size="30" value=""> in:
<select id="cAbb" name="catAbbreviation">
<option value="ccc">all community<option disabled value="">--<option value="act" selected> activity partners
<option value="ats"> artists
<option value="kid"> childcare
<option value="com"> general
<option value="grp"> groups
<option value="vnn"> local news and views
<option value="laf"> lost &amp; found
<option value="muc"> musicians
<option value="pet"> pets
<option value="pol"> politics
<option value="rid"> rideshare
<option value="vol"> volunteers
<option disabled value="">--<option value="eee">all event<option value="sss">all for sale / wanted<option value="ggg">all gigs<option value="hhh">all housing<option value="jjj">all jobs<option value="ppp">all personals<option value="res">all resume<option value="bbb">all services offered</select>
<input type="submit" value="Search">
</td><td>
<label><input type="checkbox" name="srchType" value="T"
title="check this box to search only posting titles"> only search titles</label>
</td>
</tr>
<tr>
<td align="right" width="1"></td>
<td></td>
<td align="left"><label><input type="checkbox" name="hasPic" value="1"> has image</label></td>
</tr></table></form></blockquote><span id="showPics"></span><span id="hidePics"></span>
<blockquote>
<table width="95%" summary="">
<tr>
<td valign="top">[ Thu, 15 Jan 19:13:19 ]</td>
<td valign="top" id="messages"><span class="hl"> [ <b><a href="/about/safety">PERSONAL SAFETY TIPS</a></b> ] </span> <span class="hl"> [ <b><a href="/about/scams">AVOIDING SCAMS &amp; FRAUD</a></b> ] </span> <span class="hl"> [<a href="/cgi-bin/success.stories.cgi">success story?</a>]</span> </td>
</tr>
</table>
<h4>Thu Jan 15</h4>
<p><a href="/act/994549324.html">Female Running Partner -</a><font size="-1"> (Shoal Creek or Town Lake)</font></p>
<p><a href="/act/994427679.html">TENNIS ANYONE? -</a><font size="-1"> (i35 &amp; US71)</font></p>
<p><a href="/act/994375294.html">Home Workers Needed -</a><font size="-1"> (Anywhere, USA)</font></p>
<p><a href="/act/994247774.html">Do you follow Eat to Live by Dr. Joel Fuhrman? -</a><font size="-1"> (North Central Austin)</font></p>
<p><a href="/act/994238180.html">photographer buddy -</a><font size="-1"> (Austin/central/south/s/w)</font> <span class="p"> pic</span></p>
<p><a href="/act/994209394.html">GET IN THE BEST SHAPE OF YOUR LIFE!!! -</a><font size="-1"> (NW Austin)</font> <span class="p"> pic</span></p>
<p><a href="/act/994198051.html">I CAN HELP ATHLETES GET FASTER &amp; MORE EXPLOSIVE, $28 to $35 a session -</a></p>
<p><a href="/act/994185159.html">Sing your heart out in the NATIONAL KARAOKE LEAGUE! -</a><font size="-1"> (2 Austin Divisions)</font> <span class="p"> pic</span></p>
<p><a href="/act/994111282.html"> FITNESS TRAINING for $20 -</a><font size="-1"> (austin/round rock)</font></p>
<p><a href="/act/994023820.html">Looking for a great workout? -</a><font size="-1"> (Austin and Surrounding Areas)</font></p>
<p><a href="/act/993919120.html">JOIN: The Give Me A Dollar Club -</a><font size="-1"> (The Universe and Beyond)</font></p>
<p><a href="/act/993913699.html">Do You Want To Be The Biggest Loser In Austin ? -</a></p>
<p><a href="/act/993878678.html">Seeking Tennis Hitting Partner -</a><font size="-1"> (NW Austin/CP High School)</font></p>
<p><a href="/act/993802305.html">want to play rugby? -</a><font size="-1"> (West Austin area)</font> <span class="p"> pic</span></p>
<p><a href="/act/993760889.html">Tongiht DateandDash Speed-Dating Party For College Grads -</a><font size="-1"> (Halcyon Cafe)</font> <span class="p"> pic</span></p>
<p><a href="/act/993731629.html">4TH ANNUAL HOT CHOCOLATE AND COOKIES RIDE!!! -</a><font size="-1"> ( Round Rock Harley Davidson)</font></p>
<p><a href="/act/993660526.html">Traveling The World By Backpack Need Someone To Manage business -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/992760567.html">Massage/facial room for rent in Round Rock -</a><font size="-1"> (Round Rock, Tx)</font></p>
<h4>Wed Jan 14</h4>
<p><a href="/act/993511991.html">Gentle Yoga for Beginners (From $ 30/10 Classes....) -</a><font size="-1"> (Five Austin Locations)</font></p>
<p><a href="/act/993414260.html">Pflugerville Fitness Boot Camps -</a><font size="-1"> (Pfluger Park)</font> <span class="p"> pic</span></p>
<p><a href="/act/993408050.html">Round Rock Mommy Group Seeking New Members -</a><font size="-1"> (Round Rock)</font></p>
<p><a href="/act/993302861.html">Men's Over 30 Soccer Team looking for players -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/992975456.html">tennis players for fun times -</a><font size="-1"> (taylor/ hutto/granger)</font></p>
<p><a href="/act/993159668.html">Co-ed Soccer Players -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/992992750.html">BADMINTON TONIGHT! adult, both women and men -</a><font size="-1"> (austin rec center, 1301 shoal creek)</font> <span class="p"> pic</span></p>
<p><a href="/act/992943165.html">YOUTH FLAG FOOTBALL -</a><font size="-1"> (ROUND ROCK TX)</font></p>
<p><a href="/act/992893767.html">Workout!!! I'll help you quit making excuses!!! $26 - $50 -</a></p>
<p><a href="/act/992558125.html">S exercise -</a><font size="-1"> (Atx)</font> <span class="p"> pic</span></p>
<p><a href="/act/992451634.html">Dance Classes for Bigger Bodies -</a><font size="-1"> (Central Austin)</font></p>
<p><a href="/act/992267236.html">Dance partner wanted -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/992239729.html">Arabic Tutor -</a><font size="-1"> (Austin)</font></p>
<h4>Tue Jan 13</h4>
<p><a href="/act/991895757.html">Any norwegian speakers, anyone from Norway in Austin? -</a><font size="-1"> (Downtown)</font></p>
<p><a href="/act/991763196.html">Tennis, Biking, Badminton, Jogging, Hiking, Dancing, etc. -</a><font size="-1"> (Southwest Austin)</font></p>
<p><a href="/act/991734075.html">Tennis in NW Austin? -</a><font size="-1"> (Lake Creek and 183)</font></p>
<p><a href="/act/991563998.html">Looking for Workout partner at Gold's Gym -</a><font size="-1"> (SW Austin)</font> <span class="p"> pic</span></p>
<p><a href="/act/991432735.html">VOICE LESSONS -</a></p>
<p><a href="/act/991553805.html">Meet New People in the NATIONAL KARAOKE LEAGUE! Register Today!!! -</a><font size="-1"> (2 Austin Divisions)</font> <span class="p"> pic</span></p>
<p><a href="/act/991201591.html">Women's Rugby in Austin -</a><font size="-1"> (Burnett Middle School)</font> <span class="p"> pic</span></p>
<p><a href="/act/991196763.html">Hate the Gym ? Hate Boot camps? Join Us -</a></p>
<p><a href="/act/991123059.html">Interested in playing rugby? Looking to start a team in west austin -</a><font size="-1"> (West - dripping springs, lakeway, areas)</font></p>
<p><a href="/act/991081839.html">ANY QLINK XF200 SUPERMOTO OWNERS OUT THERE -</a><font size="-1"> (CENTRAL TEXAS)</font> <span class="p"> pic</span></p>
<p><a href="/act/991057729.html">Join Family and Friends to Lose Weight in 09!!!! -</a><font size="-1"> (Austin)</font></p>
<h4>Mon Jan 12</h4>
<p><a href="/act/989837938.html">H.E.A.T. Boot Camp -</a><font size="-1"> (DT, Round Rock, Pflugerville)</font> <span class="p"> pic</span></p>
<p><a href="/act/990610113.html">FREE !!!! Salsa Dance Classes for Beginners -</a></p>
<p><a href="/act/990503170.html">Austin Metro Baseball League -</a><font size="-1"> (Austin, Texas)</font></p>
<p><a href="/act/990506065.html">Hot or Not Survey: Rate Photos of Single Men and Women -</a></p>
<p><a href="/act/990365041.html">Early Morning or Evening Classes Available! Free Boot Camp! Bring a Fr -</a><font size="-1"> (Austin and Surrounding Areas)</font></p>
<p><a href="/act/990282220.html">Fitness Training Studios-Round Rock -</a><font size="-1"> (round rock/austin)</font></p>
<p><a href="/act/990206516.html">Baseball Players wanted 18+ -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/990179653.html">meet cool people now -</a><font size="-1"> (austin)</font></p>
<p><a href="/act/990165942.html">Want to go camping in Coloardo? -</a></p>
<p><a href="/act/990094775.html">Male Looking for Female Massage Partner -</a></p>
<p><a href="/act/990081671.html">Looking for roleplayers who like Exalted or Mage -</a><font size="-1"> (North Austin)</font></p>
<p><a href="/act/989972161.html">Doctor Who Fan Club -</a><font size="-1"> (North Austin)</font></p>
<p><a href="/act/989918540.html">Gauging Interest in group cooking class -</a><font size="-1"> (Wilson appliance? SW)</font></p>
<p><a href="/act/989863061.html">Chinese Circus Pole Classes For Everyday People -</a><font size="-1"> (Various)</font> <span class="p"> pic</span></p>
<p><a href="/act/989845262.html">Kickball Social League -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/989742852.html">Looking for a running partner -</a><font size="-1"> (S/S.W Austin)</font></p>
<p><a href="/act/989581856.html">Over 30 Soccer Team -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/989547987.html">Smart Drunks Need Apply -</a><font size="-1"> (Austin)</font> <span class="p"> img</span></p>
<p><a href="/act/989536612.html">men's freestyle wrestling? -</a></p>
<h4>Sun Jan 11</h4>
<p><a href="/act/989355135.html">French tutor -</a><font size="-1"> (Austin tx (North))</font></p>
<p><a href="/act/989312977.html">SOFTBALL SCRIMMAGES NEEDED -</a><font size="-1"> (SOUTH /NORTH)</font></p>
<p><a href="/act/989277183.html">Austin, TX area golfers -</a></p>
<p><a href="/act/989264608.html">Sand Volleyball -</a><font size="-1"> (SW Austin)</font></p>
<p><a href="/act/988955318.html">flag football -</a><font size="-1"> (Manor TEXAS)</font></p>
<p><a href="/act/988798297.html">Looking for synchronized swimmers... -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/988747055.html">Seeking female dance partner for tonight -</a><font size="-1"> (Continental Club)</font></p>
<p><a href="/act/988734928.html">Looking for Baseball Players for 2009 Season -</a><font size="-1"> (Austin, TX)</font></p>
<p><a href="/act/988722808.html">National Karaoke League REGISTERING NOW for Austin Spring 09 Season! -</a><font size="-1"> (2 Austin Divisions)</font> <span class="p"> pic</span></p>
<p><a href="/act/988677872.html">Chess -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/988306233.html">SOFTBALL PLAYERS NEEDED FOR SOFTBALL AUSTIN "C" DIVISION -</a><font size="-1"> (Krieg Fields )</font></p>
<h4>Sat Jan 10</h4>
<p><a href="/act/988174359.html">Play Darts at a local Pub -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/987971710.html">Audio Producer -</a></p>
<p><a href="/act/987904354.html">Charitable organization looking for Venue to sell kettle corn -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/987683364.html">Sports Conditioning -</a></p>
<p><a href="/act/987652052.html">FREE!!!!!! Salsa Dance Classes for Beginners -</a></p>
<p><a href="/act/987656848.html">Looking for Volleyball Players -</a><font size="-1"> (Cedar Park, Leander, RR &amp; Austin)</font></p>
<p><a href="/act/987605989.html">Beginner Yoga for Wellness ($ 65/10 Classes) -</a><font size="-1"> (Dittmar Rec. Center in South Austin)</font></p>
<p><a href="/act/987587586.html">Take Control of Your Life and Weight, Join Now -</a></p>
<p><a href="/act/987396047.html">January Writers Contest -</a></p>
<p><a href="/act/987314677.html">Whats going on this Saturday? -</a><font size="-1"> (south austin)</font> <span class="p"> pic</span></p>
<h4>Fri Jan 09</h4>
<p><a href="/act/987048713.html">Part Time Hours -</a> <span class="p"> img</span></p>
<p><a href="/act/986777840.html">Swing Practice Partner (50+) -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/986616066.html">Free Massage Exchange -</a></p>
<p><a href="/act/986364958.html">MATURE ACTORS -</a><font size="-1"> (Austin )</font></p>
<p><a href="/act/985988896.html">RE: Weight loss buddy wanted is SPAMMMMM -</a></p>
<h4>Thu Jan 08</h4>
<p><a href="/act/985624787.html">Legal NLTHE Home Game -</a><font size="-1"> (Austin (North))</font></p>
<p><a href="/act/985521939.html">Martial Arts New Years Special, FREE WEEK! -</a><font size="-1"> (beecave,lakeway)</font></p>
<p><a href="/act/985436721.html">Yoga buddy wanted -</a><font size="-1"> (Round Rock/Austin)</font></p>
<p><a href="/act/985360103.html">Looking for a Trainer in Austin, near downtown -</a><font size="-1"> (Austin - downtown)</font> <span class="p"> pic</span></p>
<p><a href="/act/985197181.html">Running at (or near) dusk (or "magic hour") -</a><font size="-1"> (UT)</font></p>
<p><a href="/act/985147438.html">Looking for a Golf Buddy -- Male or Female -</a><font size="-1"> (UT)</font></p>
<p><a href="/act/985023319.html">Any Cat 5's RRers out there looking for someone to train with? -</a><font size="-1"> (Lamar &amp; 2222)</font></p>
<p><a href="/act/984973222.html">Bridge Players 40+ -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/984818172.html">Looking to start a fitness program but not sure boot camp is for you? -</a><font size="-1"> (Austin and Surrounding Areas)</font></p>
<h4>Wed Jan 07</h4>
<p><a href="/act/984516372.html">KARATE/TAE KWON DO FAMILY ACTIVITY CENTER. SAVE MONEY/NO CONTRACTS -</a><font size="-1"> (CEDAR PARK, LEANDER, ROUND ROCK)</font></p>
<p><a href="/act/984389126.html">FREE !!!!!!!! Salsa Dance Classes for Beginners -</a></p>
<p><a href="/act/984317060.html">BADMINTON TONIGHT, OPEN PLAY! at austin rec center -</a><font size="-1"> (1301 shoal creek blvd)</font> <span class="p"> pic</span></p>
<p><a href="/act/984220709.html">Looking for Graphic Artist/ Comic Artist to Collaborate With -</a><font size="-1"> (Central)</font></p>
<p align="center"><font size="4"><a href="index100.html">next 100 postings</a></font>
<div id="footer">
<hr>
<span id="copy">
Copyright &copy; 2009 craigslist, inc.<br>
<a href="#top">Back to top of page</a>
</span>
<span class="rss">
<a class="l" href="http://austin.craigslist.org/act/index.rss">RSS</a>
<a href="http://www.craigslist.org/about/rss">(?)</a><br>
<a class="y" href="http://add.my.yahoo.com/rss?url=http://austin.craigslist.org/act/index.rss">add to My Yahoo!</a>
</span>
</div>
<br><br>
<div id="floater">&nbsp;</div>
</blockquote>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,6 +0,0 @@
{
"entry(p)":[{
"title": ".",
"date": "preceding::h4"
}]
}

View File

@ -1,207 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>austin activity partners classifieds - craigslist</title>
<meta name="description" content="craigslist activity partners classifieds for austin ">
<meta name="keywords" content="austin activity partners craigslist, classifieds, want ads ">
<link rel=alternate type="application/rss+xml" href="index.rss" title="RSS feed for craigslist | activity partners in austin ">
<link rel="stylesheet" title="craigslist" href="http://www.craigslist.org/styles/craigslist.css" type="text/css" media="all">
</head>
<body class="toc">
<a name="top"></a>
<div class="bchead"><span id="ef">
[ <a href="http://www.craigslist.org/about/help/">help</a> ]
[ <a href="https://post.craigslist.org/aus/C">post</a> ]</span>
<a href="/"> austin craigslist</a> &gt; <a href="/act/">activity partners</a></div>
<blockquote>
<form action="/search/act" method="get" onsubmit="ckCAbb();">
<script type="text/javascript"><!--
function ckCAbb() {
t = document.getElementById("cAbb");
if (t.value == "act") { t.disabled = true; }
}
-->
</script>
<table width="95%" cellpadding="2" style="white-space: nowrap; background:#eee; border:1px solid gray;" summary="">
<tr>
<td align="right" width="1">search for:</td>
<td width="30%"><input id="query" name="query" size="30" value=""> in:
<select id="cAbb" name="catAbbreviation">
<option value="ccc">all community<option disabled value="">--<option value="act" selected> activity partners
<option value="ats"> artists
<option value="kid"> childcare
<option value="com"> general
<option value="grp"> groups
<option value="vnn"> local news and views
<option value="laf"> lost &amp; found
<option value="muc"> musicians
<option value="pet"> pets
<option value="pol"> politics
<option value="rid"> rideshare
<option value="vol"> volunteers
<option disabled value="">--<option value="eee">all event<option value="sss">all for sale / wanted<option value="ggg">all gigs<option value="hhh">all housing<option value="jjj">all jobs<option value="ppp">all personals<option value="res">all resume<option value="bbb">all services offered</select>
<input type="submit" value="Search">
</td><td>
<label><input type="checkbox" name="srchType" value="T"
title="check this box to search only posting titles"> only search titles</label>
</td>
</tr>
<tr>
<td align="right" width="1"></td>
<td></td>
<td align="left"><label><input type="checkbox" name="hasPic" value="1"> has image</label></td>
</tr></table></form></blockquote><span id="showPics"></span><span id="hidePics"></span>
<blockquote>
<table width="95%" summary="">
<tr>
<td valign="top">[ Thu, 15 Jan 19:13:19 ]</td>
<td valign="top" id="messages"><span class="hl"> [ <b><a href="/about/safety">PERSONAL SAFETY TIPS</a></b> ] </span> <span class="hl"> [ <b><a href="/about/scams">AVOIDING SCAMS &amp; FRAUD</a></b> ] </span> <span class="hl"> [<a href="/cgi-bin/success.stories.cgi">success story?</a>]</span> </td>
</tr>
</table>
<h4>Thu Jan 15</h4>
<p><a href="/act/994549324.html">Female Running Partner -</a><font size="-1"> (Shoal Creek or Town Lake)</font></p>
<p><a href="/act/994427679.html">TENNIS ANYONE? -</a><font size="-1"> (i35 &amp; US71)</font></p>
<p><a href="/act/994375294.html">Home Workers Needed -</a><font size="-1"> (Anywhere, USA)</font></p>
<p><a href="/act/994247774.html">Do you follow Eat to Live by Dr. Joel Fuhrman? -</a><font size="-1"> (North Central Austin)</font></p>
<p><a href="/act/994238180.html">photographer buddy -</a><font size="-1"> (Austin/central/south/s/w)</font> <span class="p"> pic</span></p>
<p><a href="/act/994209394.html">GET IN THE BEST SHAPE OF YOUR LIFE!!! -</a><font size="-1"> (NW Austin)</font> <span class="p"> pic</span></p>
<p><a href="/act/994198051.html">I CAN HELP ATHLETES GET FASTER &amp; MORE EXPLOSIVE, $28 to $35 a session -</a></p>
<p><a href="/act/994185159.html">Sing your heart out in the NATIONAL KARAOKE LEAGUE! -</a><font size="-1"> (2 Austin Divisions)</font> <span class="p"> pic</span></p>
<p><a href="/act/994111282.html"> FITNESS TRAINING for $20 -</a><font size="-1"> (austin/round rock)</font></p>
<p><a href="/act/994023820.html">Looking for a great workout? -</a><font size="-1"> (Austin and Surrounding Areas)</font></p>
<p><a href="/act/993919120.html">JOIN: The Give Me A Dollar Club -</a><font size="-1"> (The Universe and Beyond)</font></p>
<p><a href="/act/993913699.html">Do You Want To Be The Biggest Loser In Austin ? -</a></p>
<p><a href="/act/993878678.html">Seeking Tennis Hitting Partner -</a><font size="-1"> (NW Austin/CP High School)</font></p>
<p><a href="/act/993802305.html">want to play rugby? -</a><font size="-1"> (West Austin area)</font> <span class="p"> pic</span></p>
<p><a href="/act/993760889.html">Tongiht DateandDash Speed-Dating Party For College Grads -</a><font size="-1"> (Halcyon Cafe)</font> <span class="p"> pic</span></p>
<p><a href="/act/993731629.html">4TH ANNUAL HOT CHOCOLATE AND COOKIES RIDE!!! -</a><font size="-1"> ( Round Rock Harley Davidson)</font></p>
<p><a href="/act/993660526.html">Traveling The World By Backpack Need Someone To Manage business -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/992760567.html">Massage/facial room for rent in Round Rock -</a><font size="-1"> (Round Rock, Tx)</font></p>
<h4>Wed Jan 14</h4>
<p><a href="/act/993511991.html">Gentle Yoga for Beginners (From $ 30/10 Classes....) -</a><font size="-1"> (Five Austin Locations)</font></p>
<p><a href="/act/993414260.html">Pflugerville Fitness Boot Camps -</a><font size="-1"> (Pfluger Park)</font> <span class="p"> pic</span></p>
<p><a href="/act/993408050.html">Round Rock Mommy Group Seeking New Members -</a><font size="-1"> (Round Rock)</font></p>
<p><a href="/act/993302861.html">Men's Over 30 Soccer Team looking for players -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/992975456.html">tennis players for fun times -</a><font size="-1"> (taylor/ hutto/granger)</font></p>
<p><a href="/act/993159668.html">Co-ed Soccer Players -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/992992750.html">BADMINTON TONIGHT! adult, both women and men -</a><font size="-1"> (austin rec center, 1301 shoal creek)</font> <span class="p"> pic</span></p>
<p><a href="/act/992943165.html">YOUTH FLAG FOOTBALL -</a><font size="-1"> (ROUND ROCK TX)</font></p>
<p><a href="/act/992893767.html">Workout!!! I'll help you quit making excuses!!! $26 - $50 -</a></p>
<p><a href="/act/992558125.html">S exercise -</a><font size="-1"> (Atx)</font> <span class="p"> pic</span></p>
<p><a href="/act/992451634.html">Dance Classes for Bigger Bodies -</a><font size="-1"> (Central Austin)</font></p>
<p><a href="/act/992267236.html">Dance partner wanted -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/992239729.html">Arabic Tutor -</a><font size="-1"> (Austin)</font></p>
<h4>Tue Jan 13</h4>
<p><a href="/act/991895757.html">Any norwegian speakers, anyone from Norway in Austin? -</a><font size="-1"> (Downtown)</font></p>
<p><a href="/act/991763196.html">Tennis, Biking, Badminton, Jogging, Hiking, Dancing, etc. -</a><font size="-1"> (Southwest Austin)</font></p>
<p><a href="/act/991734075.html">Tennis in NW Austin? -</a><font size="-1"> (Lake Creek and 183)</font></p>
<p><a href="/act/991563998.html">Looking for Workout partner at Gold's Gym -</a><font size="-1"> (SW Austin)</font> <span class="p"> pic</span></p>
<p><a href="/act/991432735.html">VOICE LESSONS -</a></p>
<p><a href="/act/991553805.html">Meet New People in the NATIONAL KARAOKE LEAGUE! Register Today!!! -</a><font size="-1"> (2 Austin Divisions)</font> <span class="p"> pic</span></p>
<p><a href="/act/991201591.html">Women's Rugby in Austin -</a><font size="-1"> (Burnett Middle School)</font> <span class="p"> pic</span></p>
<p><a href="/act/991196763.html">Hate the Gym ? Hate Boot camps? Join Us -</a></p>
<p><a href="/act/991123059.html">Interested in playing rugby? Looking to start a team in west austin -</a><font size="-1"> (West - dripping springs, lakeway, areas)</font></p>
<p><a href="/act/991081839.html">ANY QLINK XF200 SUPERMOTO OWNERS OUT THERE -</a><font size="-1"> (CENTRAL TEXAS)</font> <span class="p"> pic</span></p>
<p><a href="/act/991057729.html">Join Family and Friends to Lose Weight in 09!!!! -</a><font size="-1"> (Austin)</font></p>
<h4>Mon Jan 12</h4>
<p><a href="/act/989837938.html">H.E.A.T. Boot Camp -</a><font size="-1"> (DT, Round Rock, Pflugerville)</font> <span class="p"> pic</span></p>
<p><a href="/act/990610113.html">FREE !!!! Salsa Dance Classes for Beginners -</a></p>
<p><a href="/act/990503170.html">Austin Metro Baseball League -</a><font size="-1"> (Austin, Texas)</font></p>
<p><a href="/act/990506065.html">Hot or Not Survey: Rate Photos of Single Men and Women -</a></p>
<p><a href="/act/990365041.html">Early Morning or Evening Classes Available! Free Boot Camp! Bring a Fr -</a><font size="-1"> (Austin and Surrounding Areas)</font></p>
<p><a href="/act/990282220.html">Fitness Training Studios-Round Rock -</a><font size="-1"> (round rock/austin)</font></p>
<p><a href="/act/990206516.html">Baseball Players wanted 18+ -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/990179653.html">meet cool people now -</a><font size="-1"> (austin)</font></p>
<p><a href="/act/990165942.html">Want to go camping in Coloardo? -</a></p>
<p><a href="/act/990094775.html">Male Looking for Female Massage Partner -</a></p>
<p><a href="/act/990081671.html">Looking for roleplayers who like Exalted or Mage -</a><font size="-1"> (North Austin)</font></p>
<p><a href="/act/989972161.html">Doctor Who Fan Club -</a><font size="-1"> (North Austin)</font></p>
<p><a href="/act/989918540.html">Gauging Interest in group cooking class -</a><font size="-1"> (Wilson appliance? SW)</font></p>
<p><a href="/act/989863061.html">Chinese Circus Pole Classes For Everyday People -</a><font size="-1"> (Various)</font> <span class="p"> pic</span></p>
<p><a href="/act/989845262.html">Kickball Social League -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/989742852.html">Looking for a running partner -</a><font size="-1"> (S/S.W Austin)</font></p>
<p><a href="/act/989581856.html">Over 30 Soccer Team -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/989547987.html">Smart Drunks Need Apply -</a><font size="-1"> (Austin)</font> <span class="p"> img</span></p>
<p><a href="/act/989536612.html">men's freestyle wrestling? -</a></p>
<h4>Sun Jan 11</h4>
<p><a href="/act/989355135.html">French tutor -</a><font size="-1"> (Austin tx (North))</font></p>
<p><a href="/act/989312977.html">SOFTBALL SCRIMMAGES NEEDED -</a><font size="-1"> (SOUTH /NORTH)</font></p>
<p><a href="/act/989277183.html">Austin, TX area golfers -</a></p>
<p><a href="/act/989264608.html">Sand Volleyball -</a><font size="-1"> (SW Austin)</font></p>
<p><a href="/act/988955318.html">flag football -</a><font size="-1"> (Manor TEXAS)</font></p>
<p><a href="/act/988798297.html">Looking for synchronized swimmers... -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/988747055.html">Seeking female dance partner for tonight -</a><font size="-1"> (Continental Club)</font></p>
<p><a href="/act/988734928.html">Looking for Baseball Players for 2009 Season -</a><font size="-1"> (Austin, TX)</font></p>
<p><a href="/act/988722808.html">National Karaoke League REGISTERING NOW for Austin Spring 09 Season! -</a><font size="-1"> (2 Austin Divisions)</font> <span class="p"> pic</span></p>
<p><a href="/act/988677872.html">Chess -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/988306233.html">SOFTBALL PLAYERS NEEDED FOR SOFTBALL AUSTIN "C" DIVISION -</a><font size="-1"> (Krieg Fields )</font></p>
<h4>Sat Jan 10</h4>
<p><a href="/act/988174359.html">Play Darts at a local Pub -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/987971710.html">Audio Producer -</a></p>
<p><a href="/act/987904354.html">Charitable organization looking for Venue to sell kettle corn -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/987683364.html">Sports Conditioning -</a></p>
<p><a href="/act/987652052.html">FREE!!!!!! Salsa Dance Classes for Beginners -</a></p>
<p><a href="/act/987656848.html">Looking for Volleyball Players -</a><font size="-1"> (Cedar Park, Leander, RR &amp; Austin)</font></p>
<p><a href="/act/987605989.html">Beginner Yoga for Wellness ($ 65/10 Classes) -</a><font size="-1"> (Dittmar Rec. Center in South Austin)</font></p>
<p><a href="/act/987587586.html">Take Control of Your Life and Weight, Join Now -</a></p>
<p><a href="/act/987396047.html">January Writers Contest -</a></p>
<p><a href="/act/987314677.html">Whats going on this Saturday? -</a><font size="-1"> (south austin)</font> <span class="p"> pic</span></p>
<h4>Fri Jan 09</h4>
<p><a href="/act/987048713.html">Part Time Hours -</a> <span class="p"> img</span></p>
<p><a href="/act/986777840.html">Swing Practice Partner (50+) -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/986616066.html">Free Massage Exchange -</a></p>
<p><a href="/act/986364958.html">MATURE ACTORS -</a><font size="-1"> (Austin )</font></p>
<p><a href="/act/985988896.html">RE: Weight loss buddy wanted is SPAMMMMM -</a></p>
<h4>Thu Jan 08</h4>
<p><a href="/act/985624787.html">Legal NLTHE Home Game -</a><font size="-1"> (Austin (North))</font></p>
<p><a href="/act/985521939.html">Martial Arts New Years Special, FREE WEEK! -</a><font size="-1"> (beecave,lakeway)</font></p>
<p><a href="/act/985436721.html">Yoga buddy wanted -</a><font size="-1"> (Round Rock/Austin)</font></p>
<p><a href="/act/985360103.html">Looking for a Trainer in Austin, near downtown -</a><font size="-1"> (Austin - downtown)</font> <span class="p"> pic</span></p>
<p><a href="/act/985197181.html">Running at (or near) dusk (or "magic hour") -</a><font size="-1"> (UT)</font></p>
<p><a href="/act/985147438.html">Looking for a Golf Buddy -- Male or Female -</a><font size="-1"> (UT)</font></p>
<p><a href="/act/985023319.html">Any Cat 5's RRers out there looking for someone to train with? -</a><font size="-1"> (Lamar &amp; 2222)</font></p>
<p><a href="/act/984973222.html">Bridge Players 40+ -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/984818172.html">Looking to start a fitness program but not sure boot camp is for you? -</a><font size="-1"> (Austin and Surrounding Areas)</font></p>
<h4>Wed Jan 07</h4>
<p><a href="/act/984516372.html">KARATE/TAE KWON DO FAMILY ACTIVITY CENTER. SAVE MONEY/NO CONTRACTS -</a><font size="-1"> (CEDAR PARK, LEANDER, ROUND ROCK)</font></p>
<p><a href="/act/984389126.html">FREE !!!!!!!! Salsa Dance Classes for Beginners -</a></p>
<p><a href="/act/984317060.html">BADMINTON TONIGHT, OPEN PLAY! at austin rec center -</a><font size="-1"> (1301 shoal creek blvd)</font> <span class="p"> pic</span></p>
<p><a href="/act/984220709.html">Looking for Graphic Artist/ Comic Artist to Collaborate With -</a><font size="-1"> (Central)</font></p>
<p align="center"><font size="4"><a href="index100.html">next 100 postings</a></font>
<div id="footer">
<hr>
<span id="copy">
Copyright &copy; 2009 craigslist, inc.<br>
<a href="#top">Back to top of page</a>
</span>
<span class="rss">
<a class="l" href="http://austin.craigslist.org/act/index.rss">RSS</a>
<a href="http://www.craigslist.org/about/rss">(?)</a><br>
<a class="y" href="http://add.my.yahoo.com/rss?url=http://austin.craigslist.org/act/index.rss">add to My Yahoo!</a>
</span>
</div>
<br><br>
<div id="floater">&nbsp;</div>
</blockquote>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,9 +0,0 @@
{
"groups": [{
"date": "h4",
"events(p)": [{
"title": ".",
"link": "a/@href",
}]
}]
}

View File

@ -1,3 +0,0 @@
<html>
<body foo="bar"></body>
</html>

View File

@ -1 +0,0 @@
{ "foo": "bar" }

View File

@ -1,3 +0,0 @@
{
"foo": "body @foo"
}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
{ }

View File

@ -1 +0,0 @@
{}

View File

@ -1,207 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>austin activity partners classifieds - craigslist</title>
<meta name="description" content="craigslist activity partners classifieds for austin ">
<meta name="keywords" content="austin activity partners craigslist, classifieds, want ads ">
<link rel=alternate type="application/rss+xml" href="index.rss" title="RSS feed for craigslist | activity partners in austin ">
<link rel="stylesheet" title="craigslist" href="http://www.craigslist.org/styles/craigslist.css" type="text/css" media="all">
</head>
<body class="toc">
<a name="top"></a>
<div class="bchead"><span id="ef">
[ <a href="http://www.craigslist.org/about/help/">help</a> ]
[ <a href="https://post.craigslist.org/aus/C">post</a> ]</span>
<a href="/"> austin craigslist</a> &gt; <a href="/act/">activity partners</a></div>
<blockquote>
<form action="/search/act" method="get" onsubmit="ckCAbb();">
<script type="text/javascript"><!--
function ckCAbb() {
t = document.getElementById("cAbb");
if (t.value == "act") { t.disabled = true; }
}
-->
</script>
<table width="95%" cellpadding="2" style="white-space: nowrap; background:#eee; border:1px solid gray;" summary="">
<tr>
<td align="right" width="1">search for:</td>
<td width="30%"><input id="query" name="query" size="30" value=""> in:
<select id="cAbb" name="catAbbreviation">
<option value="ccc">all community<option disabled value="">--<option value="act" selected> activity partners
<option value="ats"> artists
<option value="kid"> childcare
<option value="com"> general
<option value="grp"> groups
<option value="vnn"> local news and views
<option value="laf"> lost &amp; found
<option value="muc"> musicians
<option value="pet"> pets
<option value="pol"> politics
<option value="rid"> rideshare
<option value="vol"> volunteers
<option disabled value="">--<option value="eee">all event<option value="sss">all for sale / wanted<option value="ggg">all gigs<option value="hhh">all housing<option value="jjj">all jobs<option value="ppp">all personals<option value="res">all resume<option value="bbb">all services offered</select>
<input type="submit" value="Search">
</td><td>
<label><input type="checkbox" name="srchType" value="T"
title="check this box to search only posting titles"> only search titles</label>
</td>
</tr>
<tr>
<td align="right" width="1"></td>
<td></td>
<td align="left"><label><input type="checkbox" name="hasPic" value="1"> has image</label></td>
</tr></table></form></blockquote><span id="showPics"></span><span id="hidePics"></span>
<blockquote>
<table width="95%" summary="">
<tr>
<td valign="top">[ Thu, 15 Jan 19:13:19 ]</td>
<td valign="top" id="messages"><span class="hl"> [ <b><a href="/about/safety">PERSONAL SAFETY TIPS</a></b> ] </span> <span class="hl"> [ <b><a href="/about/scams">AVOIDING SCAMS &amp; FRAUD</a></b> ] </span> <span class="hl"> [<a href="/cgi-bin/success.stories.cgi">success story?</a>]</span> </td>
</tr>
</table>
<h4>Thu Jan 15</h4>
<p><a href="/act/994549324.html">Female Running Partner -</a><font size="-1"> (Shoal Creek or Town Lake)</font></p>
<p><a href="/act/994427679.html">TENNIS ANYONE? -</a><font size="-1"> (i35 &amp; US71)</font></p>
<p><a href="/act/994375294.html">Home Workers Needed -</a><font size="-1"> (Anywhere, USA)</font></p>
<p><a href="/act/994247774.html">Do you follow Eat to Live by Dr. Joel Fuhrman? -</a><font size="-1"> (North Central Austin)</font></p>
<p><a href="/act/994238180.html">photographer buddy -</a><font size="-1"> (Austin/central/south/s/w)</font> <span class="p"> pic</span></p>
<p><a href="/act/994209394.html">GET IN THE BEST SHAPE OF YOUR LIFE!!! -</a><font size="-1"> (NW Austin)</font> <span class="p"> pic</span></p>
<p><a href="/act/994198051.html">I CAN HELP ATHLETES GET FASTER &amp; MORE EXPLOSIVE, $28 to $35 a session -</a></p>
<p><a href="/act/994185159.html">Sing your heart out in the NATIONAL KARAOKE LEAGUE! -</a><font size="-1"> (2 Austin Divisions)</font> <span class="p"> pic</span></p>
<p><a href="/act/994111282.html"> FITNESS TRAINING for $20 -</a><font size="-1"> (austin/round rock)</font></p>
<p><a href="/act/994023820.html">Looking for a great workout? -</a><font size="-1"> (Austin and Surrounding Areas)</font></p>
<p><a href="/act/993919120.html">JOIN: The Give Me A Dollar Club -</a><font size="-1"> (The Universe and Beyond)</font></p>
<p><a href="/act/993913699.html">Do You Want To Be The Biggest Loser In Austin ? -</a></p>
<p><a href="/act/993878678.html">Seeking Tennis Hitting Partner -</a><font size="-1"> (NW Austin/CP High School)</font></p>
<p><a href="/act/993802305.html">want to play rugby? -</a><font size="-1"> (West Austin area)</font> <span class="p"> pic</span></p>
<p><a href="/act/993760889.html">Tongiht DateandDash Speed-Dating Party For College Grads -</a><font size="-1"> (Halcyon Cafe)</font> <span class="p"> pic</span></p>
<p><a href="/act/993731629.html">4TH ANNUAL HOT CHOCOLATE AND COOKIES RIDE!!! -</a><font size="-1"> ( Round Rock Harley Davidson)</font></p>
<p><a href="/act/993660526.html">Traveling The World By Backpack Need Someone To Manage business -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/992760567.html">Massage/facial room for rent in Round Rock -</a><font size="-1"> (Round Rock, Tx)</font></p>
<h4>Wed Jan 14</h4>
<p><a href="/act/993511991.html">Gentle Yoga for Beginners (From $ 30/10 Classes....) -</a><font size="-1"> (Five Austin Locations)</font></p>
<p><a href="/act/993414260.html">Pflugerville Fitness Boot Camps -</a><font size="-1"> (Pfluger Park)</font> <span class="p"> pic</span></p>
<p><a href="/act/993408050.html">Round Rock Mommy Group Seeking New Members -</a><font size="-1"> (Round Rock)</font></p>
<p><a href="/act/993302861.html">Men's Over 30 Soccer Team looking for players -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/992975456.html">tennis players for fun times -</a><font size="-1"> (taylor/ hutto/granger)</font></p>
<p><a href="/act/993159668.html">Co-ed Soccer Players -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/992992750.html">BADMINTON TONIGHT! adult, both women and men -</a><font size="-1"> (austin rec center, 1301 shoal creek)</font> <span class="p"> pic</span></p>
<p><a href="/act/992943165.html">YOUTH FLAG FOOTBALL -</a><font size="-1"> (ROUND ROCK TX)</font></p>
<p><a href="/act/992893767.html">Workout!!! I'll help you quit making excuses!!! $26 - $50 -</a></p>
<p><a href="/act/992558125.html">S exercise -</a><font size="-1"> (Atx)</font> <span class="p"> pic</span></p>
<p><a href="/act/992451634.html">Dance Classes for Bigger Bodies -</a><font size="-1"> (Central Austin)</font></p>
<p><a href="/act/992267236.html">Dance partner wanted -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/992239729.html">Arabic Tutor -</a><font size="-1"> (Austin)</font></p>
<h4>Tue Jan 13</h4>
<p><a href="/act/991895757.html">Any norwegian speakers, anyone from Norway in Austin? -</a><font size="-1"> (Downtown)</font></p>
<p><a href="/act/991763196.html">Tennis, Biking, Badminton, Jogging, Hiking, Dancing, etc. -</a><font size="-1"> (Southwest Austin)</font></p>
<p><a href="/act/991734075.html">Tennis in NW Austin? -</a><font size="-1"> (Lake Creek and 183)</font></p>
<p><a href="/act/991563998.html">Looking for Workout partner at Gold's Gym -</a><font size="-1"> (SW Austin)</font> <span class="p"> pic</span></p>
<p><a href="/act/991432735.html">VOICE LESSONS -</a></p>
<p><a href="/act/991553805.html">Meet New People in the NATIONAL KARAOKE LEAGUE! Register Today!!! -</a><font size="-1"> (2 Austin Divisions)</font> <span class="p"> pic</span></p>
<p><a href="/act/991201591.html">Women's Rugby in Austin -</a><font size="-1"> (Burnett Middle School)</font> <span class="p"> pic</span></p>
<p><a href="/act/991196763.html">Hate the Gym ? Hate Boot camps? Join Us -</a></p>
<p><a href="/act/991123059.html">Interested in playing rugby? Looking to start a team in west austin -</a><font size="-1"> (West - dripping springs, lakeway, areas)</font></p>
<p><a href="/act/991081839.html">ANY QLINK XF200 SUPERMOTO OWNERS OUT THERE -</a><font size="-1"> (CENTRAL TEXAS)</font> <span class="p"> pic</span></p>
<p><a href="/act/991057729.html">Join Family and Friends to Lose Weight in 09!!!! -</a><font size="-1"> (Austin)</font></p>
<h4>Mon Jan 12</h4>
<p><a href="/act/989837938.html">H.E.A.T. Boot Camp -</a><font size="-1"> (DT, Round Rock, Pflugerville)</font> <span class="p"> pic</span></p>
<p><a href="/act/990610113.html">FREE !!!! Salsa Dance Classes for Beginners -</a></p>
<p><a href="/act/990503170.html">Austin Metro Baseball League -</a><font size="-1"> (Austin, Texas)</font></p>
<p><a href="/act/990506065.html">Hot or Not Survey: Rate Photos of Single Men and Women -</a></p>
<p><a href="/act/990365041.html">Early Morning or Evening Classes Available! Free Boot Camp! Bring a Fr -</a><font size="-1"> (Austin and Surrounding Areas)</font></p>
<p><a href="/act/990282220.html">Fitness Training Studios-Round Rock -</a><font size="-1"> (round rock/austin)</font></p>
<p><a href="/act/990206516.html">Baseball Players wanted 18+ -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/990179653.html">meet cool people now -</a><font size="-1"> (austin)</font></p>
<p><a href="/act/990165942.html">Want to go camping in Coloardo? -</a></p>
<p><a href="/act/990094775.html">Male Looking for Female Massage Partner -</a></p>
<p><a href="/act/990081671.html">Looking for roleplayers who like Exalted or Mage -</a><font size="-1"> (North Austin)</font></p>
<p><a href="/act/989972161.html">Doctor Who Fan Club -</a><font size="-1"> (North Austin)</font></p>
<p><a href="/act/989918540.html">Gauging Interest in group cooking class -</a><font size="-1"> (Wilson appliance? SW)</font></p>
<p><a href="/act/989863061.html">Chinese Circus Pole Classes For Everyday People -</a><font size="-1"> (Various)</font> <span class="p"> pic</span></p>
<p><a href="/act/989845262.html">Kickball Social League -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/989742852.html">Looking for a running partner -</a><font size="-1"> (S/S.W Austin)</font></p>
<p><a href="/act/989581856.html">Over 30 Soccer Team -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/989547987.html">Smart Drunks Need Apply -</a><font size="-1"> (Austin)</font> <span class="p"> img</span></p>
<p><a href="/act/989536612.html">men's freestyle wrestling? -</a></p>
<h4>Sun Jan 11</h4>
<p><a href="/act/989355135.html">French tutor -</a><font size="-1"> (Austin tx (North))</font></p>
<p><a href="/act/989312977.html">SOFTBALL SCRIMMAGES NEEDED -</a><font size="-1"> (SOUTH /NORTH)</font></p>
<p><a href="/act/989277183.html">Austin, TX area golfers -</a></p>
<p><a href="/act/989264608.html">Sand Volleyball -</a><font size="-1"> (SW Austin)</font></p>
<p><a href="/act/988955318.html">flag football -</a><font size="-1"> (Manor TEXAS)</font></p>
<p><a href="/act/988798297.html">Looking for synchronized swimmers... -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/988747055.html">Seeking female dance partner for tonight -</a><font size="-1"> (Continental Club)</font></p>
<p><a href="/act/988734928.html">Looking for Baseball Players for 2009 Season -</a><font size="-1"> (Austin, TX)</font></p>
<p><a href="/act/988722808.html">National Karaoke League REGISTERING NOW for Austin Spring 09 Season! -</a><font size="-1"> (2 Austin Divisions)</font> <span class="p"> pic</span></p>
<p><a href="/act/988677872.html">Chess -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/988306233.html">SOFTBALL PLAYERS NEEDED FOR SOFTBALL AUSTIN "C" DIVISION -</a><font size="-1"> (Krieg Fields )</font></p>
<h4>Sat Jan 10</h4>
<p><a href="/act/988174359.html">Play Darts at a local Pub -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/987971710.html">Audio Producer -</a></p>
<p><a href="/act/987904354.html">Charitable organization looking for Venue to sell kettle corn -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/987683364.html">Sports Conditioning -</a></p>
<p><a href="/act/987652052.html">FREE!!!!!! Salsa Dance Classes for Beginners -</a></p>
<p><a href="/act/987656848.html">Looking for Volleyball Players -</a><font size="-1"> (Cedar Park, Leander, RR &amp; Austin)</font></p>
<p><a href="/act/987605989.html">Beginner Yoga for Wellness ($ 65/10 Classes) -</a><font size="-1"> (Dittmar Rec. Center in South Austin)</font></p>
<p><a href="/act/987587586.html">Take Control of Your Life and Weight, Join Now -</a></p>
<p><a href="/act/987396047.html">January Writers Contest -</a></p>
<p><a href="/act/987314677.html">Whats going on this Saturday? -</a><font size="-1"> (south austin)</font> <span class="p"> pic</span></p>
<h4>Fri Jan 09</h4>
<p><a href="/act/987048713.html">Part Time Hours -</a> <span class="p"> img</span></p>
<p><a href="/act/986777840.html">Swing Practice Partner (50+) -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/986616066.html">Free Massage Exchange -</a></p>
<p><a href="/act/986364958.html">MATURE ACTORS -</a><font size="-1"> (Austin )</font></p>
<p><a href="/act/985988896.html">RE: Weight loss buddy wanted is SPAMMMMM -</a></p>
<h4>Thu Jan 08</h4>
<p><a href="/act/985624787.html">Legal NLTHE Home Game -</a><font size="-1"> (Austin (North))</font></p>
<p><a href="/act/985521939.html">Martial Arts New Years Special, FREE WEEK! -</a><font size="-1"> (beecave,lakeway)</font></p>
<p><a href="/act/985436721.html">Yoga buddy wanted -</a><font size="-1"> (Round Rock/Austin)</font></p>
<p><a href="/act/985360103.html">Looking for a Trainer in Austin, near downtown -</a><font size="-1"> (Austin - downtown)</font> <span class="p"> pic</span></p>
<p><a href="/act/985197181.html">Running at (or near) dusk (or "magic hour") -</a><font size="-1"> (UT)</font></p>
<p><a href="/act/985147438.html">Looking for a Golf Buddy -- Male or Female -</a><font size="-1"> (UT)</font></p>
<p><a href="/act/985023319.html">Any Cat 5's RRers out there looking for someone to train with? -</a><font size="-1"> (Lamar &amp; 2222)</font></p>
<p><a href="/act/984973222.html">Bridge Players 40+ -</a><font size="-1"> (Austin)</font></p>
<p><a href="/act/984818172.html">Looking to start a fitness program but not sure boot camp is for you? -</a><font size="-1"> (Austin and Surrounding Areas)</font></p>
<h4>Wed Jan 07</h4>
<p><a href="/act/984516372.html">KARATE/TAE KWON DO FAMILY ACTIVITY CENTER. SAVE MONEY/NO CONTRACTS -</a><font size="-1"> (CEDAR PARK, LEANDER, ROUND ROCK)</font></p>
<p><a href="/act/984389126.html">FREE !!!!!!!! Salsa Dance Classes for Beginners -</a></p>
<p><a href="/act/984317060.html">BADMINTON TONIGHT, OPEN PLAY! at austin rec center -</a><font size="-1"> (1301 shoal creek blvd)</font> <span class="p"> pic</span></p>
<p><a href="/act/984220709.html">Looking for Graphic Artist/ Comic Artist to Collaborate With -</a><font size="-1"> (Central)</font></p>
<p align="center"><font size="4"><a href="index100.html">next 100 postings</a></font>
<div id="footer">
<hr>
<span id="copy">
Copyright &copy; 2009 craigslist, inc.<br>
<a href="#top">Back to top of page</a>
</span>
<span class="rss">
<a class="l" href="http://austin.craigslist.org/act/index.rss">RSS</a>
<a href="http://www.craigslist.org/about/rss">(?)</a><br>
<a class="y" href="http://add.my.yahoo.com/rss?url=http://austin.craigslist.org/act/index.rss">add to My Yahoo!</a>
</span>
</div>
<br><br>
<div id="floater">&nbsp;</div>
</blockquote>
</body>
</html>

View File

@ -1,3 +0,0 @@
{
"foo": [{}]
}

View File

@ -1,43 +0,0 @@
<html>
<body>
<div>
<h1>title1</h1>
<ul id="nav">
<li id="a">home</li>
<li id="b">about</li>
</ul>
</div>
<div>
<ul id="posts">
<li>
<h2>some post</h2>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p>
<p>It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. </p>
<p>It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<div id="comments">
<h3>joe1</h3>
<p>This sux!</p>
<p>No, really; it's awful!!!</p>
<h3>bob1</h3>
<p>who uses semi-colons?</p>
<h3>joe1.5</h3>
<p>who hyphenates semicolon?</p>
</div>
</li>
<li>
<h2>another post</h2>
<p>I hate lipsum. It's hard to tell which post you're on.</p>
<p>Obligatory second paragraph <br>with<br>line<br>breaks</p>
<div id="comments">
<h3>suzy2</h3>
<p>FRIST POST!!!</p>
<h3>bob2</h3>
<p>grow up</p>
<p>2nd post</p>
</div>
</li>
</ul>
</div>
<h1>another title -- empty page</h1>
</body>
</html>

View File

@ -1 +0,0 @@
{ "page": [ { "title": "title1", "nav": [ "home", "about" ], "post": [ { "title": "some post", "paras": [ "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. ", "It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. ", "It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum." ], "comments": [ { "title": "joe1", "paras": [ "This sux!", "No, really; it's awful!!!" ] }, { "title": "bob1", "paras": [ "who uses semi-colons?" ] }, { "title": "joe1.5", "paras": [ "who hyphenates semicolon?" ] } ] }, { "title": "another post", "paras": [ "I hate lipsum. It's hard to tell which post you're on.", "Obligatory second paragraph withlinebreaks" ], "comments": [ { "title": "suzy2", "paras": [ "FRIST POST!!!" ] }, { "title": "bob2", "paras": [ "grow up", "2nd post" ] } ] } ] }, { "title": "another title -- empty page" } ] }

View File

@ -1,14 +0,0 @@
{
"page": [{
"title": "h1",
"nav?": ["ul#nav li"],
"post(#posts li)?": [{
"title": "h2",
"paras": ["./p"],
"comments": [{
"title": "#comments h3",
"paras": ["#comments p"]
}]
}]
}]
}

View File

@ -1,43 +0,0 @@
<html>
<body>
<div>
<h1>title1</h1>
<ul id="nav">
<li id="a">home</li>
<li id="b">about</li>
</ul>
</div>
<div>
<ul id="posts">
<li>
<h2>some post</h2>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p>
<p>It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. </p>
<p>It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<div id="comments">
<h3>joe1</h3>
<p>This sux!</p>
<p>No, really; it's awful!!!</p>
<h3>bob1</h3>
<p>who uses semi-colons?</p>
<h3>joe1.5</h3>
<p>who hyphenates semicolon?</p>
</div>
</li>
<li>
<h2>another post</h2>
<p>I hate lipsum. It's hard to tell which post you're on.</p>
<p>Obligatory second paragraph <br>with<br>line<br>breaks</p>
<div id="comments">
<h3>suzy2</h3>
<p>FRIST POST!!!</p>
<h3>bob2</h3>
<p>grow up</p>
<p>2nd post</p>
</div>
</li>
</ul>
</div>
<h1>another title -- empty page</h1>
</body>
</html>

View File

@ -1 +0,0 @@
{ "page": [ { "title": "title1", "nav": [ "home", "about" ], "post": [ { "title": "some post", "paras": [ "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. ", "It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. ", "It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum." ], "comments": [ { "title": "joe1", "paras": [ "This sux!", "No, really; it's awful!!!" ] }, { "title": "bob1", "paras": [ "who uses semi-colons?" ] }, { "title": "joe1.5", "paras": [ "who hyphenates semicolon?" ] } ] }, { "title": "another post", "paras": [ "I hate lipsum. It's hard to tell which post you're on.", "Obligatory second paragraph withlinebreaks" ], "comments": [ { "title": "suzy2", "paras": [ "FRIST POST!!!" ] }, { "title": "bob2", "paras": [ "grow up", "2nd post" ] } ] } ] } ] }

View File

@ -1,14 +0,0 @@
{
"page": [{
"title": "h1",
"nav": ["ul#nav li"],
"post(#posts li)": [{
"title": "h2",
"paras": ["./p"],
"comments": [{
"title": "#comments h3",
"paras": ["#comments p"]
}]
}]
}]
}

View File

@ -1,9 +0,0 @@
<html>
<body>
<h1>head1</h1>
<p>p1: a</p>
<p>p2: b</p>
<h1>head2</h1>
<p>p3: Z</p>
</body>
</html>

View File

@ -1 +0,0 @@
{ "magics": [ { "head": "head1", "para": [ " a", " b" ], "single": " a" }, { "head": "head2", "para": [ " Z" ], "single": " Z" } ] }

View File

@ -1,7 +0,0 @@
{
"magics": [{
"head": "h1",
"para(p)": ["substring-after(., ':')"],
"single(p)": "substring-after(., ':')"
}]
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +0,0 @@
{
"articles": [ {
"title": ".title a",
"link": ".title a @href",
"comment_count(.subtext a:nth-child(3))": "number(regex:match(., '[0-9]+', ''))",
"comment_link": ".subtext a:nth-child(3) @href"
} ]
}

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +0,0 @@
{
"name": "h1",
"phone": "#bizPhone",
"address": "address",
"reviews(.nonfavoriteReview)": [
{
"date": "func((not closed)",
"user_name": ".reviewer_info a",
"comment": ".review_comment"
}
]
}

View File

@ -1,845 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>Full property table</TITLE>
<link rel="stylesheet" href="style/default.css" type="text/css">
<link rel="stylesheet" href="http://www.w3.org/StyleSheets/TR/W3C-CR.css" type="text/css">
<link rel="prev" href="zindex.html">
<link rel="next" href="grammar.html">
<link rel="contents" href="cover.html#minitoc">
<link rel="CSS-properties" href="propidx.html" title="properties">
<link rel="index" href="indexlist.html" title="index">
<link rel="first" href="cover.html">
</HEAD>
<BODY>
<div class="navbar">
<p><a href="zindex.html">previous</a> &nbsp;
<a href="grammar.html">next</a> &nbsp;
<a href="cover.html#minitoc">contents</a> &nbsp;
<a href="propidx.html">properties</a> &nbsp;
<a href="indexlist.html">index</a> &nbsp;
</div>
<hr class="navbar">
<H1><a name="q0">Appendix F. Full property table</a></H1>
<P><em>This appendix is informative, not normative.</em></P>
<table border=1>
<thead><tr align=center><th>Name<th>Values<th>Initial value<th>Applies to<br>(Default: all)<th>Inherited?<th>Percentages<br>(Default: N/A)<th>Media groups</thead>
<tr><td><a href="aural.html#propdef-azimuth"><span class="propinst-azimuth xref">'azimuth'</span></a>
<td><a href="aural.html#value-def-angle" class="noxref"><span class="value-inst-angle">&lt;angle&gt;</span></a> | [[ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>center
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="colors.html#propdef-background-attachment"><span class="propinst-background-attachment xref">'background-attachment'</span></a>
<td>scroll | fixed | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>scroll
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="colors.html#propdef-background-color"><span class="propinst-background-color xref">'background-color'</span></a>
<td><a href="syndata.html#value-def-color" class="noxref"><span class="value-inst-color">&lt;color&gt;</span></a> | transparent | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>transparent
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="colors.html#propdef-background-image"><span class="propinst-background-image xref">'background-image'</span></a>
<td><a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri">&lt;uri&gt;</span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>none
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="colors.html#propdef-background-position"><span class="propinst-background-position xref">'background-position'</span></a>
<td>[ [ <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | left | center | right ] [ <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | top | center | bottom ]? ] | [ [ left | center | right ] || [ top | center | bottom ] ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>0% 0%
<td>&nbsp;
<td>no
<td>refer to the size of the box itself
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="colors.html#propdef-background-repeat"><span class="propinst-background-repeat xref">'background-repeat'</span></a>
<td>repeat | repeat-x | repeat-y | no-repeat | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>repeat
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="colors.html#propdef-background"><span class="propinst-background xref">'background'</span></a>
<td>[<a href="colors.html#propdef-background-color" class="noxref"><span class="propinst-background-color">'background-color'</span></a> || <a href="colors.html#propdef-background-image" class="noxref"><span class="propinst-background-image">'background-image'</span></a> || <a href="colors.html#propdef-background-repeat" class="noxref"><span class="propinst-background-repeat">'background-repeat'</span></a> || <a href="colors.html#propdef-background-attachment" class="noxref"><span class="propinst-background-attachment">'background-attachment'</span></a> || <a href="colors.html#propdef-background-position" class="noxref"><span class="propinst-background-position">'background-position'</span></a>] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>see individual properties
<td>&nbsp;
<td>no
<td>allowed on 'background-position'
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="tables.html#propdef-border-collapse"><span class="propinst-border-collapse xref">'border-collapse'</span></a>
<td>collapse | separate | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>separate
<td>'table' and 'inline-table' elements
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="box.html#propdef-border-color"><span class="propinst-border-color xref">'border-color'</span></a>
<td>[ <a href="syndata.html#value-def-color" class="noxref"><span class="value-inst-color">&lt;color&gt;</span></a> | transparent ]{1,4} | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>see individual properties
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="tables.html#propdef-border-spacing"><span class="propinst-border-spacing xref">'border-spacing'</span></a>
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a>? | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>0
<td>'table' and 'inline-table' elements&nbsp;
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="box.html#propdef-border-style"><span class="propinst-border-style xref">'border-style'</span></a>
<td><a href="box.html#value-def-border-style" class="noxref"><span class="value-inst-border-style">&lt;border-style&gt;</span></a>{1,4} | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>see individual properties
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="box.html#propdef-border-top"><span class="propinst-border-top xref">'border-top'</span></a>
<a href="box.html#propdef-border-right"><span class="propinst-border-right xref">'border-right'</span></a>
<a href="box.html#propdef-border-bottom"><span class="propinst-border-bottom xref">'border-bottom'</span></a>
<a href="box.html#propdef-border-left"><span class="propinst-border-left xref">'border-left'</span></a>
<td>[ <a href="box.html#value-def-border-width" class="noxref"><span class="value-inst-border-width">&lt;border-width&gt;</span></a> || <a href="box.html#value-def-border-style" class="noxref"><span class="value-inst-border-style">&lt;border-style&gt;</span></a> || <a href="box.html#propdef-border-top-color" class="noxref"><span class="propinst-border-top-color">'border-top-color'</span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>see individual properties
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="box.html#propdef-border-top-color"><span class="propinst-border-top-color xref">'border-top-color'</span></a>
<a href="box.html#propdef-border-right-color"><span class="propinst-border-right-color xref">'border-right-color'</span></a>
<a href="box.html#propdef-border-bottom-color"><span class="propinst-border-bottom-color xref">'border-bottom-color'</span></a>
<a href="box.html#propdef-border-left-color"><span class="propinst-border-left-color xref">'border-left-color'</span></a>
<td><a href="syndata.html#value-def-color" class="noxref"><span class="value-inst-color">&lt;color&gt;</span></a> | transparent | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>the value of the 'color' property
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="box.html#propdef-border-top-style"><span class="propinst-border-top-style xref">'border-top-style'</span></a>
<a href="box.html#propdef-border-right-style"><span class="propinst-border-right-style xref">'border-right-style'</span></a>
<a href="box.html#propdef-border-bottom-style"><span class="propinst-border-bottom-style xref">'border-bottom-style'</span></a>
<a href="box.html#propdef-border-left-style"><span class="propinst-border-left-style xref">'border-left-style'</span></a>
<td><a href="box.html#value-def-border-style" class="noxref"><span class="value-inst-border-style">&lt;border-style&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>none
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="box.html#propdef-border-top-width"><span class="propinst-border-top-width xref">'border-top-width'</span></a>
<a href="box.html#propdef-border-right-width"><span class="propinst-border-right-width xref">'border-right-width'</span></a>
<a href="box.html#propdef-border-bottom-width"><span class="propinst-border-bottom-width xref">'border-bottom-width'</span></a>
<a href="box.html#propdef-border-left-width"><span class="propinst-border-left-width xref">'border-left-width'</span></a>
<td><a href="box.html#value-def-border-width" class="noxref"><span class="value-inst-border-width">&lt;border-width&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>medium
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="box.html#propdef-border-width"><span class="propinst-border-width xref">'border-width'</span></a>
<td><a href="box.html#value-def-border-width" class="noxref"><span class="value-inst-border-width">&lt;border-width&gt;</span></a>{1,4} | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>see individual properties
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="box.html#propdef-border"><span class="propinst-border xref">'border'</span></a>
<td>[ <a href="box.html#value-def-border-width" class="noxref"><span class="value-inst-border-width">&lt;border-width&gt;</span></a> || <a href="box.html#value-def-border-style" class="noxref"><span class="value-inst-border-style">&lt;border-style&gt;</span></a> || <a href="box.html#propdef-border-top-color" class="noxref"><span class="propinst-border-top-color">'border-top-color'</span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>see individual properties
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visuren.html#propdef-bottom"><span class="propinst-bottom xref">'bottom'</span></a>
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>auto
<td>positioned elements
<td>no
<td>refer to height of containing block
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="tables.html#propdef-caption-side"><span class="propinst-caption-side xref">'caption-side'</span></a>
<td>top | bottom | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>top
<td>'table-caption' elements
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visuren.html#propdef-clear"><span class="propinst-clear xref">'clear'</span></a>
<td>none | left | right | both | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>none
<td>block-level elements
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visufx.html#propdef-clip"><span class="propinst-clip xref">'clip'</span></a>
<td><a href="visufx.html#value-def-shape" class="noxref"><span class="value-inst-shape">&lt;shape&gt;</span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>auto
<td>absolutely positioned elements
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="colors.html#propdef-color"><span class="propinst-color xref">'color'</span></a>
<td><a href="syndata.html#value-def-color" class="noxref"><span class="value-inst-color">&lt;color&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>depends on user agent
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="generate.html#propdef-content"><span class="propinst-content xref">'content'</span></a>
<td>normal | none | [ <a href="syndata.html#value-def-string" class="noxref"><span class="value-inst-string">&lt;string&gt;</span></a> | <a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri">&lt;uri&gt;</span></a> | <a href="syndata.html#value-def-counter" class="noxref"><span class="value-inst-counter">&lt;counter&gt;</span></a> | attr(<a href="syndata.html#value-def-identifier" class="noxref"><span class="value-inst-identifier">&lt;identifier&gt;</span></a>) | open-quote | close-quote | no-open-quote | no-close-quote ]+ | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>normal
<td>:before and :after pseudo-elements
<td>no
<td>&nbsp;
<td><a href="media.html#all-media-group">all</a>
<tr><td><a href="generate.html#propdef-counter-increment"><span class="propinst-counter-increment xref">'counter-increment'</span></a>
<td>[ <a href="syndata.html#value-def-identifier" class="noxref"><span class="value-inst-identifier">&lt;identifier&gt;</span></a> <a href="syndata.html#value-def-integer" class="noxref"><span class="value-inst-integer">&lt;integer&gt;</span></a>? ]+ | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>none
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#all-media-group">all</a>
<tr><td><a href="generate.html#propdef-counter-reset"><span class="propinst-counter-reset xref">'counter-reset'</span></a>
<td>[ <a href="syndata.html#value-def-identifier" class="noxref"><span class="value-inst-identifier">&lt;identifier&gt;</span></a> <a href="syndata.html#value-def-integer" class="noxref"><span class="value-inst-integer">&lt;integer&gt;</span></a>? ]+ | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>none
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#all-media-group">all</a>
<tr><td><a href="aural.html#propdef-cue-after"><span class="propinst-cue-after xref">'cue-after'</span></a>
<td><a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri">&lt;uri&gt;</span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>none
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="aural.html#propdef-cue-before"><span class="propinst-cue-before xref">'cue-before'</span></a>
<td><a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri">&lt;uri&gt;</span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>none
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="aural.html#propdef-cue"><span class="propinst-cue xref">'cue'</span></a>
<td>[ <a href="aural.html#propdef-cue-before" class="noxref"><span class="propinst-cue-before">'cue-before'</span></a> || <a href="aural.html#propdef-cue-after" class="noxref"><span class="propinst-cue-after">'cue-after'</span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>see individual properties
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="ui.html#propdef-cursor"><span class="propinst-cursor xref">'cursor'</span></a>
<td>[ [<a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri">&lt;uri&gt;</span></a> ,]* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | text | wait | help | progress ] ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>auto
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#interactive-media-group">interactive</a>
<tr><td><a href="visuren.html#propdef-direction"><span class="propinst-direction xref">'direction'</span></a>
<td>ltr | rtl | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>ltr
<td>all elements, but see prose
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visuren.html#propdef-display"><span class="propinst-display xref">'display'</span></a>
<td>inline | block | list-item | run-in | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>inline
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#all-media-group">all</a>
<tr><td><a href="aural.html#propdef-elevation"><span class="propinst-elevation xref">'elevation'</span></a>
<td><a href="aural.html#value-def-angle" class="noxref"><span class="value-inst-angle">&lt;angle&gt;</span></a> | below | level | above | higher | lower | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>level
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="tables.html#propdef-empty-cells"><span class="propinst-empty-cells xref">'empty-cells'</span></a>
<td>show | hide | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>show
<td>'table-cell' elements
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visuren.html#propdef-float"><span class="propinst-float xref">'float'</span></a>
<td>left | right | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>none
<td>all, but see <a href="visuren.html#dis-pos-flo">9.7</a>
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="fonts.html#propdef-font-family"><span class="propinst-font-family xref">'font-family'</span></a>
<td>[[ <a href="fonts.html#value-def-family-name" class="noxref"><span class="value-inst-family-name">&lt;family-name&gt;</span></a> | <a href="fonts.html#value-def-generic-family" class="noxref"><span class="value-inst-generic-family">&lt;generic-family&gt;</span></a> ] [, <a href="fonts.html#value-def-family-name" class="noxref"><span class="value-inst-family-name">&lt;family-name&gt;</span></a>| <a href="fonts.html#value-def-generic-family" class="noxref"><span class="value-inst-generic-family">&lt;generic-family&gt;</span></a>]* ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>depends on user agent
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="fonts.html#propdef-font-size"><span class="propinst-font-size xref">'font-size'</span></a>
<td><a href="fonts.html#value-def-absolute-size" class="noxref"><span class="value-inst-absolute-size">&lt;absolute-size&gt;</span></a> | <a href="fonts.html#value-def-relative-size" class="noxref"><span class="value-inst-relative-size">&lt;relative-size&gt;</span></a> | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>medium
<td>&nbsp;
<td>yes
<td>refer to parent element's font size
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="fonts.html#propdef-font-style"><span class="propinst-font-style xref">'font-style'</span></a>
<td>normal | italic | oblique | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>normal
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="fonts.html#propdef-font-variant"><span class="propinst-font-variant xref">'font-variant'</span></a>
<td>normal | small-caps | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>normal
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="fonts.html#propdef-font-weight"><span class="propinst-font-weight xref">'font-weight'</span></a>
<td>normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>normal
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="fonts.html#propdef-font"><span class="propinst-font xref">'font'</span></a>
<td>[ [ <a href="fonts.html#propdef-font-style" class="noxref"><span class="propinst-font-style">'font-style'</span></a> || <a href="fonts.html#propdef-font-variant" class="noxref"><span class="propinst-font-variant">'font-variant'</span></a> || <a href="fonts.html#propdef-font-weight" class="noxref"><span class="propinst-font-weight">'font-weight'</span></a> ]? <a href="fonts.html#propdef-font-size" class="noxref"><span class="propinst-font-size">'font-size'</span></a> [ / <a href="visudet.html#propdef-line-height" class="noxref"><span class="propinst-line-height">'line-height'</span></a> ]? <a href="fonts.html#propdef-font-family" class="noxref"><span class="propinst-font-family">'font-family'</span></a> ] | caption | icon | menu | message-box | small-caption | status-bar | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>see individual properties
<td>&nbsp;
<td>yes
<td>see individual properties
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visudet.html#propdef-height"><span class="propinst-height xref">'height'</span></a>
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>auto
<td>all elements but non-replaced inline elements, table columns, and column groups
<td>no
<td>see prose
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visuren.html#propdef-left"><span class="propinst-left xref">'left'</span></a>
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>auto
<td>positioned elements
<td>no
<td>refer to width of containing block
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="text.html#propdef-letter-spacing"><span class="propinst-letter-spacing xref">'letter-spacing'</span></a>
<td>normal | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>normal
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visudet.html#propdef-line-height"><span class="propinst-line-height xref">'line-height'</span></a>
<td>normal | <a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number">&lt;number&gt;</span></a> | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>normal
<td>&nbsp;
<td>yes
<td>refer to the font size of the element itself
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="generate.html#propdef-list-style-image"><span class="propinst-list-style-image xref">'list-style-image'</span></a>
<td><a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri">&lt;uri&gt;</span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>none
<td>elements with 'display: list-item'
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="generate.html#propdef-list-style-position"><span class="propinst-list-style-position xref">'list-style-position'</span></a>
<td>inside | outside | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>outside
<td>elements with 'display: list-item'
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="generate.html#propdef-list-style-type"><span class="propinst-list-style-type xref">'list-style-type'</span></a>
<td>disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha | upper-alpha | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>disc
<td>elements with 'display: list-item'
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="generate.html#propdef-list-style"><span class="propinst-list-style xref">'list-style'</span></a>
<td>[ <a href="generate.html#propdef-list-style-type" class="noxref"><span class="propinst-list-style-type">'list-style-type'</span></a> || <a href="generate.html#propdef-list-style-position" class="noxref"><span class="propinst-list-style-position">'list-style-position'</span></a> || <a href="generate.html#propdef-list-style-image" class="noxref"><span class="propinst-list-style-image">'list-style-image'</span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>see individual properties
<td>elements with 'display: list-item'
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="box.html#propdef-margin-right"><span class="propinst-margin-right xref">'margin-right'</span></a>
<a href="box.html#propdef-margin-left"><span class="propinst-margin-left xref">'margin-left'</span></a>
<td><a href="box.html#value-def-margin-width" class="noxref"><span class="value-inst-margin-width">&lt;margin-width&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>0
<td>all elements except elements with table display types other than table-caption, table and inline-table
<td>no
<td>refer to width of containing block
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="box.html#propdef-margin-top"><span class="propinst-margin-top xref">'margin-top'</span></a>
<a href="box.html#propdef-margin-bottom"><span class="propinst-margin-bottom xref">'margin-bottom'</span></a>
<td><a href="box.html#value-def-margin-width" class="noxref"><span class="value-inst-margin-width">&lt;margin-width&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>0
<td>all elements except elements with table display types other than table-caption, table and inline-table
<td>no
<td>refer to width of containing block
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="box.html#propdef-margin"><span class="propinst-margin xref">'margin'</span></a>
<td><a href="box.html#value-def-margin-width" class="noxref"><span class="value-inst-margin-width">&lt;margin-width&gt;</span></a>{1,4} | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>see individual properties
<td>all elements except elements with table display types other than table-caption, table and inline-table
<td>no
<td>refer to width of containing block
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visudet.html#propdef-max-height"><span class="propinst-max-height xref">'max-height'</span></a>
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>none
<td>all elements but non-replaced inline elements, table columns, and column groups
<td>no
<td>see prose
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visudet.html#propdef-max-width"><span class="propinst-max-width xref">'max-width'</span></a>
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>none
<td>all elements but non-replaced inline elements, table rows, and row groups
<td>no
<td>refer to width of containing block
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visudet.html#propdef-min-height"><span class="propinst-min-height xref">'min-height'</span></a>
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>0
<td>all elements but non-replaced inline elements, table columns, and column groups
<td>no
<td>see prose
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visudet.html#propdef-min-width"><span class="propinst-min-width xref">'min-width'</span></a>
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>0
<td>all elements but non-replaced inline elements, table rows, and row groups
<td>no
<td>refer to width of containing block
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="page.html#propdef-orphans"><span class="propinst-orphans xref">'orphans'</span></a>
<td><a href="syndata.html#value-def-integer" class="noxref"><span class="value-inst-integer">&lt;integer&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>2
<td>block-level elements
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#paged-media-group">paged</a>
<tr><td><a href="ui.html#propdef-outline-color"><span class="propinst-outline-color xref">'outline-color'</span></a>
<td><a href="syndata.html#value-def-color" class="noxref"><span class="value-inst-color">&lt;color&gt;</span></a> | invert | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>invert
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#interactive-media-group">interactive</a>
<tr><td><a href="ui.html#propdef-outline-style"><span class="propinst-outline-style xref">'outline-style'</span></a>
<td><a href="box.html#value-def-border-style" class="noxref"><span class="value-inst-border-style">&lt;border-style&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>none
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#interactive-media-group">interactive</a>
<tr><td><a href="ui.html#propdef-outline-width"><span class="propinst-outline-width xref">'outline-width'</span></a>
<td><a href="box.html#value-def-border-width" class="noxref"><span class="value-inst-border-width">&lt;border-width&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>medium
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#interactive-media-group">interactive</a>
<tr><td><a href="ui.html#propdef-outline"><span class="propinst-outline xref">'outline'</span></a>
<td>[ <a href="ui.html#propdef-outline-color" class="noxref"><span class="propinst-outline-color">'outline-color'</span></a> || <a href="ui.html#propdef-outline-style" class="noxref"><span class="propinst-outline-style">'outline-style'</span></a> || <a href="ui.html#propdef-outline-width" class="noxref"><span class="propinst-outline-width">'outline-width'</span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>see individual properties
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#interactive-media-group">interactive</a>
<tr><td><a href="visufx.html#propdef-overflow"><span class="propinst-overflow xref">'overflow'</span></a>
<td>visible | hidden | scroll | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>visible
<td>non-replaced block-level elements, table cells, and inline-block elements
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="box.html#propdef-padding-top"><span class="propinst-padding-top xref">'padding-top'</span></a>
<a href="box.html#propdef-padding-right"><span class="propinst-padding-right xref">'padding-right'</span></a>
<a href="box.html#propdef-padding-bottom"><span class="propinst-padding-bottom xref">'padding-bottom'</span></a>
<a href="box.html#propdef-padding-left"><span class="propinst-padding-left xref">'padding-left'</span></a>
<td><a href="box.html#value-def-padding-width" class="noxref"><span class="value-inst-padding-width">&lt;padding-width&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>0
<td>all elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
<td>no
<td>refer to width of containing block
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="box.html#propdef-padding"><span class="propinst-padding xref">'padding'</span></a>
<td><a href="box.html#value-def-padding-width" class="noxref"><span class="value-inst-padding-width">&lt;padding-width&gt;</span></a>{1,4} | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>see individual properties
<td>all elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column
<td>no
<td>refer to width of containing block
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="page.html#propdef-page-break-after"><span class="propinst-page-break-after xref">'page-break-after'</span></a>
<td>auto | always | avoid | left | right | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>auto
<td>block-level elements
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#paged-media-group">paged</a>
<tr><td><a href="page.html#propdef-page-break-before"><span class="propinst-page-break-before xref">'page-break-before'</span></a>
<td>auto | always | avoid | left | right | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>auto
<td>block-level elements
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#paged-media-group">paged</a>
<tr><td><a href="page.html#propdef-page-break-inside"><span class="propinst-page-break-inside xref">'page-break-inside'</span></a>
<td>avoid | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>auto
<td>block-level elements
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#paged-media-group">paged</a>
<tr><td><a href="aural.html#propdef-pause-after"><span class="propinst-pause-after xref">'pause-after'</span></a>
<td><a href="aural.html#value-def-time" class="noxref"><span class="value-inst-time">&lt;time&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>0
<td>&nbsp;
<td>no
<td>see prose
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="aural.html#propdef-pause-before"><span class="propinst-pause-before xref">'pause-before'</span></a>
<td><a href="aural.html#value-def-time" class="noxref"><span class="value-inst-time">&lt;time&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>0
<td>&nbsp;
<td>no
<td>see prose
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="aural.html#propdef-pause"><span class="propinst-pause xref">'pause'</span></a>
<td>[ [<a href="aural.html#value-def-time" class="noxref"><span class="value-inst-time">&lt;time&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a>]{1,2} ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>see individual properties
<td>&nbsp;
<td>no
<td>see descriptions of 'pause-before' and 'pause-after'
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="aural.html#propdef-pitch-range"><span class="propinst-pitch-range xref">'pitch-range'</span></a>
<td><a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number">&lt;number&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>50
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="aural.html#propdef-pitch"><span class="propinst-pitch xref">'pitch'</span></a>
<td><a href="aural.html#value-def-frequency" class="noxref"><span class="value-inst-frequency">&lt;frequency&gt;</span></a> | x-low | low | medium | high | x-high | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>medium
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="aural.html#propdef-play-during"><span class="propinst-play-during xref">'play-during'</span></a>
<td><a href="syndata.html#value-def-uri" class="noxref"><span class="value-inst-uri">&lt;uri&gt;</span></a> [ mix || repeat ]? | auto | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>auto
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="visuren.html#propdef-position"><span class="propinst-position xref">'position'</span></a>
<td>static | relative | absolute | fixed | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>static
<td>&nbsp;
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="generate.html#propdef-quotes"><span class="propinst-quotes xref">'quotes'</span></a>
<td>[<a href="syndata.html#value-def-string" class="noxref"><span class="value-inst-string">&lt;string&gt;</span></a> <a href="syndata.html#value-def-string" class="noxref"><span class="value-inst-string">&lt;string&gt;</span></a>]+ | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>depends on user agent
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="aural.html#propdef-richness"><span class="propinst-richness xref">'richness'</span></a>
<td><a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number">&lt;number&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>50
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="visuren.html#propdef-right"><span class="propinst-right xref">'right'</span></a>
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>auto
<td>positioned elements
<td>no
<td>refer to width of containing block
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="aural.html#propdef-speak-header"><span class="propinst-speak-header xref">'speak-header'</span></a>
<td>once | always | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>once
<td>elements that have table header information
<td>yes
<td>&nbsp;
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="aural.html#propdef-speak-numeral"><span class="propinst-speak-numeral xref">'speak-numeral'</span></a>
<td>digits | continuous | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>continuous
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="aural.html#propdef-speak-punctuation"><span class="propinst-speak-punctuation xref">'speak-punctuation'</span></a>
<td>code | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>none
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="aural.html#propdef-speak"><span class="propinst-speak xref">'speak'</span></a>
<td>normal | none | spell-out | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>normal
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="aural.html#propdef-speech-rate"><span class="propinst-speech-rate xref">'speech-rate'</span></a>
<td><a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number">&lt;number&gt;</span></a> | x-slow | slow | medium | fast | x-fast | faster | slower | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>medium
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="aural.html#propdef-stress"><span class="propinst-stress xref">'stress'</span></a>
<td><a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number">&lt;number&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>50
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="tables.html#propdef-table-layout"><span class="propinst-table-layout xref">'table-layout'</span></a>
<td>auto | fixed | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>auto
<td>'table' and 'inline-table' elements
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="text.html#propdef-text-align"><span class="propinst-text-align xref">'text-align'</span></a>
<td>left | right | center | justify | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>a nameless value that acts as 'left' if 'direction' is 'ltr', 'right' if 'direction' is 'rtl'
<td>block-level elements, table cells and inline blocks
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="text.html#propdef-text-decoration"><span class="propinst-text-decoration xref">'text-decoration'</span></a>
<td>none | [ underline || overline || line-through || blink ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>none
<td>&nbsp;
<td>no (see prose)
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="text.html#propdef-text-indent"><span class="propinst-text-indent xref">'text-indent'</span></a>
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>0
<td>block-level elements, table cells and inline blocks
<td>yes
<td>refer to width of containing block
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="text.html#propdef-text-transform"><span class="propinst-text-transform xref">'text-transform'</span></a>
<td>capitalize | uppercase | lowercase | none | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>none
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visuren.html#propdef-top"><span class="propinst-top xref">'top'</span></a>
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>auto
<td>positioned elements
<td>no
<td>refer to height of containing block
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visuren.html#propdef-unicode-bidi"><span class="propinst-unicode-bidi xref">'unicode-bidi'</span></a>
<td>normal | embed | bidi-override | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>normal
<td>all elements, but see prose
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visudet.html#propdef-vertical-align"><span class="propinst-vertical-align xref">'vertical-align'</span></a>
<td>baseline | sub | super | top | text-top | middle | bottom | text-bottom | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>baseline
<td>inline-level and 'table-cell' elements
<td>no
<td>refer to the 'line-height' of the element itself
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visufx.html#propdef-visibility"><span class="propinst-visibility xref">'visibility'</span></a>
<td>visible | hidden | collapse | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>visible
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="aural.html#propdef-voice-family"><span class="propinst-voice-family xref">'voice-family'</span></a>
<td>[[<a href="aural.html#value-def-specific-voice" class="noxref"><span class="value-inst-specific-voice">&lt;specific-voice&gt;</span></a> | <a href="aural.html#value-def-generic-voice" class="noxref"><span class="value-inst-generic-voice">&lt;generic-voice&gt;</span></a> ],]* [<a href="aural.html#value-def-specific-voice" class="noxref"><span class="value-inst-specific-voice">&lt;specific-voice&gt;</span></a> | <a href="aural.html#value-def-generic-voice" class="noxref"><span class="value-inst-generic-voice">&lt;generic-voice&gt;</span></a> ] | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>depends on user agent
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="aural.html#propdef-volume"><span class="propinst-volume xref">'volume'</span></a>
<td><a href="syndata.html#value-def-number" class="noxref"><span class="value-inst-number">&lt;number&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | silent | x-soft | soft | medium | loud | x-loud | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>medium
<td>&nbsp;
<td>yes
<td>refer to inherited value
<td><a href="aural.html#aural-media-group">aural</a>
<tr><td><a href="text.html#propdef-white-space"><span class="propinst-white-space xref">'white-space'</span></a>
<td>normal | pre | nowrap | pre-wrap | pre-line | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>normal
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="page.html#propdef-widows"><span class="propinst-widows xref">'widows'</span></a>
<td><a href="syndata.html#value-def-integer" class="noxref"><span class="value-inst-integer">&lt;integer&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>2
<td>block-level elements
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>, <a href="media.html#paged-media-group">paged</a>
<tr><td><a href="visudet.html#propdef-width"><span class="propinst-width xref">'width'</span></a>
<td><a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | <a href="syndata.html#value-def-percentage" class="noxref"><span class="value-inst-percentage">&lt;percentage&gt;</span></a> | auto | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>auto
<td>all elements but non-replaced inline elements, table rows, and row groups
<td>no
<td>refer to width of containing block
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="text.html#propdef-word-spacing"><span class="propinst-word-spacing xref">'word-spacing'</span></a>
<td>normal | <a href="syndata.html#value-def-length" class="noxref"><span class="value-inst-length">&lt;length&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>normal
<td>&nbsp;
<td>yes
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
<tr><td><a href="visuren.html#propdef-z-index"><span class="propinst-z-index xref">'z-index'</span></a>
<td>auto | <a href="syndata.html#value-def-integer" class="noxref"><span class="value-inst-integer">&lt;integer&gt;</span></a> | <a href="cascade.html#value-def-inherit" class="noxref"><span class="value-inst-inherit">inherit</span></a>
<td>auto
<td>positioned elements
<td>no
<td>&nbsp;
<td><a href="media.html#visual-media-group">visual</a>
</table>
<hr class="navbar">
<div class="navbar">
<p><a href="zindex.html">previous</a> &nbsp;
<a href="grammar.html">next</a> &nbsp;
<a href="cover.html#minitoc">contents</a> &nbsp;
<a href="propidx.html">properties</a> &nbsp;
<a href="indexlist.html">index</a> &nbsp;
</div>
</BODY>
</HTML>

View File

@ -1 +0,0 @@
{ "row": [ { "class": "W", "default": "center\n" }, { "class": "W", "default": "scroll\n" }, { "class": "W", "default": "transparent\n" }, { "class": "W", "default": "none\n" }, { "class": "W", "default": "0% 0%\n" }, { "class": "W", "default": "repeat\n" }, { "class": "W", "default": "see individual properties\n" }, { "class": "W", "default": "separate\n" }, { "class": "W", "default": "see individual properties\n" }, { "class": "W", "default": "0\n" }, { "class": "W", "default": "see individual properties\n" }, { "class": "W", "default": "see individual properties\n" }, { "class": "W", "default": "the value of the 'color' property\n" }, { "class": "W", "default": "none\n" }, { "class": "W", "default": "medium\n" }, { "class": "W", "default": "see individual properties\n" }, { "class": "W", "default": "see individual properties\n" }, { "class": "W", "default": "auto\n" }, { "class": "W", "default": "top\n" }, { "class": "W", "default": "none\n" }, { "class": "W", "default": "auto\n" }, { "class": "W", "default": "depends on user agent\n" }, { "class": "W", "default": "normal\n" }, { "class": "W", "default": "none\n" }, { "class": "W", "default": "none\n" }, { "class": "W", "default": "none\n" }, { "class": "W", "default": "none\n" }, { "class": "W", "default": "see individual properties\n" }, { "class": "W", "default": "auto\n" }, { "class": "W", "default": "ltr\n" }, { "class": "W", "default": "inline\n" }, { "class": "W", "default": "level\n" }, { "class": "W", "default": "show\n" }, { "class": "W", "default": "none\n" }, { "class": "W", "default": "depends on user agent\n" }, { "class": "W", "default": "medium\n" }, { "class": "W", "default": "normal\n" }, { "class": "W", "default": "normal\n" }, { "class": "W", "default": "normal\n" }, { "class": "W", "default": "see individual properties\n" }, { "class": "W", "default": "auto\n" }, { "class": "W", "default": "auto\n" }, { "class": "W", "default": "normal\n" }, { "class": "W", "default": "normal\n" }, { "class": "W", "default": "none\n" }, { "class": "W", "default": "outside\n" }, { "class": "W", "default": "disc\n" }, { "class": "W", "default": "see individual properties\n" }, { "class": "W", "default": "0\n" }, { "class": "W", "default": "0\n" }, { "class": "W", "default": "see individual properties\n" }, { "class": "W", "default": "none\n" }, { "class": "W", "default": "none\n" }, { "class": "W", "default": "0\n" }, { "class": "W", "default": "0\n" }, { "class": "W", "default": "2\n" }, { "class": "W", "default": "invert\n" }, { "class": "W", "default": "none\n" }, { "class": "W", "default": "medium\n" }, { "class": "W", "default": "see individual properties\n" }, { "class": "W", "default": "visible\n" }, { "class": "W", "default": "0\n" }, { "class": "W", "default": "see individual properties\n" }, { "class": "W", "default": "auto\n" }, { "class": "W", "default": "auto\n" }, { "class": "W", "default": "auto\n" }, { "class": "W", "default": "0\n" }, { "class": "W", "default": "0\n" }, { "class": "W", "default": "see individual properties\n" }, { "class": "W", "default": "50\n" }, { "class": "W", "default": "medium\n" }, { "class": "W", "default": "auto\n" }, { "class": "W", "default": "static\n" }, { "class": "W", "default": "depends on user agent\n" }, { "class": "W", "default": "50\n" }, { "class": "W", "default": "auto\n" }, { "class": "W", "default": "once\n" }, { "class": "W", "default": "continuous\n" }, { "class": "W", "default": "none\n" }, { "class": "W", "default": "normal\n" }, { "class": "W", "default": "medium\n" }, { "class": "W", "default": "50\n" }, { "class": "W", "default": "auto\n" }, { "class": "W", "default": "a nameless value that acts as 'left' if 'direction' is 'ltr', 'right' if 'direction' is 'rtl'\n" }, { "class": "W", "default": "none\n" }, { "class": "W", "default": "0\n" }, { "class": "W", "default": "none\n" }, { "class": "W", "default": "auto\n" }, { "class": "W", "default": "normal\n" }, { "class": "W", "default": "baseline\n" }, { "class": "W", "default": "visible\n" }, { "class": "W", "default": "depends on user agent\n" }, { "class": "W", "default": "medium\n" }, { "class": "W", "default": "normal\n" }, { "class": "W", "default": "2\n" }, { "class": "W", "default": "auto\n" }, { "class": "W", "default": "normal\n" }, { "class": "W", "default": "auto\n" } ] }

View File

@ -1,8 +0,0 @@
{
"row(tr)": [
{
"class": "sfdsadsfd:rfsdaeplace(td:nth-child(1), 'w', 'W')",
"default": "td:nth-child(3)"
}
]
}

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
{
"name": "h1",
"phone": "#bizPhone",
"address": "address",
"reviews(.nonfavoriteReview)": [

View File

@ -1 +0,0 @@
{ "matches": [ { "a": "no", "b": "no", "c": "no", "d": "no" }, { "a": "no", "b": "noOo", "c": "no", "d": "noOo" }, { "a": "nooo", "b": "nooo", "c": "nooo", "d": "nooo" }, { "a": "no", "b": "noOo", "c": "no", "d": "noOo" }, { "a": "no", "b": "no", "c": "no", "d": "no" }, { "a": "no", "b": "no", "c": "no", "d": "no" } ] }

View File

@ -1,8 +0,0 @@
{
"matches(c)": [{
"a": "regexp:match(., 'no+')",
"b": "regexp:match(., 'no+', 'i')",
"c": "regexp:match(., 'no+', 'g')",
"d": "regexp:match(., 'no+', 'gi')"
}]
}

View File

@ -1,11 +0,0 @@
<?xml version="1.0"?>
<a>
<c>n</c>
<c>no spot no</c>
<c>nO</c>
<c>noOo spot stop</c>
<c>stop nooo</c>
<c>xnoOox</c>
<c>non no n</c>
<c>none</c>
</a>

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
{ "title": "Nick's Crispy Tacos - Russian Hill - San Francisco, CA" }

View File

@ -1,8 +0,0 @@
{
"title?": "//title",
"foo?": ["//omg"],
"bar?": "//omg",
"ba?": {
"linky": "wtf"
}
}

View File

@ -1,8 +0,0 @@
<html>
<body>
<a>1</a>
<a>2</a>
<a>3</a>
<a>4</a>
</body>
</html>

View File

@ -1 +0,0 @@
{ "string": [ "1", "2", "3", "4" ], "object": [ { "position": "1" }, { "position": "2" }, { "position": "3" }, { "position": "4" } ] }

View File

@ -1,6 +0,0 @@
{
"string(a)": ["position()"],
"object(a)": [{
"position": "position()"
}]
}

View File

@ -1,3 +0,0 @@
<html>
<body>Doesn't matter</body>
</html>

View File

@ -1 +0,0 @@
{ "title": "Google" }

View File

@ -1,4 +0,0 @@
{
"title": "html('http://www.google.com/')//title"
}

Some files were not shown because too many files have changed in this diff Show More