Version 1.0
Copyright © 2022 Lowell D. Thomas
Python APG
… an
A
BNF
P
arser
G
enerator
Main Page
Related Pages
Packages
Packages
Package Functions
All
a
b
c
d
e
f
g
h
i
k
l
m
n
p
r
s
t
u
v
x
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
p
r
s
t
u
v
x
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
p
r
s
t
u
v
Classes
Class List
Class Index
Class Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Functions
_
a
c
d
e
f
g
h
i
o
p
r
s
t
u
w
Variables
a
b
c
e
f
g
h
i
l
m
n
o
p
r
s
t
u
Files
File List
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
apg_py
lib
identifiers.py
Go to the documentation of this file.
1
""" @file apg_py/lib/identifiers.py
2
@brief All of the APG numerical ids.
3
"""
4
5
import
sys
6
7
# use this for infinity
8
MAX_INT = sys.maxsize
9
10
# the original ABNF operators
11
ALT = 1
# alternation
12
CAT = 2
# concatenation
13
REP = 3
# repetition
14
RNM = 4
# rule name
15
TRG = 5
# terminal range
16
TBS = 6
# terminal binary string
17
TLS = 7
# terminal literal string, case insensitive
18
19
# the super set, SABNF operators
20
UDT = 11
# user - defined terminal
21
AND = 12
# positive look ahead
22
NOT = 13
# negative look ahead
23
BKR = 14
# back reference to previously matched rule/UDT
24
BKA = 15
# positive look behind
25
BKN = 16
# negative look behind
26
ABG = 17
# anchor - begin of string
27
AEN = 18
# anchor - end of string
28
29
# the parser states
30
ACTIVE = 100
31
MATCH = 101
32
EMPTY = 102
33
NOMATCH = 103
34
35
# AST translation states and call back function returns
36
SEM_PRE = 200
# AST down
37
SEM_POST = 201
# AST up
38
SEM_OK = 300
# AST normal return
39
SEM_SKIP = 301
# AST directs transator to skip branch below this node
40
41
# rule attribute categorization
42
ATTR_N = 400
# non-recursive
43
ATTR_R = 401
# recursive
44
ATTR_MR = 402
# belongs to a mutually-recursive set
45
46
# Look around values - indicate if parser is in look ahead or look behind mode.
47
LOOKAROUND_NONE = 500
# parser in normal parsing mode
48
LOOKAROUND_AHEAD = 501
# parser is in look-ahead mode
49
LOOKAROUND_BEHIND = 502
# parser is in look-behind mode
50
51
# Back reference rule mode indicators
52
BKR_MODE_UM = 601
# universal mode back reference
53
BKR_MODE_RM = 602
# recursive mode back reference
54
BKR_MODE_CS = 603
# back reference is case sensitive
55
BKR_MODE_CI = 604
# back reference is case insensitive
56
57
# dictionary to match names to ids
58
dict = {
59
ALT:
'ALT'
,
60
CAT:
'CAT'
,
61
REP:
'REP'
,
62
RNM:
'RNM'
,
63
TRG:
'TRG'
,
64
TBS:
'TBS'
,
65
TLS:
'TLS'
,
66
UDT:
'UDT'
,
67
AND:
'AND'
,
68
NOT:
'NOT'
,
69
BKR:
'BKR'
,
70
BKA:
'BKA'
,
71
BKN:
'BKN'
,
72
ABG:
'ABG'
,
73
AEN:
'AEN'
,
74
ACTIVE:
'ACTIVE'
,
75
MATCH:
'MATCH'
,
76
EMPTY:
'EMPTY'
,
77
NOMATCH:
'NOMATCH'
,
78
SEM_PRE:
'SEM_PRE'
,
79
SEM_POST:
'SEM_POST'
,
80
SEM_OK:
'SEM_OK'
,
81
SEM_SKIP:
'SEM_SKIP'
,
82
ATTR_N:
'ATTR_N'
,
83
ATTR_R:
'ATTR_R'
,
84
ATTR_MR:
'ATTR_MR'
,
85
LOOKAROUND_NONE:
'LOOKAROUND_NONE'
,
86
LOOKAROUND_AHEAD:
'LOOKAROUND_AHEAD'
,
87
LOOKAROUND_BEHIND:
'LOOKAROUND_BEHIND'
,
88
BKR_MODE_UM:
'BKR_MODE_UM'
,
89
BKR_MODE_RM:
'BKR_MODE_RM'
,
90
BKR_MODE_CS:
'BKR_MODE_CS'
,
91
BKR_MODE_CI:
'BKR_MODE_CI'
,
92
}
Generated by
1.9.1
Python APG, Version 1.0, is licensed under the
2-Clause BSD License
,
an
Open Source Initiative
Approved License.