The css-selectors Reference Manual

This is the css-selectors Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 16:10:04 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 css-selectors

An implementation of css selectors

Author

<>

License

BSD

Dependencies
  • iterate (system).
  • yacc (system).
  • cl-ppcre (system).
  • buildnode (system).
  • alexandria (system).
  • cxml (system).
  • cl-interpol (system).
  • symbol-munger (system).
Source

css-selectors.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 css-selectors/src

Source

css-selectors.asd.

Parent Component

css-selectors (system).

Child Components

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 css-selectors/css-selectors.asd

Source

css-selectors.asd.

Parent Component

css-selectors (system).

ASDF Systems

css-selectors.

Packages

net.acceleration.css-selectors.system.


4.1.2 css-selectors/src/packages.lisp

Source

css-selectors.asd.

Parent Component

src (module).

Packages

4.1.3 css-selectors/src/node-api.lisp

Dependency

packages.lisp (file).

Source

css-selectors.asd.

Parent Component

src (module).

Internals

4.1.4 css-selectors/src/parse.lisp

Dependency

node-api.lisp (file).

Source

css-selectors.asd.

Parent Component

src (module).

Public Interface

parse-results (function).

Internals

4.1.5 css-selectors/src/pseudo.lisp

Dependency

parse.lisp (file).

Source

css-selectors.asd.

Parent Component

src (module).

Public Interface

4.1.6 css-selectors/src/compile.lisp

Dependency

pseudo.lisp (file).

Source

css-selectors.asd.

Parent Component

src (module).

Public Interface
Internals

4.1.7 css-selectors/src/dom.lisp

Dependency

compile.lisp (file).

Source

css-selectors.asd.

Parent Component

src (module).

Internals

5 Packages

Packages are listed by definition order.


5.1 css-selectors

Source

packages.lisp.

Nickname

css

Use List
  • common-lisp.
  • iterate.
Used By List

css-selectors.pseudo.

Public Interface
Internals

5.2 net.acceleration.css-selectors.system

Source

css-selectors.asd.

Use List
  • asdf/interface.
  • common-lisp.

5.3 css-selectors.pseudo

Source

packages.lisp.

Nickname

pseudo

Use List
Public Interface

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Compiler macros

Compiler Macro: node-matches? (node inp)
Package

css-selectors.

Source

compile.lisp.

Compiler Macro: query (inp &optional trees)
Package

css-selectors.

Source

compile.lisp.

Compiler Macro: query1 (inp &optional trees)
Package

css-selectors.

Source

compile.lisp.


6.1.2 Ordinary functions

Function: compile-css-node-matcher (inp)

Given a string, returns a matcher-function of a single node that will tell you whether or not the node matches

Package

css-selectors.

Source

compile.lisp.

Function: empty (node &optional sub-sel-function)
Package

css-selectors.pseudo.

Source

pseudo.lisp.

Function: first-child (node &optional sub-sel-function)
Package

css-selectors.pseudo.

Source

pseudo.lisp.

Function: has (node &optional sub-sel-function)
Package

css-selectors.pseudo.

Source

pseudo.lisp.

Function: is (node &optional sub-sel-function)
Package

css-selectors.pseudo.

Source

pseudo.lisp.

Function: last-child (node &optional sub-sel-function)
Package

css-selectors.pseudo.

Source

pseudo.lisp.

Function: node-matches? (node inp)

Given a node and a CSS selector, see if the given node matches that selector

Package

css-selectors.

Source

compile.lisp.

Function: not (node &optional sub-sel-function)
Package

css-selectors.pseudo.

Source

pseudo.lisp.

Function: nth-child (node mul add)
Package

css-selectors.pseudo.

Source

pseudo.lisp.

Function: nth-last-child (node mul add)
Package

css-selectors.pseudo.

Source

pseudo.lisp.

Function: only-child (node &optional sub-sel-function)
Package

css-selectors.pseudo.

Source

pseudo.lisp.

Function: parse-results (&optional inp)

Mostly used for debugging purposes

Takes a string CSS selector and turns it into an AST

Package

css-selectors.

Source

parse.lisp.

Function: query (inp &optional trees)

Given a css selector, attempt to find the matching nodes in the passed in dom-trees (defaults to the document)

Package

css-selectors.

Source

compile.lisp.

Function: query1 (inp &optional trees)

Given a css selector, attempt to find the first matching node in the passed in dom-trees (defaults to the document)

Package

css-selectors.

Source

compile.lisp.

Function: root (node &optional sub-sel-function)
Package

css-selectors.pseudo.

Source

pseudo.lisp.


6.2 Internals


6.2.1 Special variables

Special Variable: *css3-selector-parser*
Package

css-selectors.

Source

parse.lisp.

Special Variable: *ignore-namespaces*

ignore tag name spaces when matching, for now the parser
doesnt support parsing namespaced tags, so lets ignore tag namespaces

Package

css-selectors.

Source

compile.lisp.

Special Variable: +common-white-space-trimbag+
Package

css-selectors.

Source

parse.lisp.

Special Variable: +css3-lex-productions+
Package

css-selectors.

Source

parse.lisp.

Special Variable: +end-of-defs+
Package

css-selectors.

Source

parse.lisp.

Special Variable: +option+
Package

css-selectors.

Source

parse.lisp.

Special Variable: +option-case-insensitive+
Package

css-selectors.

Source

parse.lisp.

Special Variable: +return-value+
Package

css-selectors.

Source

parse.lisp.


6.2.2 Macros

Macro: lam (args &body body)
Package

css-selectors.

Source

parse.lisp.

Macro: rule (args &body body)
Package

css-selectors.

Source

parse.lisp.

Macro: rule-set (name &body rules)
Package

css-selectors.

Source

parse.lisp.


6.2.3 Ordinary functions

Function: %node-matches? (node inp)
Package

css-selectors.

Source

compile.lisp.

Function: %query (inp &optional trees)
Package

css-selectors.

Source

compile.lisp.

Function: %query1 (inp &optional trees)
Package

css-selectors.

Source

compile.lisp.

Function: %rule (args body)
Package

css-selectors.

Source

parse.lisp.

Function: %rule-set (name rules)
Package

css-selectors.

Source

parse.lisp.

Function: all-group-matches-as-string (regex target)

Expects a single matching group

Package

css-selectors.

Source

parse.lisp.

Function: arg-list-var-names (args)
Package

css-selectors.

Source

parse.lisp.

Function: attrib-includes? (node attrib value)
Package

css-selectors.

Source

compile.lisp.

Function: but-first (s)
Package

css-selectors.

Source

parse.lisp.

Function: but-last (s)
Package

css-selectors.

Source

parse.lisp.

Function: but-quotes (s)
Package

css-selectors.

Source

parse.lisp.

Function: dos-safe-read-line (stream &optional eof-error-p eof-value recursive-p)

readline that can read unix or dos lines

Package

css-selectors.

Source

parse.lisp.

Function: expand-return-value (rtn)
Package

css-selectors.

Source

parse.lisp.

Function: handle-quoted-rules (production)

quotes in flex productions should be direct string matches

Package

css-selectors.

Source

parse.lisp.

Function: is-special? (s)
Package

css-selectors.

Source

parse.lisp.

Function: keywordize (s)
Package

css-selectors.

Source

parse.lisp.

Function: lex-results (&optional inp)
Package

css-selectors.

Source

parse.lisp.

Function: make-and-matcher (forms)
Package

css-selectors.

Source

compile.lisp.

Function: make-attrib-matcher (attrib match-type match-to)

attrib-matcher

Package

css-selectors.

Source

compile.lisp.

Function: make-child-matcher (parent-matcher child-matcher)
Package

css-selectors.

Source

compile.lisp.

Function: make-class-matcher (class)
Package

css-selectors.

Source

compile.lisp.

Function: make-css3-lexer (inp)
Package

css-selectors.

Source

parse.lisp.

Function: make-elt-matcher (tag)
Package

css-selectors.

Source

compile.lisp.

Function: make-hash-matcher (id)
Package

css-selectors.

Source

compile.lisp.

Function: make-immediate-child-matcher (parent-matcher child-matcher)
Package

css-selectors.

Source

compile.lisp.

Function: make-immediatly-preceded-by-matcher (this-matcher sibling-matcher)
Package

css-selectors.

Source

compile.lisp.

Function: make-matcher-aux (tree)
Package

css-selectors.

Source

compile.lisp.

Function: make-node-matcher (expression)
Package

css-selectors.

Source

compile.lisp.

Function: make-nth-pseudo-matcher (pseudo mul add)
Package

css-selectors.

Source

compile.lisp.

Function: make-or-matcher (forms)
Package

css-selectors.

Source

compile.lisp.

Function: make-preceded-by-matcher (this-matcher sibling-matcher)
Package

css-selectors.

Source

compile.lisp.

Function: make-pseudo-matcher (pseudo submatcher)
Package

css-selectors.

Source

compile.lisp.

Function: read-flex-file (file)
Package

css-selectors.

Source

parse.lisp.

Function: replace-all (string part replacement &key test stream)

Returns a new string in which all the occurences of the part
is replaced with replacement. [FROM http://cl-cookbook.sourceforge.net/strings.html#manip]

Package

css-selectors.

Source

parse.lisp.

Function: replace-expansions (defs new-regex)
Package

css-selectors.

Source

parse.lisp.

Function: string-upcase? (s)
Package

css-selectors.

Source

parse.lisp.

Function: symbolize (s)
Package

css-selectors.

Source

parse.lisp.

Function: til-open (s)
Package

css-selectors.

Source

parse.lisp.

Function: trim-and-nullify (s)

trims the whitespace from a string returning nil
if trimming produces an empty string or the string ’nil’

Package

css-selectors.

Source

parse.lisp.

Function: trim-whitespace (s)
Package

css-selectors.

Source

parse.lisp.

Function: uniquify-and-reintern (x &optional package)
Package

css-selectors.

Source

parse.lisp.


6.2.4 Generic functions

Generic Function: %do-query (matcher node &key first?)

matches selector inp against the node
if first? is T then return the first matching node

Package

css-selectors.

Source

compile.lisp.

Methods
Method: %do-query (matcher (elt node) &key first?)
Source

dom.lisp.

Generic Function: child-elements (node)

Returns all child elements of this node

Package

css-selectors.

Source

node-api.lisp.

Methods
Method: child-elements ((n node))
Source

dom.lisp.

Generic Function: child-nodes (node)

Returns all child nodes of this node

Package

css-selectors.

Source

node-api.lisp.

Methods
Method: child-nodes ((n node))
Source

dom.lisp.

Generic Function: document-of (node)

Returns the document of the given node

Package

css-selectors.

Source

node-api.lisp.

Methods
Method: document-of ((n node))
Source

dom.lisp.

Generic Function: element-p (node)

Is this an element

Package

css-selectors.

Source

node-api.lisp.

Methods
Method: element-p ((elt element))
Source

dom.lisp.

Method: element-p (elt)
Generic Function: get-attribute (node attrib)

retrieves the value of a given attribute of the node

Package

css-selectors.

Source

node-api.lisp.

Methods
Method: get-attribute ((elt element) attrib)
Source

dom.lisp.

Generic Function: parent-element (node)

returns the parent element of this node

Package

css-selectors.

Source

node-api.lisp.

Methods
Method: parent-element (n)
Generic Function: parent-elements (node)

Returns all parent elements of this node

Package

css-selectors.

Source

node-api.lisp.

Methods
Method: parent-elements (node)
Generic Function: parent-node (node)

returns the parent node of this node

Package

css-selectors.

Source

node-api.lisp.

Methods
Method: parent-node ((n node))
Source

dom.lisp.

Generic Function: previous-sibling (node)

returns the parent element of this node

Package

css-selectors.

Source

node-api.lisp.

Methods
Method: previous-sibling ((n element))

gets the parent dom:element (rather than ever returning the document node)

Source

dom.lisp.

Generic Function: tag-name (elt)

retrieves the name of the given element

Package

css-selectors.

Source

node-api.lisp.

Methods
Method: tag-name ((elt element))
Source

dom.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %  
A   B   C   D   E   F   G   H   I   K   L   M   N   O   P   Q   R   S   T   U  
Index Entry  Section

%
%do-query: Private generic functions
%do-query: Private generic functions
%node-matches?: Private ordinary functions
%query: Private ordinary functions
%query1: Private ordinary functions
%rule: Private ordinary functions
%rule-set: Private ordinary functions

A
all-group-matches-as-string: Private ordinary functions
arg-list-var-names: Private ordinary functions
attrib-includes?: Private ordinary functions

B
but-first: Private ordinary functions
but-last: Private ordinary functions
but-quotes: Private ordinary functions

C
child-elements: Private generic functions
child-elements: Private generic functions
child-nodes: Private generic functions
child-nodes: Private generic functions
compile-css-node-matcher: Public ordinary functions
Compiler Macro, node-matches?: Public compiler macros
Compiler Macro, query: Public compiler macros
Compiler Macro, query1: Public compiler macros

D
document-of: Private generic functions
document-of: Private generic functions
dos-safe-read-line: Private ordinary functions

E
element-p: Private generic functions
element-p: Private generic functions
element-p: Private generic functions
empty: Public ordinary functions
expand-return-value: Private ordinary functions

F
first-child: Public ordinary functions
Function, %node-matches?: Private ordinary functions
Function, %query: Private ordinary functions
Function, %query1: Private ordinary functions
Function, %rule: Private ordinary functions
Function, %rule-set: Private ordinary functions
Function, all-group-matches-as-string: Private ordinary functions
Function, arg-list-var-names: Private ordinary functions
Function, attrib-includes?: Private ordinary functions
Function, but-first: Private ordinary functions
Function, but-last: Private ordinary functions
Function, but-quotes: Private ordinary functions
Function, compile-css-node-matcher: Public ordinary functions
Function, dos-safe-read-line: Private ordinary functions
Function, empty: Public ordinary functions
Function, expand-return-value: Private ordinary functions
Function, first-child: Public ordinary functions
Function, handle-quoted-rules: Private ordinary functions
Function, has: Public ordinary functions
Function, is: Public ordinary functions
Function, is-special?: Private ordinary functions
Function, keywordize: Private ordinary functions
Function, last-child: Public ordinary functions
Function, lex-results: Private ordinary functions
Function, make-and-matcher: Private ordinary functions
Function, make-attrib-matcher: Private ordinary functions
Function, make-child-matcher: Private ordinary functions
Function, make-class-matcher: Private ordinary functions
Function, make-css3-lexer: Private ordinary functions
Function, make-elt-matcher: Private ordinary functions
Function, make-hash-matcher: Private ordinary functions
Function, make-immediate-child-matcher: Private ordinary functions
Function, make-immediatly-preceded-by-matcher: Private ordinary functions
Function, make-matcher-aux: Private ordinary functions
Function, make-node-matcher: Private ordinary functions
Function, make-nth-pseudo-matcher: Private ordinary functions
Function, make-or-matcher: Private ordinary functions
Function, make-preceded-by-matcher: Private ordinary functions
Function, make-pseudo-matcher: Private ordinary functions
Function, node-matches?: Public ordinary functions
Function, not: Public ordinary functions
Function, nth-child: Public ordinary functions
Function, nth-last-child: Public ordinary functions
Function, only-child: Public ordinary functions
Function, parse-results: Public ordinary functions
Function, query: Public ordinary functions
Function, query1: Public ordinary functions
Function, read-flex-file: Private ordinary functions
Function, replace-all: Private ordinary functions
Function, replace-expansions: Private ordinary functions
Function, root: Public ordinary functions
Function, string-upcase?: Private ordinary functions
Function, symbolize: Private ordinary functions
Function, til-open: Private ordinary functions
Function, trim-and-nullify: Private ordinary functions
Function, trim-whitespace: Private ordinary functions
Function, uniquify-and-reintern: Private ordinary functions

G
Generic Function, %do-query: Private generic functions
Generic Function, child-elements: Private generic functions
Generic Function, child-nodes: Private generic functions
Generic Function, document-of: Private generic functions
Generic Function, element-p: Private generic functions
Generic Function, get-attribute: Private generic functions
Generic Function, parent-element: Private generic functions
Generic Function, parent-elements: Private generic functions
Generic Function, parent-node: Private generic functions
Generic Function, previous-sibling: Private generic functions
Generic Function, tag-name: Private generic functions
get-attribute: Private generic functions
get-attribute: Private generic functions

H
handle-quoted-rules: Private ordinary functions
has: Public ordinary functions

I
is: Public ordinary functions
is-special?: Private ordinary functions

K
keywordize: Private ordinary functions

L
lam: Private macros
last-child: Public ordinary functions
lex-results: Private ordinary functions

M
Macro, lam: Private macros
Macro, rule: Private macros
Macro, rule-set: Private macros
make-and-matcher: Private ordinary functions
make-attrib-matcher: Private ordinary functions
make-child-matcher: Private ordinary functions
make-class-matcher: Private ordinary functions
make-css3-lexer: Private ordinary functions
make-elt-matcher: Private ordinary functions
make-hash-matcher: Private ordinary functions
make-immediate-child-matcher: Private ordinary functions
make-immediatly-preceded-by-matcher: Private ordinary functions
make-matcher-aux: Private ordinary functions
make-node-matcher: Private ordinary functions
make-nth-pseudo-matcher: Private ordinary functions
make-or-matcher: Private ordinary functions
make-preceded-by-matcher: Private ordinary functions
make-pseudo-matcher: Private ordinary functions
Method, %do-query: Private generic functions
Method, child-elements: Private generic functions
Method, child-nodes: Private generic functions
Method, document-of: Private generic functions
Method, element-p: Private generic functions
Method, element-p: Private generic functions
Method, get-attribute: Private generic functions
Method, parent-element: Private generic functions
Method, parent-elements: Private generic functions
Method, parent-node: Private generic functions
Method, previous-sibling: Private generic functions
Method, tag-name: Private generic functions

N
node-matches?: Public compiler macros
node-matches?: Public ordinary functions
not: Public ordinary functions
nth-child: Public ordinary functions
nth-last-child: Public ordinary functions

O
only-child: Public ordinary functions

P
parent-element: Private generic functions
parent-element: Private generic functions
parent-elements: Private generic functions
parent-elements: Private generic functions
parent-node: Private generic functions
parent-node: Private generic functions
parse-results: Public ordinary functions
previous-sibling: Private generic functions
previous-sibling: Private generic functions

Q
query: Public compiler macros
query: Public ordinary functions
query1: Public compiler macros
query1: Public ordinary functions

R
read-flex-file: Private ordinary functions
replace-all: Private ordinary functions
replace-expansions: Private ordinary functions
root: Public ordinary functions
rule: Private macros
rule-set: Private macros

S
string-upcase?: Private ordinary functions
symbolize: Private ordinary functions

T
tag-name: Private generic functions
tag-name: Private generic functions
til-open: Private ordinary functions
trim-and-nullify: Private ordinary functions
trim-whitespace: Private ordinary functions

U
uniquify-and-reintern: Private ordinary functions


A.4 Data types

Jump to:   C   D   F   M   N   P   S  
Index Entry  Section

C
compile.lisp: The css-selectors/src/compile․lisp file
css-selectors: The css-selectors system
css-selectors: The css-selectors package
css-selectors.asd: The css-selectors/css-selectors․asd file
css-selectors.pseudo: The css-selectors․pseudo package

D
dom.lisp: The css-selectors/src/dom․lisp file

F
File, compile.lisp: The css-selectors/src/compile․lisp file
File, css-selectors.asd: The css-selectors/css-selectors․asd file
File, dom.lisp: The css-selectors/src/dom․lisp file
File, node-api.lisp: The css-selectors/src/node-api․lisp file
File, packages.lisp: The css-selectors/src/packages․lisp file
File, parse.lisp: The css-selectors/src/parse․lisp file
File, pseudo.lisp: The css-selectors/src/pseudo․lisp file

M
Module, src: The css-selectors/src module

N
net.acceleration.css-selectors.system: The net․acceleration․css-selectors․system package
node-api.lisp: The css-selectors/src/node-api․lisp file

P
Package, css-selectors: The css-selectors package
Package, css-selectors.pseudo: The css-selectors․pseudo package
Package, net.acceleration.css-selectors.system: The net․acceleration․css-selectors․system package
packages.lisp: The css-selectors/src/packages․lisp file
parse.lisp: The css-selectors/src/parse․lisp file
pseudo.lisp: The css-selectors/src/pseudo․lisp file

S
src: The css-selectors/src module
System, css-selectors: The css-selectors system