Package org.jparsec
Class Lexicon
java.lang.Object
org.jparsec.Lexicon
- Direct Known Subclasses:
Terminals
A
Lexicon is a group of lexical words that can be tokenized by a single tokenizer.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static <F,T> Function <F, T> Returns aFunctionthat delegates tofunctionand falls back todefaultFunctionfor null return values.Parser<?> AParserthat recognizes a sequence of tokens identified bytokenNames, as an atomic step.AParserthat recognizes the token identified bytokenName.AParserthat recognizes a token identified by any oftokenNames.Parser<?> Returns the tokenizer that tokenizes all terminals (operators, keywords, identifiers etc.) managed in this instance.(package private) Lexicon(package private) ObjectGets the token value identified by the token text.
-
Field Details
-
words
Maps lexical word name to token value. -
tokenizer
The scanner that recognizes any of the lexical word.
-
-
Constructor Details
-
Lexicon
-
-
Method Details
-
tokenizer
Returns the tokenizer that tokenizes all terminals (operators, keywords, identifiers etc.) managed in this instance. -
phrase
AParserthat recognizes a sequence of tokens identified bytokenNames, as an atomic step. -
token
AParserthat recognizes a token identified by any oftokenNames. -
token
AParserthat recognizes the token identified bytokenName. -
word
Gets the token value identified by the token text. This text is the operator or the keyword.- Parameters:
name- the token text.- Returns:
- the token object.
- Throws:
IllegalArgumentException- if the token object does not exist.
-
union
-
fallback
static <F,T> Function<F,T> fallback(Function<F, T> function, Function<? super F, ? extends T> defaultFunction) Returns aFunctionthat delegates tofunctionand falls back todefaultFunctionfor null return values.
-