nxt.symbolic

Symbolic (Regular) Expressions and Predicate Logic.

Syntax is similar to Emacs' sregex, rx.

String patterns are matched by their raw bytes for now.

Members

Classes

Acronym
class Acronym

Word/Symbol Acronym Pattern.

Alt
class Alt

Alternative of Patterns in ALTS.

Any
class Any

Any Byte.

Clause
class Clause

Pattern Paired with Prefix and Suffix.

Ctx
class Ctx
Undocumented in source.
Lit
class Lit

Literal Pattern with Cached Binary Byte Histogram.

Opt
class Opt

Optional Sub Pattern count times.

Patt
class Patt

Base Pattern.

Rep
class Rep

Repetition Sub Pattern count times.

SPatt
class SPatt

Abstract Super Pattern.

SPatt1
class SPatt1

Abstract Singleton Super Pattern.

Seq
class Seq

Sequence of Patterns.

Space
class Space
Undocumented in source.

Functions

alt
auto alt(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
any
auto any(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
assac
auto assac(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
aswac
auto aswac(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
bob
Ctx bob(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
bol
Ctx bol(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
bos
Ctx bos(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
bow
Ctx bow(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
braced
Clause braced(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
buf
Seq buf(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
eob
Ctx eob(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
eol
Ctx eol(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
eos
Ctx eos(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
eow
Ctx eow(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
hooked
Clause hooked(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
insac
auto insac(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
inwac
auto inwac(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
kwd
Seq kwd(Arg arg)

Keyword arg.

line
Seq line(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
lit
auto lit(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
oom
auto oom(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
opt
auto opt(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
paired
Clause paired(Patt prefix, Patt suffix, Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
parend
Clause parend(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
rep
auto rep(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
seq
auto seq(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
shebangLine
auto ref shebangLine(Patt interpreter)

Create Matcher for a UNIX Shell $(LUCKY Shebang) Pattern.

sym
Seq sym(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
word
Seq word(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
ws
auto ws()
Undocumented in source. Be warned that the author may not have intended to support it.
zom
auto zom(Args args)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta

Authors

TODO Overload operators & (and), ! (not),

TODO: Add pattern for expressing inference with infer (infer ((x instanceOf X) & (X subClassOf Y)) (x instaceOf Y))

TODO Variables are either - _ (ignore) - _x, _y, etc - _'x', _'y' - _!0, _!1, ..., _!(n-1)

infer(rel!desire(_!x, _!y) && rel!madeOf(_!z, _!y), rel!desire(_!x, _!z))

TODO: Support variables of specific types and inference using predicate logic: infer(and(fact(var!'x', rel'desire', var!'y'), fact(var!'z', opt(rel'madeOf', rel'instanceOf'), var!'y'))), pred(var!'x', rel'desire', var!'z' ))

TODO: Make returns from factory functions immutable. TODO: Reuse return patterns from Lit

TODO const s = seq(al..lit,pha.lit); const t = al.lit ~ pha.lit; assert(s !is t); assert(equal(s, t));