Class TermLanguage
java.lang.Object
com.tangosol.coherence.dsltools.termlanguage.TermLanguage
TermLanguage is a simple language for building Terms. It is a superset
of JSON. A Term can be a, Atom which is a literal which can be a
Number, String, or Symbol or the constants true, false, or null. This
results in an AtomicTerm. A term can also be a "functor" applied to a list
of arguments that are themselves Terms. This results in a NodeTerm.
Nested list Terms are syntaticaly supported by enclosing a list of Terms
between "[" and "]". This list is translated to a NodeTerm with a functor
of ".list.". The characters "{" and"}" create NodeTerms that are similar
to lists but imply no ordering hence we translate to a NodeTerm with a
functor of ".bag.". If curlies are used with a functor then we create a
special NodeTerm whose distunguised single element is the bag of elements.
This list is translated to a NodeTerm with a functor of ".list.". The ":"
character is used as a shorthand for denoting attributes where a:b is
translated to the NodeTerm ".attr.(a(b)).Finally, ";" is used to build
sequences. A run of Terms separated by ";" results in a special NodeTerm
with functor ".sequence."
Much of our inspiration came from the E-Language's
- Author:
- djl 2009.08.31
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic TokenTable
Return an initialized TokenTable for the Term Language.
-
Constructor Details
-
TermLanguage
public TermLanguage()
-
-
Method Details
-
tokenTable
Return an initialized TokenTable for the Term Language.- Returns:
- a TokenTable for the Term Language
-