File: selector.e

package info (click to toggle)
html-xml-utils 7.7-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 2,488 kB
  • sloc: ansic: 11,213; sh: 7,996; lex: 243; makefile: 193; yacc: 125
file content (39 lines) | stat: -rw-r--r-- 1,075 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
typedef enum {
  AttrNode,
  RootSel, NthChild, NthOfType, FirstChild, FirstOfType, Lang,
  NthLastChild, NthLastOfType, LastChild, LastOfType, OnlyChild,
  OnlyOfType, Empty,
  Not,
} PseudoType;
typedef struct _PseudoCond {
  PseudoType type;
  int a, b;
  string s;
  struct _SimpleSelector *sel;
  struct _PseudoCond *next;
} PseudoCond;
typedef enum {
  Exists, Equals, Includes, StartsWith, EndsWith, Contains, LangMatch,
  HasClass, HasID
} Operator;
typedef struct _AttribCond {
  Operator op;
  string name;
  string value;
  struct _AttribCond *next;
} AttribCond;
typedef enum {
  Descendant, Child, Adjacent, Sibling
} Combinator;
typedef struct _SimpleSelector {
  string name;
  AttribCond *attribs;
  PseudoCond *pseudos;
  PseudoCond *pseudoelts;
  Combinator combinator;
  struct _SimpleSelector *context;
  struct _SimpleSelector *next;
} SimpleSelector, *Selector;
extern Selector parse_selector(const string selector, string *rest);
extern void dump_simple_selector(FILE *f, const SimpleSelector *s);
extern void dump_selector(FILE *f, const Selector s);