Top Description Inners Fields Constructors Methods
org.jparsec

public final Class Terminals

extends Lexicon
Class Inheritance
Static Imports
java.util.Arrays.asList, org.jparsec.internal.util.Checks.checkArgument

Provides convenient API to build lexer and parsers for terminals. The following example is a parser snippet for Java generic type expression such as List<String>:
   Terminals terms = Terminals
      .operators("?", "<", ">", ",")
      .words(Scanners.IDENTIFIER)
      .keywords("super", "extends")
      .build();
  Parser<String> typeName = Terminals.identifier();
  Parser<?> wildcardWithUpperBound = terms.phrase("?", "extends");
  ...
  parser.from(terms.tokenizer(), Scanners.WHITESPACES.optional()).parse("List<String>");
Author
Ben Yu

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class
Terminals.Builder

Builds Terminals instance by defining the words and keywords recognized.

public static class
Terminals.CharLiteral

Entry point for parser and tokenizers of character literal.

public static class
Terminals.DecimalLiteral

Entry point for parser and tokenizers of decimal number literal represented as String.

public static class
Terminals.Identifier

Entry point for parser and tokenizers of regular identifier.

public static class
Terminals.IntegerLiteral

Entry point for any arbitrary integer literal represented as a String.

public static class
Terminals.LongLiteral

Entry point for parser and tokenizers of integral number literal represented as Long.

public static class
Terminals.ScientificNumberLiteral

Entry point for parser and tokenizers of scientific notation literal.

public static class
Terminals.StringLiteral

Entry point for parser and tokenizers of string literal.

Field Summary

Modifier and TypeField and Description
public static final Parser<String>
RESERVED

Parser that recognizes reserved word tokens.

Inherited from org.jparsec.Lexicon:
tokenizerwords

Constructor Summary

AccessConstructor and Description
private
Terminals(Lexicon lexicon)

Method Summary

Modifier and TypeMethod and Description
public static Terminals

Returns:

the Terminals instance.
caseInsensitive
(String[]
the operator names.
ops
,
String[]
the keyword names.
keywords
)
Deprecated Use operators(ops) .words(Scanners.IDENTIFIER) .caseInsensitiveKeywords(keywords) .build() instead.

Returns a Terminals object for lexing and parsing the operators with names specified in ops, and for lexing and parsing the keywords case insensitively.

public static Terminals

Returns:

the Terminals instance.
caseInsensitive
(Parser<String>
the scanner that returns a word in the language.
wordScanner
,
String[]
the operator names.
ops
,
String[]
the keyword names.
keywords
)
Deprecated Use operators(ops) .words(wordScanner) .caseInsensitiveKeywords(keywords) .build() instead.

Returns a Terminals object for lexing and parsing the operators with names specified in ops, and for lexing and parsing the keywords case insensitively.

public static Terminals

Returns:

the Terminals instance.
caseInsensitive
(Parser<String>
the scanner that returns a word in the language.
wordScanner
,
String[]
the operator names.
ops
,
String[]
the keyword names.
keywords
,
Function<String, ?>
maps the text to a token value for non-keywords recognized by wordScanner.
wordMap
)
Deprecated Use operators(ops) .words(wordScanner) .tokenizeWordsWith(wordMap) .caseInsensitiveKeywords(keywords) .build() instead.

Returns a Terminals object for lexing and parsing the operators with names specified in ops, and for lexing and parsing the keywords case insensitively.

public static Terminals

Returns:

the Terminals instance.
caseSensitive
(String[]
the operator names.
ops
,
String[]
the keyword names.
keywords
)
Deprecated Use operators(ops) .words(Scanners.IDENTIFIER) .keywords(keywords) .build() instead.

Returns a Terminals object for lexing and parsing the operators with names specified in ops, and for lexing and parsing the keywords case sensitively.

public static Terminals

Returns:

the Terminals instance.
caseSensitive
(Parser<String>
the scanner that returns a word in the language.
wordScanner
,
String[]
the operator names.
ops
,
String[]
the keyword names.
keywords
)
Deprecated Use operators(ops) .words(wordScanner) .keywords(keywords) .build() instead.

Returns a Terminals object for lexing and parsing the operators with names specified in ops, and for lexing and parsing the keywords case sensitively.

public static Terminals

Returns:

the Terminals instance.
caseSensitive
(Parser<String>
the scanner that returns a word in the language.
wordScanner
,
String[]
the operator names.
ops
,
String[]
the keyword names.
keywords
,
Function<String, ?>
maps the text to a token value for non-keywords recognized by wordScanner.
wordMap
)
Deprecated Use operators(ops) .words(wordScanner) .tokenizeWordsWith(wordMap) .keywords(keywords) .build() instead.

Returns a Terminals object for lexing and parsing the operators with names specified in ops, and for lexing and parsing the keywords case sensitively.

pack-priv static void
public static Parser<String>
fragment(final Object... tags)

Returns a Parser that recognizes Tokens.Fragment token values tagged with one of tags.

pack-priv static TokenMap<String>
fromFragment(final Object... tags)

Returns a TokenMap object that only recognizes Tokens.Fragment token values tagged with one of tags.

public static Parser<String>
identifier()

Returns a Parser that recognizes identifiers (a.k.a words, variable names etc).

public static Terminals

Returns:

the Terminals instance.
operators
(String...
the operator names.
ops
)

Returns a Terminals object for lexing the operators with names specified in ops.

public static Terminals

Returns:

the Terminals instance.
operators
(Collection<String>
the operator names.
ops
)

Returns a Terminals object for lexing the operators with names specified in ops.

public Terminals.Builder
words(Parser<String>
defines words recognized by the new instance
wordScanner
)

Starts to build a new Terminals instance that recognizes words not already recognized by this Terminals instance (typically operators).

Inherited from org.jparsec.Lexicon:
fallbackphrasetokentokentokenizerunionword

Field Detail

RESERVEDback to summary
public static final Parser<String> RESERVED

Parser that recognizes reserved word tokens. i.e. Tokens.Fragment tokens tagged as Tag#RESERVED. Fragment#text() is returned as parser result.

Constructor Detail

Terminalsback to summary
private Terminals(Lexicon lexicon)

Method Detail

caseInsensitiveback to summary
public static Terminals caseInsensitive(String[] ops, String[] keywords)

Deprecated

Use operators(ops) .words(Scanners.IDENTIFIER) .caseInsensitiveKeywords(keywords) .build() instead.

Returns a Terminals object for lexing and parsing the operators with names specified in ops, and for lexing and parsing the keywords case insensitively. Parsers for operators and keywords can be obtained through token; parsers for identifiers through identifier.

In detail, keywords and operators are lexed as Tokens.Fragment with Tag#RESERVED tag. Words that are not among keywords are lexed as Fragment with Tag#IDENTIFIER tag.

A word is defined as an alphanumeric string that starts with [_a - zA - Z], with 0 or more [0 - 9_a - zA - Z] following.

Parameters
ops:String[]

the operator names.

keywords:String[]

the keyword names.

Returns:Terminals

the Terminals instance.

Annotations
@Deprecated
caseInsensitiveback to summary
public static Terminals caseInsensitive(Parser<String> wordScanner, String[] ops, String[] keywords)

Deprecated

Use operators(ops) .words(wordScanner) .caseInsensitiveKeywords(keywords) .build() instead.

Returns a Terminals object for lexing and parsing the operators with names specified in ops, and for lexing and parsing the keywords case insensitively. Parsers for operators and keywords can be obtained through token; parsers for identifiers through identifier.

In detail, keywords and operators are lexed as Tokens.Fragment with Tag#RESERVED tag. Words that are not among keywords are lexed as Fragment with Tag#IDENTIFIER tag.

Parameters
wordScanner:Parser<String>

the scanner that returns a word in the language.

ops:String[]

the operator names.

keywords:String[]

the keyword names.

Returns:Terminals

the Terminals instance.

Annotations
@Deprecated
caseInsensitiveback to summary
public static Terminals caseInsensitive(Parser<String> wordScanner, String[] ops, String[] keywords, Function<String, ?> wordMap)

Deprecated

Use operators(ops) .words(wordScanner) .tokenizeWordsWith(wordMap) .caseInsensitiveKeywords(keywords) .build() instead.

Returns a Terminals object for lexing and parsing the operators with names specified in ops, and for lexing and parsing the keywords case insensitively. Parsers for operators and keywords can be obtained through token; parsers for identifiers through identifier.

In detail, keywords and operators are lexed as Tokens.Fragment with Tag#RESERVED tag. Words that are not among keywords are lexed as Fragment with Tag#IDENTIFIER tag.

Parameters
wordScanner:Parser<String>

the scanner that returns a word in the language.

ops:String[]

the operator names.

keywords:String[]

the keyword names.

wordMap:Function<String, ?>

maps the text to a token value for non-keywords recognized by wordScanner.

Returns:Terminals

the Terminals instance.

Annotations
@Deprecated
caseSensitiveback to summary
public static Terminals caseSensitive(String[] ops, String[] keywords)

Deprecated

Use operators(ops) .words(Scanners.IDENTIFIER) .keywords(keywords) .build() instead.

Returns a Terminals object for lexing and parsing the operators with names specified in ops, and for lexing and parsing the keywords case sensitively. Parsers for operators and keywords can be obtained through token; parsers for identifiers through identifier.

In detail, keywords and operators are lexed as Tokens.Fragment with Tag#RESERVED tag. Words that are not among keywords are lexed as Fragment with Tag#IDENTIFIER tag.

A word is defined as an alphanumeric string that starts with [_a - zA - Z], with 0 or more [0 - 9_a - zA - Z] following.

Parameters
ops:String[]

the operator names.

keywords:String[]

the keyword names.

Returns:Terminals

the Terminals instance.

Annotations
@Deprecated
caseSensitiveback to summary
public static Terminals caseSensitive(Parser<String> wordScanner, String[] ops, String[] keywords)

Deprecated

Use operators(ops) .words(wordScanner) .keywords(keywords) .build() instead.

Returns a Terminals object for lexing and parsing the operators with names specified in ops, and for lexing and parsing the keywords case sensitively. Parsers for operators and keywords can be obtained through token; parsers for identifiers through identifier.

In detail, keywords and operators are lexed as Tokens.Fragment with Tag#RESERVED tag. Words that are not among keywords are lexed as Fragment with Tag#IDENTIFIER tag.

Parameters
wordScanner:Parser<String>

the scanner that returns a word in the language.

ops:String[]

the operator names.

keywords:String[]

the keyword names.

Returns:Terminals

the Terminals instance.

Annotations
@Deprecated
caseSensitiveback to summary
public static Terminals caseSensitive(Parser<String> wordScanner, String[] ops, String[] keywords, Function<String, ?> wordMap)

Deprecated

Use operators(ops) .words(wordScanner) .tokenizeWordsWith(wordMap) .keywords(keywords) .build() instead.

Returns a Terminals object for lexing and parsing the operators with names specified in ops, and for lexing and parsing the keywords case sensitively. Parsers for operators and keywords can be obtained through token; parsers for identifiers through identifier.

In detail, keywords and operators are lexed as Tokens.Fragment with Tag#RESERVED tag. Words that are not among keywords are lexed as Fragment with Tag#IDENTIFIER tag.

Parameters
wordScanner:Parser<String>

the scanner that returns a word in the language.

ops:String[]

the operator names.

keywords:String[]

the keyword names.

wordMap:Function<String, ?>

maps the text to a token value for non-keywords recognized by wordScanner.

Returns:Terminals

the Terminals instance.

Annotations
@Deprecated
checkDupback to summary
pack-priv static void checkDup(Iterable<String> a, Iterable<String> b)
Annotations
@Private
fragmentback to summary
public static Parser<String> fragment(final Object... tags)

Returns a Parser that recognizes Tokens.Fragment token values tagged with one of tags.

fromFragmentback to summary
pack-priv static TokenMap<String> fromFragment(final Object... tags)

Returns a TokenMap object that only recognizes Tokens.Fragment token values tagged with one of tags.

identifierback to summary
public static Parser<String> identifier()

Returns a Parser that recognizes identifiers (a.k.a words, variable names etc). Equivalent to Identifier#PARSER.

Since
2.2
operatorsback to summary
public static Terminals operators(String... ops)

Returns a Terminals object for lexing the operators with names specified in ops. Operators are lexed as Tokens.Fragment with Tag#RESERVED tag. For example, to get the parser for operator "?", simply call token("?").

If words and keywords need to be parsed, they can be configured via words.

Parameters
ops:String[]

the operator names.

Returns:Terminals

the Terminals instance.

operatorsback to summary
public static Terminals operators(Collection<String> ops)

Returns a Terminals object for lexing the operators with names specified in ops. Operators are lexed as Tokens.Fragment with Tag#RESERVED tag. For example, to get the parser for operator "?", simply call token("?").

If words and keywords need to be parsed, they can be configured via words.

Parameters
ops:Collection<String>

the operator names.

Returns:Terminals

the Terminals instance.

Since
2.2
wordsback to summary
public Terminals.Builder words(Parser<String> wordScanner)

Starts to build a new Terminals instance that recognizes words not already recognized by this Terminals instance (typically operators).

By default identifiers are recognized through identifier during token-level parsing phase. Use Builder#tokenizeWordsWith to tokenize differently, and choose an alternative token-level parser accordingly.

Parameters
wordScanner:Parser<String>

defines words recognized by the new instance

Since
2.2
org.jparsec back to summary

public final Class Terminals.Builder

extends Object
Class Inheritance

Builds Terminals instance by defining the words and keywords recognized. The following example implements a calculator with logical operators:
   Terminals terms = Terminals
      .operators("<", ">", "=", ">=", "<=")
      .words(Scanners.IDENTIFIER)
      .caseInsensitiveKeywords("and", "or")
      .build();
  Parser<String> var = Terminals.identifier();
  Parser<Integer> integer = Terminals.IntegerLiteral.PARSER.map(...);
  Parser<?> and = terms.token("and");
  Parser<?> lessThan = terms.token("<");
  ...
  Parser<?> parser = grammar.from(
      terms.tokenizer().or(IntegerLiteral.TOKENIZER), Scanners.WHITSPACES.optional());
Since
2.2

Field Summary

Modifier and TypeField and Description
private Collection<String>
private StringCase
private final Parser<String>
private Function<String, ?>

Constructor Summary

AccessConstructor and Description
pack-priv
Builder(Parser<String> wordScanner)

Method Summary

Modifier and TypeMethod and Description
public Terminals
build()

Builds a new Terminals instance that recognizes words defined in this builder.

public Terminals.Builder
caseInsensitiveKeywords(String... keywords)

Defines case insensitive keywords.

public Terminals.Builder
caseInsensitiveKeywords(Collection<String> keywords)

Defines case insensitive keywords.

public Terminals.Builder
keywords(String... keywords)

Defines keywords.

public Terminals.Builder
keywords(Collection<String> keywords)

Defines keywords.

public Terminals.Builder
tokenizeWordsWith(Function<String, ?> wordMap)

Configures alternative tokenization strategy for words (except keywords).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keywordsback to summary
private Collection<String> keywords
stringCaseback to summary
private StringCase stringCase
wordScannerback to summary
private final Parser<String> wordScanner
wordTokenMapback to summary
private Function<String, ?> wordTokenMap

Constructor Detail

Builderback to summary
pack-priv Builder(Parser<String> wordScanner)

Method Detail

buildback to summary
public Terminals build()

Builds a new Terminals instance that recognizes words defined in this builder.

caseInsensitiveKeywordsback to summary
public Terminals.Builder caseInsensitiveKeywords(String... keywords)

Defines case insensitive keywords. Keywords are special words with their own grammar rules. To get the parser for a keyword, call token(keyword).

Note that if you call keywords or caseInsensitiveKeywords multiple times on the same Builder instance, the last call overwrites previous calls.

caseInsensitiveKeywordsback to summary
public Terminals.Builder caseInsensitiveKeywords(Collection<String> keywords)

Defines case insensitive keywords. Keywords are special words with their own grammar rules. To get the parser for a keyword, call token(keyword).

Note that if you call keywords or caseInsensitiveKeywords multiple times on the same Builder instance, the last call overwrites previous calls.

keywordsback to summary
public Terminals.Builder keywords(String... keywords)

Defines keywords. Keywords are special words with their own grammar rules. To get the parser for a keyword, call token(keyword).

Note that if you call keywords or caseInsensitiveKeywords multiple times on the same Builder instance, the last call overwrites previous calls.

keywordsback to summary
public Terminals.Builder keywords(Collection<String> keywords)

Defines keywords. Keywords are special words with their own grammar rules. To get the parser for a keyword, call token(keyword).

Note that if you call keywords or caseInsensitiveKeywords multiple times on the same Builder instance, the last call overwrites previous calls.

tokenizeWordsWithback to summary
public Terminals.Builder tokenizeWordsWith(Function<String, ?> wordMap)

Configures alternative tokenization strategy for words (except keywords).

org.jparsec back to summary

public final Class Terminals.CharLiteral

extends Object
Class Inheritance

Entry point for parser and tokenizers of character literal.

Field Summary

Modifier and TypeField and Description
public static final Parser<Character>
PARSER

Parser that recognizes Character tokens.

public static final Parser<Character>
SINGLE_QUOTE_TOKENIZER

A tokenizer that parses single quoted character literal (escaped by '\'), and then converts the character to a Character token.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

PARSERback to summary
public static final Parser<Character> PARSER

Parser that recognizes Character tokens.

SINGLE_QUOTE_TOKENIZERback to summary
public static final Parser<Character> SINGLE_QUOTE_TOKENIZER

A tokenizer that parses single quoted character literal (escaped by '\'), and then converts the character to a Character token.

Constructor Detail

CharLiteralback to summary
private CharLiteral()
org.jparsec back to summary

public final Class Terminals.DecimalLiteral

extends Object
Class Inheritance

Entry point for parser and tokenizers of decimal number literal represented as String.

Field Summary

Modifier and TypeField and Description
public static final Parser<String>
PARSER

Parser that recognizes Tokens.Fragment tokens tagged as Tag#DECIMAL.

public static final Parser<Tokens.Fragment>
TOKENIZER

A tokenizer that parses a decimal number (valid patterns are: 1, 2.3, 00, 0., .23) and returns a Fragment token tagged as Tag#DECIMAL.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

PARSERback to summary
public static final Parser<String> PARSER

Parser that recognizes Tokens.Fragment tokens tagged as Tag#DECIMAL.

TOKENIZERback to summary
public static final Parser<Tokens.Fragment> TOKENIZER

A tokenizer that parses a decimal number (valid patterns are: 1, 2.3, 00, 0., .23) and returns a Fragment token tagged as Tag#DECIMAL.

Constructor Detail

DecimalLiteralback to summary
private DecimalLiteral()
org.jparsec back to summary

public final Class Terminals.Identifier

extends Object
Class Inheritance

Entry point for parser and tokenizers of regular identifier.

Field Summary

Modifier and TypeField and Description
public static final Parser<String>
PARSER

Parser that recognizes identifier tokens.

public static final Parser<Tokens.Fragment>
TOKENIZER

A tokenizer that parses any identifier and returns a Fragment token tagged as Tag#IDENTIFIER.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

PARSERback to summary
public static final Parser<String> PARSER

Parser that recognizes identifier tokens. i.e. Tokens.Fragment tokens tagged as Tag#IDENTIFIER. Fragment#text() is returned as parser result.

TOKENIZERback to summary
public static final Parser<Tokens.Fragment> TOKENIZER

A tokenizer that parses any identifier and returns a Fragment token tagged as Tag#IDENTIFIER.

An identifier starts with an alphabetic character or underscore, and is followed by 0 or more alphanumeric characters or underscore.

Constructor Detail

Identifierback to summary
private Identifier()
org.jparsec back to summary

public final Class Terminals.IntegerLiteral

extends Object
Class Inheritance

Entry point for any arbitrary integer literal represented as a String.

Field Summary

Modifier and TypeField and Description
public static final Parser<String>
PARSER

Parser that recognizes Tokens.Fragment tokens tagged as Tag#INTEGER.

public static final Parser<Tokens.Fragment>
TOKENIZER

A tokenizer that parses a integer number (valid patterns are: 0, 00, 1, 10) and returns a Fragment token tagged as Tag#INTEGER.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

PARSERback to summary
public static final Parser<String> PARSER

Parser that recognizes Tokens.Fragment tokens tagged as Tag#INTEGER.

TOKENIZERback to summary
public static final Parser<Tokens.Fragment> TOKENIZER

A tokenizer that parses a integer number (valid patterns are: 0, 00, 1, 10) and returns a Fragment token tagged as Tag#INTEGER.

Constructor Detail

IntegerLiteralback to summary
private IntegerLiteral()
org.jparsec back to summary

public final Class Terminals.LongLiteral

extends Object
Class Inheritance

Entry point for parser and tokenizers of integral number literal represented as Long.

Field Summary

Modifier and TypeField and Description
public static final Parser<Long>
DEC_TOKENIZER

A tokenizer that parses a decimal integer number (valid patterns are: 1, 10, 123), and converts the string to a Long value.

public static final Parser<Long>
HEX_TOKENIZER

A tokenizer that parses a hex integer number (valid patterns are: 0x1, 0Xff, 0xFe1 etc.), and converts the string to a Long value.

public static final Parser<Long>
OCT_TOKENIZER

A tokenizer that parses a octal integer number (valid patterns are: 0, 07, 017, 0371 etc.), and converts the string to a Long value.

public static final Parser<Long>
PARSER

Parser that recognizes Long tokens.

public static final Parser<Long>
TOKENIZER

A tokenizer that parses decimal, hex, and octal numbers and converts the string to a Long value.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEC_TOKENIZERback to summary
public static final Parser<Long> DEC_TOKENIZER

A tokenizer that parses a decimal integer number (valid patterns are: 1, 10, 123), and converts the string to a Long value.

HEX_TOKENIZERback to summary
public static final Parser<Long> HEX_TOKENIZER

A tokenizer that parses a hex integer number (valid patterns are: 0x1, 0Xff, 0xFe1 etc.), and converts the string to a Long value.

A hex number has to start with either 0x or 0X.

OCT_TOKENIZERback to summary
public static final Parser<Long> OCT_TOKENIZER

A tokenizer that parses a octal integer number (valid patterns are: 0, 07, 017, 0371 etc.), and converts the string to a Long value.

An octal number has to start with 0.

PARSERback to summary
public static final Parser<Long> PARSER

Parser that recognizes Long tokens.

TOKENIZERback to summary
public static final Parser<Long> TOKENIZER

A tokenizer that parses decimal, hex, and octal numbers and converts the string to a Long value.

Constructor Detail

LongLiteralback to summary
private LongLiteral()
org.jparsec back to summary

public final Class Terminals.ScientificNumberLiteral

extends Object
Class Inheritance

Entry point for parser and tokenizers of scientific notation literal.

Field Summary

Modifier and TypeField and Description
public static final Parser<Tokens.ScientificNotation>
PARSER

Parser that recognies ScientificNotation tokens.

public static final Parser<Tokens.ScientificNotation>
TOKENIZER

A tokenizer that parses a scientific notation and converts the string to a ScientificNotation value.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

PARSERback to summary
public static final Parser<Tokens.ScientificNotation> PARSER

Parser that recognies ScientificNotation tokens.

TOKENIZERback to summary
public static final Parser<Tokens.ScientificNotation> TOKENIZER

A tokenizer that parses a scientific notation and converts the string to a ScientificNotation value.

Constructor Detail

ScientificNumberLiteralback to summary
private ScientificNumberLiteral()
org.jparsec back to summary

public final Class Terminals.StringLiteral

extends Object
Class Inheritance

Entry point for parser and tokenizers of string literal.

Field Summary

Modifier and TypeField and Description
public static final Parser<String>
DOUBLE_QUOTE_TOKENIZER

A tokenizer that parses double quoted string literal (escaped by '\'), and transforms the quoted content by applying escape characters.

public static final Parser<String>
PARSER

Parser that recognizes String tokens.

public static final Parser<String>
SINGLE_QUOTE_TOKENIZER

A tokenizer that parses single quoted string literal (single quote is escaped with another single quote), and transforms the quoted content by applying escape characters.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DOUBLE_QUOTE_TOKENIZERback to summary
public static final Parser<String> DOUBLE_QUOTE_TOKENIZER

A tokenizer that parses double quoted string literal (escaped by '\'), and transforms the quoted content by applying escape characters.

PARSERback to summary
public static final Parser<String> PARSER

Parser that recognizes String tokens.

SINGLE_QUOTE_TOKENIZERback to summary
public static final Parser<String> SINGLE_QUOTE_TOKENIZER

A tokenizer that parses single quoted string literal (single quote is escaped with another single quote), and transforms the quoted content by applying escape characters.

Constructor Detail

StringLiteralback to summary
private StringLiteral()