jfun.parsec
public final class Terms extends Object implements Serializable
Method Summary | |
---|---|
static <R> Parser<R> | charParser(String name, FromChar<R> fc)
gets a Parser object to parse Character token. |
static <R> Parser<R> | charParser(FromChar<R> fc)
gets a Parser object to parse Character token. |
static <R> Parser<R> | decimalParser(String name, FromString<R> fc)
gets a Parser object to parse TokenDecimal. |
static <R> Parser<R> | decimalParser(FromString<R> fc)
gets a Parser object to parse TokenDecimal. |
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 <T,R> FromToken<R> | fromTypedToken(T[] types, FromString<R> f)
Get a FromToken object that only recognizes a token of
certain types. |
static Terms | getCaseInsensitive(String[] ops, 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 | getCaseInsensitive(Parser<?> wscanner, String[] ops, 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 | getCaseInsensitive(Parser<?> wscanner, String[] ops, 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(String[] ops, 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, String[] ops, 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, String[] ops, 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 | getCaseSensitive(String[] ops, 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 | getCaseSensitive(Parser<?> wscanner, String[] ops, 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 | getCaseSensitive(Parser<?> wscanner, String[] ops, 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(String[] ops, 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, String[] ops, 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, String[] ops, 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.
|
Parser<Tok> | getLexer()
gets the lexer for the terminals. |
static Terms | getOperators(String... ops)
Creates a Terms object for lexing the operators with names specified in ops.
|
static Terms | getOperatorsInstance(String... ops)
Creates a Terms object for lexing the operators with names specified in ops.
|
Parser<Tok> | getParser(String... tnames)
gets the parser for the terminals identified by tnames.
|
Parser<Tok> | getParser(String name, String[] tnames)
gets the parser for the terminals identified by tnames.
|
Parser<Tok> | getParser(String[] tnames, String expected)
gets the parser for the terminals identified by tnames.
|
Parser<Tok> | getParser(String name, String[] tnames, String expected)
gets the parser for the terminals identified by tnames.
|
Parser<Tok> | getParser(String name, String tname, String expected)
gets the parser for a terminal identified by tname.
|
Parser<Tok> | getParser(String tname, String expected)
gets the parser for a terminal identified by tname.
|
Parser<Tok> | getParser(String tname)
gets the parser for a terminal identified by tname.
|
static <R> Parser<R> | integerParser(String name, 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(String name, FromString<R> fs)
gets a Parser object to parse token of arbitrary length integer. |
static <R> Parser<R> | integerParser(FromLong<R> fc)
gets a Parser object to parse Long token. |
static <R> Parser<R> | quotedWordParser(String name, FromString3<R> fc)
gets a Parser object to parse TokenQuoted. |
static <R> Parser<R> | quotedWordParser(FromString3<R> fc)
gets a Parser object to parse TokenQuoted. |
static <R> Parser<R> | stringParser(String name, FromString<R> fc)
gets a Parser object to parse String token. |
static <R> Parser<R> | stringParser(FromString<R> fc)
gets a Parser object to parse String token. |
static <R> Parser<R> | wordParser(String name, FromString<R> fc)
gets a Parser object to parse TokenWord. |
static <R> Parser<R> | wordParser(FromString<R> fc)
gets a Parser object to parse TokenWord. |
Parameters: name the parser name. fc the mapping to map char to an object returned by the parser.
Returns: the parser
Parameters: fc the mapping to map char to an object returned by the parser.
Returns: the parser
Parameters: name the parser name. fc the mapping to map the decimal to an object returned by the parser.
Returns: the parser
Parameters: fc the mapping to map the decimal to an object returned by the parser.
Returns: the parser
Parameters: type the token type recognized. f the FromString object used to translate the character range to a certain object.
Returns: the FromToken object.
Since: version 1.1
Parameters: types the token types recognized. f the FromString object used to translate the character range to a certain object.
Returns: the FromToken object.
Since: version 1.1
Deprecated: Use (String[], String[])
instead.
Parameters: ops the operator names. keywords the keyword names.
Returns: the Terms instance.
Deprecated: Use (Parser, String[], String[])
instead.
Parameters: wscanner the scanner that identifies a word in the language. ops the operator names. keywords the keyword names.
Returns: the Terms instance.
Deprecated: Use (Parser, String[], String[], FromString)
instead.
Parameters: 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.
Returns: the Terms instance.
Parameters: ops the operator names. keywords the keyword names.
Returns: the Terms instance.
Since: version 1.1
Parameters: wscanner the scanner that identifies a word in the language. ops the operator names. keywords the keyword names.
Returns: the Terms instance.
Since: version 1.1
Parameters: 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.
Returns: the Terms instance.
Since: version 1.1
Deprecated: Use (String[], String[])
instead.
Parameters: ops the operator names. keywords the keyword names.
Returns: the Terms instance.
Deprecated: Use (Parser, String[], String[])
instead.
Parameters: wscanner the scanner that identifies a word in the language. ops the operator names. keywords the keyword names.
Returns: the Terms instance.
Deprecated: Use (Parser, String[], String[], FromString)
instead.
Parameters: 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.
Returns: the Terms instance.
Parameters: ops the operator names. keywords the keyword names.
Returns: the Terms instance.
Since: version 1.1
Parameters: wscanner the scanner that identifies a word in the language. ops the operator names. keywords the keyword names.
Returns: the Terms instance.
Since: version 1.1
Parameters: 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.
Returns: the Terms instance.
Since: version 1.1
Returns: the lexer.
Deprecated: Use (String[])
instead.
Parameters: ops the operator names.
Returns: the Terms instance.
Parameters: ops the operator names.
Returns: the Terms instance.
Since: version 1.1
Parameters: tnames the names of the terminals.
Returns: the Parser.
Parameters: name the name of the parser. tnames the names of the terminals.
Returns: the Parser.
Parameters: tnames the names of the terminals. expected the label when this parser fails.
Returns: the Parser.
Parameters: name the name of the parser. tnames the names of the terminals. expected the label when this parser fails.
Returns: the Parser.
Parameters: name the name of the parser. tname the name of the terminal. expected the label when this parser fails.
Returns: the Parser.
Parameters: tname the name of the terminal. expected the label when this parser fails.
Returns: the Parser.
Parameters: tname the name of the terminal.
Returns: the Parser.
Parameters: name the parser name. fc the mapping to map the number to an object returned by the parser.
Returns: the parser
Parameters: fs the mapping to map the number to an object returned by the parser.
Returns: the parser
Parameters: name the parser name. fs the mapping to map the number to an object returned by the parser.
Returns: the parser
Parameters: fc the mapping to map the number to an object returned by the parser.
Returns: the parser
Parameters: name the parser name. fc the mapping to map the quoted string to an object returned by the parser.
Returns: the parser
Parameters: fc the mapping to map the quoted string to an object returned by the parser.
Returns: the parser
Parameters: name the parser name. fc the mapping to map String to an object returned by the parser.
Returns: the parser
Parameters: fc the mapping to map String to an object returned by the parser.
Returns: the parser
Parameters: name the parser name. fc the mapping to map the word to an object returned by the parser.
Returns: the parser
Parameters: fc the mapping to map the word to an object returned by the parser.
Returns: the parser