2 |
|
|
3 |
;; Copyright (C) 1988,94,96,2000,01,02,03 Free Software Foundation, Inc. |
;; Copyright (C) 1988,94,96,2000,01,02,03 Free Software Foundation, Inc. |
4 |
|
|
5 |
;; Author: Alan Mackenzie (originally based on awk-mode.el) |
;; Author: Alan Mackenzie <acm@muc.de> (originally based on awk-mode.el) |
6 |
;; Maintainer: FSF |
;; Maintainer: FSF |
7 |
;; Keywords: AWK, cc-mode, unix, languages |
;; Keywords: AWK, cc-mode, unix, languages |
8 |
|
|
526 |
;; Matches any AWK regexp character which doesn't require special analysis. |
;; Matches any AWK regexp character which doesn't require special analysis. |
527 |
(defconst c-awk-escaped-newlines*-re "\\(\\\\[\n\r]\\)*") |
(defconst c-awk-escaped-newlines*-re "\\(\\\\[\n\r]\\)*") |
528 |
;; Matches a (possibly empty) sequence of escaped newlines. |
;; Matches a (possibly empty) sequence of escaped newlines. |
529 |
|
|
530 |
|
;; NOTE: In what follows, "[asdf]" in a regexp will be called a "character |
531 |
|
;; list", and "[:alpha:]" inside a character list will be known as a |
532 |
|
;; "character class". These terms for these things vary between regexp |
533 |
|
;; descriptions . |
534 |
(defconst c-awk-regexp-char-class-re |
(defconst c-awk-regexp-char-class-re |
535 |
|
"\\[:[a-z]+:\\]") |
536 |
|
;; Matches a character class spec (e.g. [:alpha:]). |
537 |
|
(defconst c-awk-regexp-char-list-re |
538 |
(concat "\\[" c-awk-escaped-newlines*-re "^?" c-awk-escaped-newlines*-re "]?" |
(concat "\\[" c-awk-escaped-newlines*-re "^?" c-awk-escaped-newlines*-re "]?" |
539 |
"\\(" c-awk-esc-pair-re "\\|" "[^]\n\r]" "\\)*" "\\(]\\|$\\)")) |
"\\(" c-awk-esc-pair-re "\\|" c-awk-regexp-char-class-re |
540 |
;; Matches a regexp char class, up to (but not including) EOL if the ] is |
"\\|" "[^]\n\r]" "\\)*" "\\(]\\|$\\)")) |
541 |
|
;; Matches a regexp char list, up to (but not including) EOL if the ] is |
542 |
;; missing. |
;; missing. |
543 |
(defconst c-awk-regexp-innards-re |
(defconst c-awk-regexp-innards-re |
544 |
(concat "\\(" c-awk-esc-pair-re "\\|" c-awk-regexp-char-class-re |
(concat "\\(" c-awk-esc-pair-re "\\|" c-awk-regexp-char-list-re |
545 |
"\\|" c-awk-regexp-normal-re "\\)*")) |
"\\|" c-awk-regexp-normal-re "\\)*")) |
546 |
;; Matches the inside of an AWK regexp (i.e. without the enclosing /s) |
;; Matches the inside of an AWK regexp (i.e. without the enclosing /s) |
547 |
(defconst c-awk-regexp-without-end-re |
(defconst c-awk-regexp-without-end-re |
558 |
;; A "neutral" char(pair). Doesn't change the "state" of a subsequent /. |
;; A "neutral" char(pair). Doesn't change the "state" of a subsequent /. |
559 |
;; This is space/tab, braces, an auto-increment/decrement operator or an |
;; This is space/tab, braces, an auto-increment/decrement operator or an |
560 |
;; escaped character. Or one of the (illegal) characters @ or `. But NOT an |
;; escaped character. Or one of the (illegal) characters @ or `. But NOT an |
561 |
;; end of line (even if escpaed). |
;; end of line (even if escaped). |
562 |
(defconst c-awk-neutrals*-re |
(defconst c-awk-neutrals*-re |
563 |
(concat "\\(" c-awk-neutral-re "\\)*")) |
(concat "\\(" c-awk-neutral-re "\\)*")) |
564 |
;; A (possibly empty) string of neutral characters (or character pairs). |
;; A (possibly empty) string of neutral characters (or character pairs). |