public final class Terms
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Method and Description |
---|---|
static <R> Parser<R> |
charParser(FromChar<R> fc)
gets a Parser object to parse Character token.
|
static <R> Parser<R> |
charParser(java.lang.String name,
FromChar<R> fc)
gets a Parser object to parse Character token.
|
static <R> Parser<R> |
decimalParser(FromString<R> fc)
gets a Parser object to parse TokenDecimal.
|
static <R> Parser<R> |
decimalParser(java.lang.String name,
FromString<R> fc)
gets a Parser object to parse TokenDecimal.
|
static <T,R> FromToken<R> |
fromTypedToken(T[] types,
FromString<R> f)
Get a FromToken object that only recognizes a token of
certain types.
|
static <T,R> FromToken<R> |
fromTypedToken(T type,
FromString<R> f)
Get a FromToken object that only recognizes a token of
a certain type.
|
static Terms |
getCaseInsensitive(Parser<?> wscanner,
java.lang.String[] ops,
java.lang.String[] keywords)
Deprecated.
|
static Terms |
getCaseInsensitive(Parser<?> wscanner,
java.lang.String[] ops,
java.lang.String[] keywords,
FromString<?> toWord)
Deprecated.
|
static Terms |
getCaseInsensitive(java.lang.String[] ops,
java.lang.String[] keywords)
Deprecated.
Use
getCaseInsensitiveInstance(String[], String[]) instead. |
static Terms |
getCaseInsensitiveInstance(Parser<?> wscanner,
java.lang.String[] ops,
java.lang.String[] keywords)
Creates a Terms object for lexing and parsing the operators with names specified in ops,
and for lexing and parsing the keywords case insensitively.
|
static Terms |
getCaseInsensitiveInstance(Parser<?> wscanner,
java.lang.String[] ops,
java.lang.String[] keywords,
FromString<?> toWord)
Creates a Terms object for lexing and parsing the operators with names specified in ops,
and for lexing and parsing the keywords case insensitively.
|
static Terms |
getCaseInsensitiveInstance(java.lang.String[] ops,
java.lang.String[] keywords)
Creates a Terms object for lexing and parsing the operators with names specified in ops,
and for lexing and parsing the keywords case insensitively.
|
static Terms |
getCaseSensitive(Parser<?> wscanner,
java.lang.String[] ops,
java.lang.String[] keywords)
Deprecated.
Use
getCaseSensitiveInstance(Parser, String[], String[]) instead. |
static Terms |
getCaseSensitive(Parser<?> wscanner,
java.lang.String[] ops,
java.lang.String[] keywords,
FromString<?> toWord)
Deprecated.
|
static Terms |
getCaseSensitive(java.lang.String[] ops,
java.lang.String[] keywords)
Deprecated.
Use
getCaseSensitiveInstance(String[], String[]) instead. |
static Terms |
getCaseSensitiveInstance(Parser<?> wscanner,
java.lang.String[] ops,
java.lang.String[] keywords)
Creates a Terms object for lexing and parsing the operators with names specified in ops,
and for lexing and parsing the keywords case sensitively.
|
static Terms |
getCaseSensitiveInstance(Parser<?> wscanner,
java.lang.String[] ops,
java.lang.String[] keywords,
FromString<?> toWord)
Creates a Terms object for lexing and parsing the operators with names specified in ops,
and for lexing and parsing the keywords case sensitively.
|
static Terms |
getCaseSensitiveInstance(java.lang.String[] ops,
java.lang.String[] keywords)
Creates a Terms object for lexing and parsing the operators with names specified in ops,
and for lexing and parsing the keywords case sensitively.
|
Parser<Tok> |
getLexer()
gets the lexer for the terminals.
|
static Terms |
getOperators(java.lang.String... ops)
Deprecated.
Use
getOperatorsInstance(String[]) instead. |
static Terms |
getOperatorsInstance(java.lang.String... ops)
Creates a Terms object for lexing the operators with names specified in ops.
|
Parser<Tok> |
getParser(java.lang.String... tnames)
gets the parser for the terminals identified by tnames.
|
Parser<Tok> |
getParser(java.lang.String tname)
gets the parser for a terminal identified by tname.
|
Parser<Tok> |
getParser(java.lang.String[] tnames,
java.lang.String expected)
gets the parser for the terminals identified by tnames.
|
Parser<Tok> |
getParser(java.lang.String tname,
java.lang.String expected)
gets the parser for a terminal identified by tname.
|
Parser<Tok> |
getParser(java.lang.String name,
java.lang.String[] tnames)
gets the parser for the terminals identified by tnames.
|
Parser<Tok> |
getParser(java.lang.String name,
java.lang.String[] tnames,
java.lang.String expected)
gets the parser for the terminals identified by tnames.
|
Parser<Tok> |
getParser(java.lang.String name,
java.lang.String tname,
java.lang.String expected)
gets the parser for a terminal identified by tname.
|
static <R> Parser<R> |
integerParser(FromLong<R> fc)
gets a Parser object to parse Long token.
|
static <R> Parser<R> |
integerParser(FromString<R> fs)
gets a Parser object to parse token of arbitrary length integer.
|
static <R> Parser<R> |
integerParser(java.lang.String name,
FromLong<R> fc)
gets a Parser object to parse Long token.
|
static <R> Parser<R> |
integerParser(java.lang.String name,
FromString<R> fs)
gets a Parser object to parse token of arbitrary length integer.
|
static <R> Parser<R> |
myParser(FromMyText<R> fm)
Deprecated.
|
static <R> Parser<R> |
myParser(int kind,
FromString<R> fs)
Deprecated.
|
static <R> Parser<R> |
myParser(java.lang.String name,
FromMyText<R> fm)
Deprecated.
|
static <R> Parser<R> |
myParser(java.lang.String name,
int kind,
FromString<R> fs)
Deprecated.
|
static <R> Parser<R> |
quotedWordParser(FromString3<R> fc)
gets a Parser object to parse TokenQuoted.
|
static <R> Parser<R> |
quotedWordParser(java.lang.String name,
FromString3<R> fc)
gets a Parser object to parse TokenQuoted.
|
static <R> Parser<R> |
stringParser(FromString<R> fc)
gets a Parser object to parse String token.
|
static <R> Parser<R> |
stringParser(java.lang.String name,
FromString<R> fc)
gets a Parser object to parse String token.
|
static <R> Parser<R> |
wordParser(FromString<R> fc)
gets a Parser object to parse TokenWord.
|
static <R> Parser<R> |
wordParser(java.lang.String name,
FromString<R> fc)
gets a Parser object to parse TokenWord.
|
public Parser<Tok> getParser(java.lang.String... tnames)
tnames
- the names of the terminals.public Parser<Tok> getParser(java.lang.String name, java.lang.String[] tnames)
name
- the name of the parser.tnames
- the names of the terminals.public Parser<Tok> getParser(java.lang.String[] tnames, java.lang.String expected)
tnames
- the names of the terminals.expected
- the label when this parser fails.public Parser<Tok> getParser(java.lang.String name, java.lang.String[] tnames, java.lang.String expected)
name
- the name of the parser.tnames
- the names of the terminals.expected
- the label when this parser fails.public Parser<Tok> getParser(java.lang.String name, java.lang.String tname, java.lang.String expected)
name
- the name of the parser.tname
- the name of the terminal.expected
- the label when this parser fails.public Parser<Tok> getParser(java.lang.String tname, java.lang.String expected)
tname
- the name of the terminal.expected
- the label when this parser fails.public Parser<Tok> getParser(java.lang.String tname)
tname
- the name of the terminal.public static Terms getCaseInsensitiveInstance(java.lang.String[] ops, java.lang.String[] keywords)
ops
- the operator names.keywords
- the keyword names.public static Terms getCaseSensitiveInstance(java.lang.String[] ops, java.lang.String[] keywords)
ops
- the operator names.keywords
- the keyword names.public static Terms getCaseInsensitiveInstance(Parser<?> wscanner, java.lang.String[] ops, java.lang.String[] keywords)
wscanner
- the scanner that identifies a word in the language.ops
- the operator names.keywords
- the keyword names.public static Terms getCaseSensitiveInstance(Parser<?> wscanner, java.lang.String[] ops, java.lang.String[] keywords)
wscanner
- the scanner that identifies a word in the language.ops
- the operator names.keywords
- the keyword names.public static Terms getCaseInsensitiveInstance(Parser<?> wscanner, java.lang.String[] ops, java.lang.String[] keywords, FromString<?> toWord)
wscanner
- the scanner that identifies a word in the language.ops
- the operator names.keywords
- the keyword names.toWord
- the FromString object used to create a token for non-key words recognized by wscanner.public static Terms getCaseSensitiveInstance(Parser<?> wscanner, java.lang.String[] ops, java.lang.String[] keywords, FromString<?> toWord)
wscanner
- the scanner that identifies a word in the language.ops
- the operator names.keywords
- the keyword names.toWord
- the FromString object used to create a token for non-key words recognized by wscanner.public static Terms getOperatorsInstance(java.lang.String... ops)
ops
- the operator names.public static Terms getCaseInsensitive(java.lang.String[] ops, java.lang.String[] keywords)
getCaseInsensitiveInstance(String[], String[])
instead.ops
- the operator names.keywords
- the keyword names.public static Terms getCaseSensitive(java.lang.String[] ops, java.lang.String[] keywords)
getCaseSensitiveInstance(String[], String[])
instead.ops
- the operator names.keywords
- the keyword names.public static Terms getCaseInsensitive(Parser<?> wscanner, java.lang.String[] ops, java.lang.String[] keywords)
getCaseInsensitiveInstance(Parser, String[], String[])
instead.wscanner
- the scanner that identifies a word in the language.ops
- the operator names.keywords
- the keyword names.public static Terms getCaseSensitive(Parser<?> wscanner, java.lang.String[] ops, java.lang.String[] keywords)
getCaseSensitiveInstance(Parser, String[], String[])
instead.wscanner
- the scanner that identifies a word in the language.ops
- the operator names.keywords
- the keyword names.public static Terms getCaseInsensitive(Parser<?> wscanner, java.lang.String[] ops, java.lang.String[] keywords, FromString<?> toWord)
getCaseInsensitiveInstance(Parser, String[], String[], FromString)
instead.wscanner
- the scanner that identifies a word in the language.ops
- the operator names.keywords
- the keyword names.toWord
- the FromString object used to create a token for non-key words recognized by wscanner.public static Terms getCaseSensitive(Parser<?> wscanner, java.lang.String[] ops, java.lang.String[] keywords, FromString<?> toWord)
getCaseSensitiveInstance(Parser, String[], String[], FromString)
instead.wscanner
- the scanner that identifies a word in the language.ops
- the operator names.keywords
- the keyword names.toWord
- the FromString object used to create a token for non-key words recognized by wscanner.public static Terms getOperators(java.lang.String... ops)
getOperatorsInstance(String[])
instead.ops
- the operator names.public static <R> Parser<R> charParser(java.lang.String name, FromChar<R> fc)
name
- the parser name.fc
- the mapping to map char to an object returned by the parser.public static <R> Parser<R> stringParser(java.lang.String name, FromString<R> fc)
name
- the parser name.fc
- the mapping to map String to an object returned by the parser.public static <R> Parser<R> quotedWordParser(java.lang.String name, FromString3<R> fc)
name
- the parser name.fc
- the mapping to map the quoted string to an object returned by the parser.public static <R> Parser<R> wordParser(java.lang.String name, FromString<R> fc)
name
- the parser name.fc
- the mapping to map the word to an object returned by the parser.@Deprecated public static <R> Parser<R> myParser(FromMyText<R> fm)
fm
- the FromMyText object to recognize MyToken object.@Deprecated public static <R> Parser<R> myParser(java.lang.String name, FromMyText<R> fm)
name
- the name of the parser object.fm
- the FromMyText object to recognize MyToken object.@Deprecated public static <R> Parser<R> myParser(int kind, FromString<R> fs)
kind
- the token kind to recognize.fs
- the FromString object to transform.@Deprecated public static <R> Parser<R> myParser(java.lang.String name, int kind, FromString<R> fs)
name
- the Parser name.kind
- the token kind to recognize.fs
- the FromString object to transform.public static <R> Parser<R> integerParser(java.lang.String name, FromLong<R> fc)
name
- the parser name.fc
- the mapping to map the number to an object returned by the parser.public static <R> Parser<R> integerParser(FromString<R> fs)
fs
- the mapping to map the number to an object returned by the parser.public static <R> Parser<R> integerParser(java.lang.String name, FromString<R> fs)
name
- the parser name.fs
- the mapping to map the number to an object returned by the parser.public static <R> Parser<R> decimalParser(java.lang.String name, FromString<R> fc)
name
- the parser name.fc
- the mapping to map the decimal to an object returned by the parser.public static <R> Parser<R> charParser(FromChar<R> fc)
fc
- the mapping to map char to an object returned by the parser.public static <R> Parser<R> stringParser(FromString<R> fc)
fc
- the mapping to map String to an object returned by the parser.public static <R> Parser<R> quotedWordParser(FromString3<R> fc)
fc
- the mapping to map the quoted string to an object returned by the parser.public static <R> Parser<R> wordParser(FromString<R> fc)
fc
- the mapping to map the word to an object returned by the parser.public static <R> Parser<R> integerParser(FromLong<R> fc)
fc
- the mapping to map the number to an object returned by the parser.public static <R> Parser<R> decimalParser(FromString<R> fc)
fc
- the mapping to map the decimal to an object returned by the parser.public static <T,R> FromToken<R> fromTypedToken(T type, FromString<R> f)
type
- the token type recognized.f
- the FromString object used to translate the character range to
a certain object.public static <T,R> FromToken<R> fromTypedToken(T[] types, FromString<R> f)
types
- the token types recognized.f
- the FromString object used to translate the character range to
a certain object.