Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
sre_constants Namespace Reference

Data Structures

class  error
 

Functions

def makedict
 
def dump
 

Variables

int MAGIC = 20010701
 
int MAXREPEAT = 65535
 
string FAILURE = "failure"
 
string SUCCESS = "success"
 
string ANY = "any"
 
string ANY_ALL = "any_all"
 
string ASSERT = "assert"
 
string ASSERT_NOT = "assert_not"
 
string AT = "at"
 
string BIGCHARSET = "bigcharset"
 
string BRANCH = "branch"
 
string CALL = "call"
 
string CATEGORY = "category"
 
string CHARSET = "charset"
 
string GROUPREF = "groupref"
 
string GROUPREF_IGNORE = "groupref_ignore"
 
string IN = "in"
 
string IN_IGNORE = "in_ignore"
 
string INFO = "info"
 
string JUMP = "jump"
 
string LITERAL = "literal"
 
string LITERAL_IGNORE = "literal_ignore"
 
string MARK = "mark"
 
string MAX_REPEAT = "max_repeat"
 
string MAX_UNTIL = "max_until"
 
string MIN_REPEAT = "min_repeat"
 
string MIN_UNTIL = "min_until"
 
string NEGATE = "negate"
 
string NOT_LITERAL = "not_literal"
 
string NOT_LITERAL_IGNORE = "not_literal_ignore"
 
string RANGE = "range"
 
string REPEAT = "repeat"
 
string REPEAT_ONE = "repeat_one"
 
string SUBPATTERN = "subpattern"
 
string AT_BEGINNING = "at_beginning"
 
string AT_BEGINNING_LINE = "at_beginning_line"
 
string AT_BEGINNING_STRING = "at_beginning_string"
 
string AT_BOUNDARY = "at_boundary"
 
string AT_NON_BOUNDARY = "at_non_boundary"
 
string AT_END = "at_end"
 
string AT_END_LINE = "at_end_line"
 
string AT_END_STRING = "at_end_string"
 
string AT_LOC_BOUNDARY = "at_loc_boundary"
 
string AT_LOC_NON_BOUNDARY = "at_loc_non_boundary"
 
string AT_UNI_BOUNDARY = "at_uni_boundary"
 
string AT_UNI_NON_BOUNDARY = "at_uni_non_boundary"
 
string CATEGORY_DIGIT = "category_digit"
 
string CATEGORY_NOT_DIGIT = "category_not_digit"
 
string CATEGORY_SPACE = "category_space"
 
string CATEGORY_NOT_SPACE = "category_not_space"
 
string CATEGORY_WORD = "category_word"
 
string CATEGORY_NOT_WORD = "category_not_word"
 
string CATEGORY_LINEBREAK = "category_linebreak"
 
string CATEGORY_NOT_LINEBREAK = "category_not_linebreak"
 
string CATEGORY_LOC_WORD = "category_loc_word"
 
string CATEGORY_LOC_NOT_WORD = "category_loc_not_word"
 
string CATEGORY_UNI_DIGIT = "category_uni_digit"
 
string CATEGORY_UNI_NOT_DIGIT = "category_uni_not_digit"
 
string CATEGORY_UNI_SPACE = "category_uni_space"
 
string CATEGORY_UNI_NOT_SPACE = "category_uni_not_space"
 
string CATEGORY_UNI_WORD = "category_uni_word"
 
string CATEGORY_UNI_NOT_WORD = "category_uni_not_word"
 
string CATEGORY_UNI_LINEBREAK = "category_uni_linebreak"
 
string CATEGORY_UNI_NOT_LINEBREAK = "category_uni_not_linebreak"
 
list OPCODES
 
list ATCODES
 
list CHCODES
 
dictionary OP_IGNORE
 
dictionary AT_MULTILINE
 
dictionary AT_LOCALE
 
dictionary AT_UNICODE
 
dictionary CH_LOCALE
 
dictionary CH_UNICODE
 
int SRE_FLAG_TEMPLATE = 1
 
int SRE_FLAG_IGNORECASE = 2
 
int SRE_FLAG_LOCALE = 4
 
int SRE_FLAG_MULTILINE = 8
 
int SRE_FLAG_DOTALL = 16
 
int SRE_FLAG_UNICODE = 32
 
int SRE_FLAG_VERBOSE = 64
 
int SRE_FLAG_DEBUG = 128
 
int SRE_INFO_PREFIX = 1
 
int SRE_INFO_LITERAL = 2
 
int SRE_INFO_CHARSET = 4
 
tuple f = open("sre_constants.h", "w")
 

Function Documentation

def sre_constants.dump (   f,
  d,
  prefix 
)

Definition at line 218 of file sre_constants.py.

References filecmp.cmp(), and string.upper().

219  def dump(f, d, prefix):
220  items = d.items()
221  items.sort(lambda a, b: cmp(a[1], b[1]))
222  for k, v in items:
f.write("#define %s_%s %s\n" % (prefix, string.upper(k), v))
def sre_constants.makedict (   list)

Definition at line 144 of file sre_constants.py.

145 def makedict(list):
146  d = {}
147  i = 0
148  for item in list:
149  d[item] = i
150  i = i + 1
151  return d

Variable Documentation

string ANY = "any"

Definition at line 33 of file sre_constants.py.

string ANY_ALL = "any_all"

Definition at line 34 of file sre_constants.py.

string ASSERT = "assert"

Definition at line 35 of file sre_constants.py.

string ASSERT_NOT = "assert_not"

Definition at line 36 of file sre_constants.py.

string AT = "at"

Definition at line 37 of file sre_constants.py.

string AT_BEGINNING = "at_beginning"

Definition at line 65 of file sre_constants.py.

string AT_BEGINNING_LINE = "at_beginning_line"

Definition at line 66 of file sre_constants.py.

string AT_BEGINNING_STRING = "at_beginning_string"

Definition at line 67 of file sre_constants.py.

string AT_BOUNDARY = "at_boundary"

Definition at line 68 of file sre_constants.py.

string AT_END = "at_end"

Definition at line 70 of file sre_constants.py.

string AT_END_LINE = "at_end_line"

Definition at line 71 of file sre_constants.py.

string AT_END_STRING = "at_end_string"

Definition at line 72 of file sre_constants.py.

string AT_LOC_BOUNDARY = "at_loc_boundary"

Definition at line 73 of file sre_constants.py.

string AT_LOC_NON_BOUNDARY = "at_loc_non_boundary"

Definition at line 74 of file sre_constants.py.

dictionary AT_LOCALE
Initial value:
1 = {
2  AT_BOUNDARY: AT_LOC_BOUNDARY,
3  AT_NON_BOUNDARY: AT_LOC_NON_BOUNDARY
4 }

Definition at line 169 of file sre_constants.py.

dictionary AT_MULTILINE
Initial value:
1 = {
2  AT_BEGINNING: AT_BEGINNING_LINE,
3  AT_END: AT_END_LINE
4 }

Definition at line 164 of file sre_constants.py.

string AT_NON_BOUNDARY = "at_non_boundary"

Definition at line 69 of file sre_constants.py.

string AT_UNI_BOUNDARY = "at_uni_boundary"

Definition at line 75 of file sre_constants.py.

string AT_UNI_NON_BOUNDARY = "at_uni_non_boundary"

Definition at line 76 of file sre_constants.py.

dictionary AT_UNICODE
Initial value:
1 = {
2  AT_BOUNDARY: AT_UNI_BOUNDARY,
3  AT_NON_BOUNDARY: AT_UNI_NON_BOUNDARY
4 }

Definition at line 174 of file sre_constants.py.

tuple ATCODES
Initial value:
1 = [
2  AT_BEGINNING, AT_BEGINNING_LINE, AT_BEGINNING_STRING, AT_BOUNDARY,
3  AT_NON_BOUNDARY, AT_END, AT_END_LINE, AT_END_STRING,
4  AT_LOC_BOUNDARY, AT_LOC_NON_BOUNDARY, AT_UNI_BOUNDARY,
5  AT_UNI_NON_BOUNDARY
6 ]

Definition at line 127 of file sre_constants.py.

string BIGCHARSET = "bigcharset"

Definition at line 38 of file sre_constants.py.

string BRANCH = "branch"

Definition at line 39 of file sre_constants.py.

string CALL = "call"

Definition at line 40 of file sre_constants.py.

string CATEGORY = "category"

Definition at line 41 of file sre_constants.py.

string CATEGORY_DIGIT = "category_digit"

Definition at line 79 of file sre_constants.py.

string CATEGORY_LINEBREAK = "category_linebreak"

Definition at line 85 of file sre_constants.py.

string CATEGORY_LOC_NOT_WORD = "category_loc_not_word"

Definition at line 88 of file sre_constants.py.

string CATEGORY_LOC_WORD = "category_loc_word"

Definition at line 87 of file sre_constants.py.

string CATEGORY_NOT_DIGIT = "category_not_digit"

Definition at line 80 of file sre_constants.py.

string CATEGORY_NOT_LINEBREAK = "category_not_linebreak"

Definition at line 86 of file sre_constants.py.

string CATEGORY_NOT_SPACE = "category_not_space"

Definition at line 82 of file sre_constants.py.

string CATEGORY_NOT_WORD = "category_not_word"

Definition at line 84 of file sre_constants.py.

string CATEGORY_SPACE = "category_space"

Definition at line 81 of file sre_constants.py.

string CATEGORY_UNI_DIGIT = "category_uni_digit"

Definition at line 89 of file sre_constants.py.

string CATEGORY_UNI_LINEBREAK = "category_uni_linebreak"

Definition at line 95 of file sre_constants.py.

string CATEGORY_UNI_NOT_DIGIT = "category_uni_not_digit"

Definition at line 90 of file sre_constants.py.

string CATEGORY_UNI_NOT_LINEBREAK = "category_uni_not_linebreak"

Definition at line 96 of file sre_constants.py.

string CATEGORY_UNI_NOT_SPACE = "category_uni_not_space"

Definition at line 92 of file sre_constants.py.

string CATEGORY_UNI_NOT_WORD = "category_uni_not_word"

Definition at line 94 of file sre_constants.py.

string CATEGORY_UNI_SPACE = "category_uni_space"

Definition at line 91 of file sre_constants.py.

string CATEGORY_UNI_WORD = "category_uni_word"

Definition at line 93 of file sre_constants.py.

string CATEGORY_WORD = "category_word"

Definition at line 83 of file sre_constants.py.

dictionary CH_LOCALE
Initial value:
1 = {
2  CATEGORY_DIGIT: CATEGORY_DIGIT,
3  CATEGORY_NOT_DIGIT: CATEGORY_NOT_DIGIT,
4  CATEGORY_SPACE: CATEGORY_SPACE,
5  CATEGORY_NOT_SPACE: CATEGORY_NOT_SPACE,
6  CATEGORY_WORD: CATEGORY_LOC_WORD,
7  CATEGORY_NOT_WORD: CATEGORY_LOC_NOT_WORD,
8  CATEGORY_LINEBREAK: CATEGORY_LINEBREAK,
9  CATEGORY_NOT_LINEBREAK: CATEGORY_NOT_LINEBREAK
10 }

Definition at line 179 of file sre_constants.py.

dictionary CH_UNICODE
Initial value:
1 = {
2  CATEGORY_DIGIT: CATEGORY_UNI_DIGIT,
3  CATEGORY_NOT_DIGIT: CATEGORY_UNI_NOT_DIGIT,
4  CATEGORY_SPACE: CATEGORY_UNI_SPACE,
5  CATEGORY_NOT_SPACE: CATEGORY_UNI_NOT_SPACE,
6  CATEGORY_WORD: CATEGORY_UNI_WORD,
7  CATEGORY_NOT_WORD: CATEGORY_UNI_NOT_WORD,
8  CATEGORY_LINEBREAK: CATEGORY_UNI_LINEBREAK,
9  CATEGORY_NOT_LINEBREAK: CATEGORY_UNI_NOT_LINEBREAK
10 }

Definition at line 190 of file sre_constants.py.

string CHARSET = "charset"

Definition at line 42 of file sre_constants.py.

tuple CHCODES
Initial value:
1 = [
2  CATEGORY_DIGIT, CATEGORY_NOT_DIGIT, CATEGORY_SPACE,
3  CATEGORY_NOT_SPACE, CATEGORY_WORD, CATEGORY_NOT_WORD,
4  CATEGORY_LINEBREAK, CATEGORY_NOT_LINEBREAK, CATEGORY_LOC_WORD,
5  CATEGORY_LOC_NOT_WORD, CATEGORY_UNI_DIGIT, CATEGORY_UNI_NOT_DIGIT,
6  CATEGORY_UNI_SPACE, CATEGORY_UNI_NOT_SPACE, CATEGORY_UNI_WORD,
7  CATEGORY_UNI_NOT_WORD, CATEGORY_UNI_LINEBREAK,
8  CATEGORY_UNI_NOT_LINEBREAK
9 ]

Definition at line 134 of file sre_constants.py.

tuple f = open("sre_constants.h", "w")

Definition at line 223 of file sre_constants.py.

string FAILURE = "failure"

Definition at line 30 of file sre_constants.py.

string GROUPREF = "groupref"

Definition at line 43 of file sre_constants.py.

string GROUPREF_IGNORE = "groupref_ignore"

Definition at line 44 of file sre_constants.py.

string IN = "in"

Definition at line 45 of file sre_constants.py.

string IN_IGNORE = "in_ignore"

Definition at line 46 of file sre_constants.py.

string INFO = "info"

Definition at line 47 of file sre_constants.py.

string JUMP = "jump"

Definition at line 48 of file sre_constants.py.

string LITERAL = "literal"

Definition at line 49 of file sre_constants.py.

string LITERAL_IGNORE = "literal_ignore"

Definition at line 50 of file sre_constants.py.

int MAGIC = 20010701

Definition at line 16 of file sre_constants.py.

string MARK = "mark"

Definition at line 51 of file sre_constants.py.

string MAX_REPEAT = "max_repeat"

Definition at line 52 of file sre_constants.py.

string MAX_UNTIL = "max_until"

Definition at line 53 of file sre_constants.py.

int MAXREPEAT = 65535

Definition at line 20 of file sre_constants.py.

string MIN_REPEAT = "min_repeat"

Definition at line 54 of file sre_constants.py.

string MIN_UNTIL = "min_until"

Definition at line 55 of file sre_constants.py.

string NEGATE = "negate"

Definition at line 56 of file sre_constants.py.

string NOT_LITERAL = "not_literal"

Definition at line 57 of file sre_constants.py.

string NOT_LITERAL_IGNORE = "not_literal_ignore"

Definition at line 58 of file sre_constants.py.

dictionary OP_IGNORE
Initial value:
1 = {
2  GROUPREF: GROUPREF_IGNORE,
3  IN: IN_IGNORE,
4  LITERAL: LITERAL_IGNORE,
5  NOT_LITERAL: NOT_LITERAL_IGNORE
6 }

Definition at line 157 of file sre_constants.py.

tuple OPCODES
Initial value:
1 = [
2 
3  # failure=0 success=1 (just because it looks better that way :-)
4  FAILURE, SUCCESS,
5 
6  ANY, ANY_ALL,
7  ASSERT, ASSERT_NOT,
8  AT,
9  BRANCH,
10  CALL,
11  CATEGORY,
12  CHARSET, BIGCHARSET,
13  GROUPREF, GROUPREF_IGNORE,
14  IN, IN_IGNORE,
15  INFO,
16  JUMP,
17  LITERAL, LITERAL_IGNORE,
18  MARK,
19  MAX_UNTIL,
20  MIN_UNTIL,
21  NOT_LITERAL, NOT_LITERAL_IGNORE,
22  NEGATE,
23  RANGE,
24  REPEAT,
25  REPEAT_ONE,
26  SUBPATTERN
27 
28 ]

Definition at line 98 of file sre_constants.py.

string RANGE = "range"

Definition at line 59 of file sre_constants.py.

string REPEAT = "repeat"

Definition at line 60 of file sre_constants.py.

string REPEAT_ONE = "repeat_one"

Definition at line 61 of file sre_constants.py.

int SRE_FLAG_DEBUG = 128

Definition at line 209 of file sre_constants.py.

int SRE_FLAG_DOTALL = 16

Definition at line 206 of file sre_constants.py.

int SRE_FLAG_IGNORECASE = 2

Definition at line 203 of file sre_constants.py.

int SRE_FLAG_LOCALE = 4

Definition at line 204 of file sre_constants.py.

int SRE_FLAG_MULTILINE = 8

Definition at line 205 of file sre_constants.py.

int SRE_FLAG_TEMPLATE = 1

Definition at line 202 of file sre_constants.py.

int SRE_FLAG_UNICODE = 32

Definition at line 207 of file sre_constants.py.

int SRE_FLAG_VERBOSE = 64

Definition at line 208 of file sre_constants.py.

int SRE_INFO_CHARSET = 4

Definition at line 214 of file sre_constants.py.

int SRE_INFO_LITERAL = 2

Definition at line 213 of file sre_constants.py.

int SRE_INFO_PREFIX = 1

Definition at line 212 of file sre_constants.py.

string SUBPATTERN = "subpattern"

Definition at line 62 of file sre_constants.py.

string SUCCESS = "success"

Definition at line 31 of file sre_constants.py.