Package | Description |
---|---|
org.stekikun.dolmen.syntax | |
org.stekikun.dolmen.tagged |
Modifier and Type | Class and Description |
---|---|
static class |
Regular.Alternate
Instances of regular expressions that represent a choice
a | b between two regular expressions. |
static class |
Regular.Binding
Instances of regular expressions that represent
expressions whose matchers will be bound to
a specified name
|
static class |
Regular.Characters
Instances of regular expressions that match exactly
one character amongst a set of possible characters.
|
static class |
Regular.Eof
The singleton class that stands for the regular expression
matching the "end of input", or EOF, which only matches
when the input string has been entirely consumed.
|
static class |
Regular.Epsilon
The singleton class that stands for the empty
regular expression ε, which only matches the empty string.
|
static class |
Regular.Repetition
Instances of regular expressions that represent the Kleene
closure
r* of some regular expression r ,
i.e. matching zero, one or more repetitions of r |
static class |
Regular.Sequence
Instances of regular expressions that represent the
concatenation
ab of two regular expressions. |
Modifier and Type | Field and Description |
---|---|
Regular |
Regular.Sequence.first
First part of the concatenation
|
Regular |
Regular.Alternate.lhs
The left-hand side of the choice operator
|
Regular |
Regular.Repetition.reg
The regular expression to repeat
|
Regular |
Regular.Binding.reg
The bound regular expression
|
Regular |
Regular.Alternate.rhs
The right-hand side of the choice operator
|
Regular |
Regular.Sequence.second
Second part of the concatenation
|
Modifier and Type | Field and Description |
---|---|
Located<Regular> |
Lexer.Clause.regular
The regular expression of this clause
|
Map<Located<String>,Regular> |
Lexer.regulars
The named auxiliary regular expressions defined in this lexer
NB: These expressions are already inlined in
entryPoints
during the parsing so they are only stored in the lexer
description for UI feedback purposes. |
Modifier and Type | Method and Description |
---|---|
static Regular |
Regular.chars(CSet chars) |
@NonNull Regular |
Regular.Gen.generate() |
static Regular |
Regular.or(Regular reg1,
Regular... regs) |
static Regular |
Regular.or(Regular lhs,
Regular rhs) |
static Regular |
Regular.plus(Regular reg) |
static Regular |
Regulars.removeNestedBindings(Regular r)
Note that nested bindings with the same name are useless
because if the regular expression matches some string,
the last match bound for some name will always be the
outermost binding with that name.
|
static Regular |
Regulars.removeNestedBindings2(Regular r)
Note that nested bindings with the same name are useless
because if the regular expression matches some string,
the last match bound for some name will always be the
outermost binding with that name.
|
static Regular |
Regular.repeat(Regular reg,
int occ) |
static Regular |
Regular.repeat(Regular reg,
int min,
int max) |
static Regular |
Regular.seq(Regular... regs) |
static Regular |
Regular.seq(Regular first,
Regular second) |
static Regular |
Regular.star(Regular reg) |
static Regular |
Regular.string(String s) |
Modifier and Type | Method and Description |
---|---|
static Map<CSet,Regular> |
Regulars.project(Regular regular,
CSet first)
The projection of a regular expression on a character set provides
regular expressions for all character in the set, with the following
meaning: a string
s with first character c matches the
regular expression r if and only if s.substring(1) matches
the projection of r on the character c . |
Modifier and Type | Method and Description |
---|---|
Lexer.Entry.Builder |
Lexer.Entry.Builder.add(Regular regular,
String inlined)
Adds the clause formed by the given regular expression
and inlined semantic action
|
static Iterable<Regulars.MatchResult> |
Regulars.allMatches(Regular regular,
String input) |
static Iterable<Regulars.MatchResult> |
Regulars.allMatches(Regular regular,
String input,
boolean strict) |
static Regulars.VarsInfo |
Regulars.analyseVars(Regular regular) |
static @Nullable CSet |
Regulars.asCSet(Regular reg)
A regular expression corresponds to a character set if it is either
a character set, or an alternation of expression which correspond to
a character set.
|
static Regular.Binding |
Regular.binding(Regular reg,
Located<String> name) |
static boolean |
Regulars.equal(Regular r1,
Regular r2)
This is not an equivalence test between regular
regular expressions, in the sense that it can return
false on two different regular expressions
which would otherwise recognize the same language. |
static CSet |
Regulars.first(Regular regular) |
static @Nullable Map<String,String> |
Regulars.matches(Regular regular,
String input) |
static @Nullable Map<String,String> |
Regulars.matches(Regular regular,
String input,
boolean strict) |
static Regular |
Regular.or(Regular reg1,
Regular... regs) |
static Regular |
Regular.or(Regular reg1,
Regular... regs) |
static Regular |
Regular.or(Regular lhs,
Regular rhs) |
static Regular |
Regular.plus(Regular reg) |
static Map<CSet,Regular> |
Regulars.project(Regular regular,
CSet first)
The projection of a regular expression on a character set provides
regular expressions for all character in the set, with the following
meaning: a string
s with first character c matches the
regular expression r if and only if s.substring(1) matches
the projection of r on the character c . |
static Regular |
Regulars.removeNestedBindings(Regular r)
Note that nested bindings with the same name are useless
because if the regular expression matches some string,
the last match bound for some name will always be the
outermost binding with that name.
|
static Regular |
Regulars.removeNestedBindings2(Regular r)
Note that nested bindings with the same name are useless
because if the regular expression matches some string,
the last match bound for some name will always be the
outermost binding with that name.
|
static Regular |
Regular.repeat(Regular reg,
int occ) |
static Regular |
Regular.repeat(Regular reg,
int min,
int max) |
static Regular |
Regular.seq(Regular... regs) |
static Regular |
Regular.seq(Regular first,
Regular second) |
static Regular |
Regular.star(Regular reg) |
static Iterable<String> |
Regulars.witnesses(Regular regular) |
Modifier and Type | Method and Description |
---|---|
Lexer.Entry.Builder |
Lexer.Entry.Builder.add(Located<Regular> regular,
Extent loc)
Adds the clause formed by the given regular expression
and semantic action
|
static Lexer |
Lexer.of(List<Option> options,
List<Located<String>> imports,
Extent header,
Map<Located<String>,Regular> regulars,
Iterable<Lexer.Entry> entryPoints,
Extent footer) |
Constructor and Description |
---|
Builder(List<Option> options,
List<Located<String>> imports,
Extent header,
Map<Located<String>,Regular> regulars,
Extent footer)
Returns a new builder with the given options, imports,
header, auxiliary regular expressions and footer
|
Clause(Located<Regular> regular,
Extent action) |
Modifier and Type | Method and Description |
---|---|
TRegular |
Encoder.encode(Regular regular,
Set<String> charVars,
int action) |