First work on using a Lexesis lexer in the regex parser
This commit is contained in:
parent
2864ba5a43
commit
3fd362bf2d
|
@ -158,9 +158,6 @@ namespace lxs {
|
|||
case ']':
|
||||
case '?':
|
||||
case '.':
|
||||
case '\'':
|
||||
case '"':
|
||||
case '-':
|
||||
break;
|
||||
case 'n':
|
||||
c = '\n'; break;
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
CHAR_CLASS = \[^?\]?-?([^]-]-[^]-]|[^]-])+-?\]|\[^?(-|\]|\]-)\]
|
||||
|
||||
#All the escape sequences
|
||||
TAB = \\t
|
||||
NEWLINE = \\n
|
||||
CARRIAGE_RETURN = \\r
|
||||
BACKSPACE = \\b
|
||||
SPACE = \\s|\s
|
||||
BELL = \\a
|
||||
FORMFEED = \\f
|
||||
VTAB = \\v
|
||||
|
||||
BACKSLASH = \\\\
|
||||
ESCAPED_STAR = \\\*
|
||||
ESCAPED_PLUS = \\\+
|
||||
ESCAPED_PIPE = \\\|
|
||||
ESCAPED_LPAREN = \\\(
|
||||
ESCAPED_RPAREN = \\\)
|
||||
ESCAPED_LBRACKET = \\\[
|
||||
ESCAPED_RBRACKET = \\\]
|
||||
ESCAPED_QUESTIONMARK = \\\?
|
||||
ESCAPED_DOT = \\\.
|
||||
|
||||
# The special chars
|
||||
DOT = \.
|
||||
STAR = \*
|
||||
PLUS = \+
|
||||
QUESTIONMARK = \?
|
||||
PIPE = \|
|
||||
LPAREN = \(
|
||||
RPAREN = \)
|
||||
|
||||
# Anything other than these is valid
|
||||
# It cannot be ] or [, since those should be handled by CHAR_CLASS
|
||||
# If it is a \, it is an invalid escape sequence
|
||||
CHAR = [^][\]
|
||||
|
||||
ERROR = .
|
Loading…
Reference in New Issue