File: selector.e

package info (click to toggle)
html-xml-utils 6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,620 kB
  • sloc: ansic: 10,027; sh: 2,135; lex: 189; yacc: 125; perl: 123; makefile: 122
file content (31 lines) | stat: -rw-r--r-- 795 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
 typedef enum {
  Root, NthChild, NthOfType, FirstChild, FirstOfType, Lang
} PseudoType;
 typedef struct _PseudoCond {
  PseudoType type;
  int a, b;
  string s;
  struct _PseudoCond *next;
} PseudoCond;
 typedef enum {
  Exists, Equals, Includes, StartsWith, EndsWidth, 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;
  Combinator combinator;
  struct _SimpleSelector *context;
} SimpleSelector, *Selector;
 string selector_to_string(const Selector selector);
 Selector parse_selector(const string selector);