E | |
email_addr, Rx | |
empty | |
empty1, Test_Xml | |
empty2, Test_Xml | |
empty3, Test_Xml | |
empty4, Test_Xml | |
encrypt, FAI_DiskConfig | |
entries_re, Xorg | |
entry_ace, Test_IniFile | |
entry_acf, Test_IniFile | |
entry_ade, Test_IniFile | |
entry_adf, Test_IniFile | |
entry_bce, Test_IniFile | |
entry_bcf, Test_IniFile | |
entry_bde, Test_IniFile | |
entry_bdf, Test_IniFile | |
entry_re | |
eol | |
equal, Sep | |
F | |
file, Test_Aliases | |
file_r, Syslog | |
filesystem, FAI_DiskConfig | |
filesystem_kw, FAI_DiskConfig | |
filter | |
fs_option, FAI_DiskConfig | |
fs_options, FAI_DiskConfig | |
fspath | |
G | |
generic_entry_re, Xorg | |
generic_opt, FAI_DiskConfig | |
generic_opt_list, FAI_DiskConfig | |
group_record, cgrules | |
I | |
indent | |
input1, Test_Xml | |
int, Xorg | |
integer, Rx | |
ip, Rx | |
ipaddr, Pg_Hba | |
ipv4, Rx | |
ipv6, Rx | |
K | |
key_re, Approx | |
L | |
lns, FAI_DiskConfig | |
lns_ace, Test_IniFile | |
lns_acf, Test_IniFile | |
lns_ade, Test_IniFile | |
lns_adf, Test_IniFile | |
lns_bce, Test_IniFile | |
lns_bcf, Test_IniFile | |
lns_bde, Test_IniFile | |
lns_bdf, Test_IniFile | |
loghost_r, Syslog | |
lvmoption, FAI_DiskConfig | |
M | |
mount_option, FAI_DiskConfig | |
mount_option_value, FAI_DiskConfig | |
mount_options, FAI_DiskConfig | |
mountpoint, FAI_DiskConfig | |
mountpoint_kw, FAI_DiskConfig | |
multiline_ace, Test_IniFile | |
multiline_test, Test_IniFile | |
N | |
name | |
neg1, Rx | |
no_spaces, Rx | |
nocomma, Test_Aliases | |
num, Cron |
To be refined
let email_addr = /[A-Za-z0-9_+.-]+@[A-Za-z0-9_.-]+/
let empty = Util.empty
let empty = Util.empty
let empty = Util.empty
let empty = Util.empty
let empty = Util.empty
let empty = Util.empty
let empty = Util.empty
let empty1 = "<a/>"
let empty2 = "<a foo=\"bar\"/>"
let empty3 = "<a foo=\"bar\"></a>\n"
let empty4 = "<a foo=\"bar\" far=\"baz\"/>"
encrypt tag
let encrypt = tag "encrypt"
This is a list of all patterns which have specific handlers, and should therefore not be matched by the generic handler
let entries_re = /([oO]ption|[sS]creen|[iI]nput[dD]evice|[dD]river|[sS]ub[sS]ection|[dD]isplay|[iI]dentifier|[vV]ideo[rR]am|[dD]efault[dD]epth|[dD]evice)/
let entry_ace = IniFile.entry IniFile.entry_re sep_ace comment_ace
let entry_acf = IniFile.entry IniFile.entry_re sep_acf comment_acf
let entry_ade = IniFile.entry IniFile.entry_re sep_ade comment_ade
let entry_adf = IniFile.entry IniFile.entry_re sep_adf comment_adf
let entry_bce = IniFile.entry IniFile.entry_re sep_bce comment_bce
let entry_bcf = IniFile.entry IniFile.entry_re sep_bcf comment_bcf
let entry_bde = IniFile.entry IniFile.entry_re sep_bde comment_bde
let entry_bdf = IniFile.entry IniFile.entry_re sep_bdf comment_bdf
Regexp for possible entry keyword (path, allow, deny)
let entry_re = /path|allow|deny/
Default regexp for entry keyword
let entry_re = ( /[A-Za-z][A-Za-z0-9._-]+/ )
let eol = Util.eol
An Util.eol
let eol = Util.eol
let eol = Util.eol
let eol = Util.eol
let eol = Util.eol
End of line, inherited from Util.eol
let eol = Util.eol
let eol = del /[ \t]*(#)?[ \t]*\n/ "\n"
let eol = del /[ \t]*\n/ "\n"
let eol = Util.eol
Delete end of line, including optional trailing whitespace
let eol = del /[ \t]*\n/ "\n"
let eol = Util.eol
let equal = Util.del_str "="
A full configuration file
let file = "# # Aliases in this file will NOT be expanded in the header from # Mail, but WILL be visible over networks or from /bin/mail. # Basic system aliases -- these MUST be present. mailer-daemon: postmaster postmaster: root # General redirections for pseudo accounts. bin: root , adm, bob daemon: root adm: root file: /var/foo pipe1: |/bin/ls pipe2 : |\"/usr/bin/ls args,\" "
a file begins with a / and get almost anything else after
let file_r = /\/[^ \t\n]+/
let filesystem = [ label "filesystem" . store filesystem_kw ]
Regexps for filesystem
let filesystem_kw = "-" | "swap"
let fs_option = [ key /createopts|tuneopts/ . Util.del_str "=\"" . store /[^"\n]*/ . Util.del_str "\"" ]
An array of fs_options
let fs_options =
let fspath = Rx.fspath
A filesystem path
let fspath = /[^ \t\n]+/
let generic_entry_re = /[^# \t\n\/]+/ - entries_re
A generic key/value option
let generic_opt (type:string) (kw:regexp) = [ key type . Util.del_str ":" . store kw ]
A generic key/list option
let generic_opt_list (type:string) (kw:regexp) = [ key type . Util.del_str ":" . counter "locallist" . Build.opt_list [seq "locallist" . store kw] Sep.comma ]
let group_record = generic_record "group" (Util.del_str "@" . store name)
An Util.indent
let indent = Util.indent
let indent = Util.indent
let indent = del /[ \t]*/ ""
Delete indentation, including leading whitespace
let indent = del /[ \t]*/ ""
let indent = Util.indent
let input1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <html> <head> <title>Wiki</title> </head> <body> <h1>Augeas</h1> <p class=\"main\">Augeas is now able to parse XML files!</p> <ul> <li>Translate from XML to a tree syntax</li> <li>Translate from the tree back to XML</li> <!-- this is some comment --> <li>this</li> </ul> </body> </html> "
let int = /[0-9]+/
One or more digits
let integer = /[0-9]+/
An ipv4 or ipv6
let ip = ipv4 | ipv6
CIDR or ip+netmask
let ipaddr = /[0-9a-fA-F:.]+(\/[0-9]+|[ \t]+[0-9.]+)/
let ipv4 = let dot = "." in let digits = /(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/ in digits . dot . digits . dot . digits . dot . digits
let ipv6 = /(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})/ | /(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})/ | /(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})/ | /(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})/ | /(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})/ | /(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})/ | ( /([0-9A-Fa-f]{1,4}:){6}/ . /((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\.){3}/ . /(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))/ ) | ( /([0-9A-Fa-f]{1,4}:){0,5}:/ . /((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\.){3}/ . /(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))/ ) | ( /::([0-9A-Fa-f]{1,4}:){0,5}/ . /((((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))\.){3}/ . /(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2})))/ ) | ( /[0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}/ . /[0-9A-Fa-f]{1,4}/ ) | /(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})/ | /(([0-9A-Fa-f]{1,4}:){1,7}:)/
let key_re = /\$?[A-Za-z0-9_.-]+/
The disk_config lens
let lns = (disk_config|comment|empty)*
let lns_ace = IniFile.lns record_ace comment_ace
let lns_acf = IniFile.lns_noempty record_acf comment_acf
let lns_ade = IniFile.lns record_ade comment_ade
let lns_adf = IniFile.lns_noempty record_adf comment_adf
let lns_bce = IniFile.lns record_bce comment_bce
let lns_bcf = IniFile.lns_noempty record_bce comment_bcf
let lns_bde = IniFile.lns record_bde comment_bde
let lns_bdf = IniFile.lns_noempty record_bdf comment_bdf
Matches a hostname, that is labels speparated by dots, labels can’t start or end with a “-”.
let loghost_r = /[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*/
let lvmoption =
Counting options
let mount_option = [ seq "mount_option" . store /[^,= \t\n]+/ . mount_option_value? ]
let mount_option_value = [ label "value" . Util.del_str "=" . store /[^,= \t\n]+/ ]
An array of mount_options
let mount_options = [ label "mount_options" . counter "mount_option" . Build.opt_list mount_option Sep.comma ]
let mountpoint_kw = "-" (* do not mount *) | "swap" (* swap space *)
let multiline_ace = IniFile.entry_multiline IniFile.entry_re sep_ace comment_ace
let multiline_test = "test_ace = val1\n val2\n val3\n"
let name = /([^ \t\n#:|@]+|"[^"|\n]*")/ (* " make emacs calm down *)
let name = /[^@%# \t\n][^ \t\n]*/
LVM volume group name
let name = [ label "name" . store /[^\/ \t\n]+/ ]
Anything but a space, a comma or a comment sign
let neg1 = /[^,# \n\t]+/
A string with no spaces
let no_spaces = /[^ \t\n]+/
Don’t have to have whitespace after a comma
let nocomma = "alias: target1,target2\n"
let num = /[0-9*][0-9\/,*-]*/