Package net.hydromatic.morel.eval
Class Codes
- java.lang.Object
-
- net.hydromatic.morel.eval.Codes
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classCodes.AndAlsoCodeCode that implementsandAlso(Code, Code).private static classCodes.ApplyCodeApplies anApplicableto aCode.private static classCodes.ApplyCode2Applies anApplicable2to twoCodearguments.private static classCodes.ApplyCode3Applies anApplicable3to threeCodearguments.(package private) static classCodes.ApplyCodeCodestatic classCodes.BuiltInExnDefinitions of Morel built-in exceptions.private static classCodes.CollectRowSinkImplementation ofCodes.RowSinkthat the last step of afromwrites into.private static classCodes.ConstantCodeCode that implements a constant.private static classCodes.GetCodeCode that retrieves the value of a variable from the environment.private static classCodes.GetTupleCodeCode that retrieves, as a tuple, the value of several variables from the environment.private static classCodes.GroupRowSinkImplementation ofCodes.RowSinkfor agroupclause.private static classCodes.InteractUseImplementsBuiltIn.INTERACT_USE.private static classCodes.Let1CodeCode that implementslet(List, Code)with one argument.private static classCodes.LetCodeCode that implementslet(List, Code)with multiple arguments.private static classCodes.ListHdImplementsBuiltIn.LIST_HD.private static classCodes.ListLastImplementsBuiltIn.LIST_LAST.private static classCodes.ListNthImplementsBuiltIn.LIST_NTHandBuiltIn.VECTOR_SUB.private static classCodes.ListTabulateImplementsBuiltIn.LIST_TABULATE.private static classCodes.ListTakeImplementsBuiltIn.LIST_TAKE.private static classCodes.ListTlImplementsBuiltIn.LIST_TL.static classCodes.MorelRuntimeExceptionJava exception that wraps an exception thrown by the Morel runtime.private static classCodes.OptionValOfImplementsBuiltIn.OPTION_VAL_OF.(package private) static classCodes.OrderRowSinkImplementation ofCodes.RowSinkfor anorderclause.private static classCodes.OrElseCodeCode that implementsorElse(Code, Code).static interfaceCodes.PositionedAnApplicablewhose position can be changed.private static classCodes.RealCheckFloatImplementsBuiltIn.REAL_CHECK_FLOAT.private static classCodes.RealCompareImplementsBuiltIn.REAL_COMPARE.private static classCodes.RealSignImplementsBuiltIn.REAL_COMPARE.private static classCodes.RelationalOnlyImplementsBuiltIn.RELATIONAL_ONLY.static interfaceCodes.RowSinkAccepts rows produced by a supplier as part of afromclause.(package private) static classCodes.ScanRowSinkImplementation ofCodes.RowSinkfor ajoinclause.private static classCodes.StringConcatImplementsBuiltIn.STRING_CONCAT.private static classCodes.StringConcatWithImplementsBuiltIn.STRING_CONCAT_WITH.private static classCodes.StringExtractImplementsBuiltIn.STRING_SUB.private static classCodes.StringSubImplementsBuiltIn.STRING_SUB.private static classCodes.StringSubstringImplementsBuiltIn.STRING_SUBSTRING.static classCodes.TupleCodeA code that evaluates expressions and creates a tuple with the results.private static classCodes.VectorUpdateImplementsBuiltIn.VECTOR_UPDATE.(package private) static classCodes.WhereRowSinkImplementation ofCodes.RowSinkfor awhereclause.(package private) static classCodes.WrapRelListprivate static classCodes.YieldRowSinkImplementation ofCodes.RowSinkfor ayieldstep.
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description privateCodes()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Applicableaggregate(Environment env0, Code aggregateCode, List<String> names, Code argumentCode)private static ApplicableImplall(BuiltIn builtIn)static CodeandAlso(Code code0, Code code1)Returns a Code that evaluates "andalso".static StringBuilderappendFloat(StringBuilder buf, float f)static Codeapply(Applicable fnValue, Code argCode)Generates the code for applying a function value to an argument.static Codeapply(Code fnCode, Code argCode)Generates the code for applying a function (or function value) to an argument.static Codeapply2(Applicable2 fnValue, Code argCode0, Code argCode1)Generates the code for applying a function value to two arguments.static Codeapply3(Applicable3 fnValue, Code argCode0, Code argCode1, Code argCode2)Generates the code for applying a function value to three arguments.private static ApplicableImplcollate(BuiltIn builtIn)private static Applicablecollate(Applicable comparator)static Codes.RowSinkcollectRowSink(Code code)Creates aCodes.RowSinkto collect the results of afromexpression.static Codeconstant(Object value)Returns a Code that evaluates to the same value in all environments.static Stringdescribe(Code code)Describes aCode.static EvalEnvemptyEnv()Creates an empty evaluation environment.static EvalEnvemptyEnvWith(Session session, Environment env)Creates an evaluation environment that contains the bound values from a compilation environment.static Environmentenv(TypeSystem typeSystem, Environment environment)Creates a compilation environment.private static ApplicableImplexists(BuiltIn builtIn)private static ApplicableImplfind(BuiltIn builtIn)private static Applicablefind(Applicable f)(package private) static StringfloatToString(float f)Converts a Javafloatto the format expected of Standard MLrealvalues.static Codefrom(Supplier<Codes.RowSink> rowSinkFactory)private static Map<Applicable,BuiltIn>get()static Codeget(String name)Returns a Code that returns the value of variable "name" in the current environment.static CodegetTuple(Iterable<String> names)Returns a Code that returns a tuple consisting of the values of variables "name0", ...static Codes.RowSinkgroupRowSink(Code keyCode, com.google.common.collect.ImmutableList<Applicable> aggregateCodes, com.google.common.collect.ImmutableList<String> inNames, com.google.common.collect.ImmutableList<String> keyNames, com.google.common.collect.ImmutableList<String> outNames, Codes.RowSink rowSink)Creates aCodes.RowSinkfor agroupclause.private static ApplicableImplisEmpty(BuiltIn builtIn)private static ApplicableImplisNotEmpty(BuiltIn builtIn)private static ApplicableisPrefix(String s)private static ApplicableisSubstring(String s)private static ApplicableisSuffix(String s)private static ApplicableImpllength(BuiltIn builtIn)static Codelet(List<Code> matchCodes, Code resultCode)static Codelist(Iterable<? extends Code> codes)private static ApplicablelistAll(Applicable f)private static ApplicablelistApp(Applicable consumer)private static ApplicablelistExists(Applicable f)private static ApplicablelistFilter(Applicable f)private static ApplicablelistFold(boolean left, Applicable f)private static ApplicablelistFold2(boolean left, Applicable f, Object init)private static ApplicablelistMap(Applicable fn)private static ApplicablelistMapPartial(Applicable f)private static ApplicablelistPartition(Applicable f)private static EvalEnvmakeEmptyEnv()static Applicablenth(int slot)Returns an applicable that returns theslotth field of a tuple or record.private static ApplicableoptionApp(Applicable f)ImplementsOPTION_APP.private static ApplicableoptionCompose(Applicable f, Applicable g)ImplementsOPTION_COMPOSE.private static ApplicableoptionComposePartial(Applicable f, Applicable g)ImplementsOPTION_COMPOSE_PARTIAL.private static ApplicableoptionFilter(Applicable f)Implementation ofOPTION_FILTER.private static ApplicableoptionMap(Applicable f)ImplementsOPTION_MAP.private static ApplicableoptionMapPartial(Applicable f)ImplementsOPTION_MAP_PARTIAL.private static ListoptionSome(Object o)Creates a value ofSOME v.static Codes.RowSinkorderRowSink(com.google.common.collect.ImmutableList<Pair<Code,Boolean>> codes, com.google.common.collect.ImmutableList<Binding> bindings, Codes.RowSink rowSink)Creates aCodes.RowSinkfor aorderclause.static CodeorElse(Code code0, Code code1)Returns a Code that evaluates "orelse".private static voidpopulateBuiltIns(Map<String,Object> valueMap)static Codes.RowSinkscanRowSink(Op op, Core.Pat pat, Code code, Code conditionCode, Codes.RowSink rowSink)Creates aCodes.RowSinkfor ajoinclause.private static StringstringConcat(Pos pos, String separator, List<String> list)private static ApplicablestringMap(Applicable f)static Codestrip(Code code)Removes wrappers, in particular the one due towrapRelList(Code).private static Core.ExpsysEnv(TypeSystem typeSystem, Environment env, Type argType)private static Applicabletranslate(Applicable f)static Codetuple(Iterable<? extends Code> codes)static ApplicabletyCon(Type dataType, String name)Returns an applicable that constructs an instance of a datatype.private static ApplicableImplunion(BuiltIn builtIn)private static ApplicablevectorApp(Applicable f)ImplementsVECTOR_APP.private static ApplicablevectorAppi(Applicable f)ImplementsVECTOR_APPI.private static ApplicablevectorFindi(Applicable f)ImplementsVECTOR_FINDI.private static ApplicablevectorMap(Applicable f)ImplementsVECTOR_MAP.private static ApplicablevectorMapi(Applicable f)ImplementsVECTOR_MAPI.static Codes.RowSinkwhereRowSink(Code filterCode, Codes.RowSink rowSink)Creates aCodes.RowSinkfor awhereclause.static CodewrapRelList(Code code)static Codes.RowSinkyieldRowSink(Map<String,Code> yieldCodes, Codes.RowSink rowSink)Creates aCodes.RowSinkfor a non-terminalyieldstep.
-
-
-
Field Detail
-
OPTION_NONE
private static final List OPTION_NONE
Value ofNONE.- See Also:
optionSome(Object)
-
OP_EQ
private static final Applicable OP_EQ
- See Also:
BuiltIn.OP_EQ
-
OP_NE
private static final Applicable OP_NE
- See Also:
BuiltIn.OP_NE
-
OP_LT
private static final Applicable OP_LT
- See Also:
BuiltIn.OP_LT
-
OP_GT
private static final Applicable OP_GT
- See Also:
BuiltIn.OP_GT
-
OP_LE
private static final Applicable OP_LE
- See Also:
BuiltIn.OP_LE
-
OP_GE
private static final Applicable OP_GE
- See Also:
BuiltIn.OP_GE
-
OP_ELEM
private static final Applicable OP_ELEM
- See Also:
BuiltIn.OP_ELEM
-
OP_NOT_ELEM
private static final Applicable OP_NOT_ELEM
- See Also:
BuiltIn.OP_NOT_ELEM
-
Z_NEGATE_INT
private static final Applicable Z_NEGATE_INT
ImplementsOP_NEGATEfor typeint.
-
Z_NEGATE_REAL
private static final Applicable Z_NEGATE_REAL
ImplementsOP_NEGATEfor typereal.
-
Z_PLUS_INT
private static final Applicable Z_PLUS_INT
ImplementsOP_PLUSfor typeint.
-
Z_PLUS_REAL
private static final Applicable Z_PLUS_REAL
ImplementsOP_PLUSfor typereal.
-
Z_MINUS_INT
private static final Applicable Z_MINUS_INT
ImplementsOP_MINUSfor typeint.
-
Z_MINUS_REAL
private static final Applicable Z_MINUS_REAL
ImplementsOP_MINUSfor typereal.
-
Z_TIMES_INT
private static final Applicable Z_TIMES_INT
ImplementsOP_TIMESfor typeint.
-
Z_TIMES_REAL
private static final Applicable Z_TIMES_REAL
ImplementsOP_TIMESfor typereal.
-
Z_DIVIDE_INT
private static final Applicable Z_DIVIDE_INT
ImplementsOP_DIVIDEfor typeint.
-
Z_DIVIDE_REAL
private static final Applicable Z_DIVIDE_REAL
ImplementsOP_DIVIDEfor typereal.
-
OP_NEGATE
private static final Macro OP_NEGATE
- See Also:
BuiltIn.OP_NEGATE
-
OP_DIVIDE
private static final Macro OP_DIVIDE
- See Also:
BuiltIn.OP_DIVIDE
-
OP_DIV
private static final Applicable OP_DIV
- See Also:
BuiltIn.OP_DIV
-
GENERAL_OP_O
private static final Applicable GENERAL_OP_O
- See Also:
BuiltIn.GENERAL_OP_O
-
INTERACT_USE
private static final Applicable INTERACT_USE
- See Also:
BuiltIn.INTERACT_USE
-
OP_CARET
private static final Applicable OP_CARET
- See Also:
BuiltIn.OP_CARET
-
OP_CONS
private static final Applicable OP_CONS
- See Also:
BuiltIn.OP_CONS
-
OP_EXCEPT
private static final Applicable OP_EXCEPT
- See Also:
BuiltIn.OP_EXCEPT
-
OP_INTERSECT
private static final Applicable OP_INTERSECT
- See Also:
BuiltIn.OP_INTERSECT
-
OP_UNION
private static final Applicable OP_UNION
- See Also:
BuiltIn.OP_UNION
-
NOT
private static final Applicable NOT
An applicable that negates a boolean value.
-
ABS
private static final Applicable ABS
An applicable that returns the absolute value of an int.
-
IGNORE
private static final Applicable IGNORE
- See Also:
BuiltIn.IGNORE
-
OP_MINUS
private static final Macro OP_MINUS
- See Also:
BuiltIn.OP_MINUS
-
OP_MOD
private static final Applicable OP_MOD
- See Also:
BuiltIn.OP_MOD
-
OP_PLUS
private static final Macro OP_PLUS
- See Also:
BuiltIn.OP_PLUS
-
OP_TIMES
private static final Macro OP_TIMES
- See Also:
BuiltIn.OP_TIMES
-
STRING_MAX_SIZE
private static final Integer STRING_MAX_SIZE
- See Also:
BuiltIn.STRING_MAX_SIZE
-
STRING_SIZE
private static final Applicable STRING_SIZE
- See Also:
BuiltIn.STRING_SIZE
-
STRING_SUB
private static final Applicable STRING_SUB
- See Also:
BuiltIn.STRING_SUB
-
STRING_EXTRACT
private static final Applicable STRING_EXTRACT
- See Also:
BuiltIn.STRING_EXTRACT
-
STRING_SUBSTRING
private static final Applicable STRING_SUBSTRING
- See Also:
BuiltIn.STRING_SUBSTRING
-
STRING_CONCAT
private static final Applicable STRING_CONCAT
- See Also:
BuiltIn.STRING_CONCAT
-
STRING_CONCAT_WITH
private static final Applicable STRING_CONCAT_WITH
- See Also:
BuiltIn.STRING_CONCAT_WITH
-
STRING_STR
private static final Applicable STRING_STR
- See Also:
BuiltIn.STRING_STR
-
STRING_IMPLODE
private static final Applicable STRING_IMPLODE
- See Also:
BuiltIn.STRING_IMPLODE
-
STRING_EXPLODE
private static final Applicable STRING_EXPLODE
- See Also:
BuiltIn.STRING_EXPLODE
-
STRING_MAP
private static final Applicable STRING_MAP
- See Also:
BuiltIn.STRING_MAP
-
STRING_TRANSLATE
private static final Applicable STRING_TRANSLATE
- See Also:
BuiltIn.STRING_TRANSLATE
-
STRING_IS_PREFIX
private static final Applicable STRING_IS_PREFIX
- See Also:
BuiltIn.STRING_IS_PREFIX
-
STRING_IS_SUBSTRING
private static final Applicable STRING_IS_SUBSTRING
- See Also:
BuiltIn.STRING_IS_SUBSTRING
-
STRING_IS_SUFFIX
private static final Applicable STRING_IS_SUFFIX
- See Also:
BuiltIn.STRING_IS_SUFFIX
-
LIST_NULL
private static final Applicable LIST_NULL
- See Also:
BuiltIn.LIST_NULL
-
LIST_LENGTH
private static final Applicable LIST_LENGTH
- See Also:
BuiltIn.LIST_LENGTH
-
LIST_AT
private static final Applicable LIST_AT
- See Also:
BuiltIn.LIST_AT
-
LIST_HD
private static final Applicable LIST_HD
- See Also:
BuiltIn.LIST_HD
-
LIST_TL
private static final Applicable LIST_TL
- See Also:
BuiltIn.LIST_TL
-
LIST_LAST
private static final Applicable LIST_LAST
- See Also:
BuiltIn.LIST_LAST
-
LIST_GET_ITEM
private static final Applicable LIST_GET_ITEM
- See Also:
BuiltIn.LIST_GET_ITEM
-
LIST_NTH
private static final Applicable LIST_NTH
- See Also:
BuiltIn.LIST_NTH
-
LIST_TAKE
private static final Applicable LIST_TAKE
- See Also:
BuiltIn.LIST_TAKE
-
LIST_DROP
private static final Applicable LIST_DROP
- See Also:
BuiltIn.LIST_DROP
-
LIST_REV
private static final Applicable LIST_REV
- See Also:
BuiltIn.LIST_REV
-
LIST_CONCAT
private static final Applicable LIST_CONCAT
- See Also:
BuiltIn.LIST_CONCAT
-
LIST_REV_APPEND
private static final Applicable LIST_REV_APPEND
- See Also:
BuiltIn.LIST_REV_APPEND
-
LIST_APP
private static final Applicable LIST_APP
- See Also:
BuiltIn.LIST_APP
-
LIST_MAP
private static final Applicable LIST_MAP
- See Also:
BuiltIn.LIST_MAP
-
LIST_MAP_PARTIAL
private static final Applicable LIST_MAP_PARTIAL
- See Also:
BuiltIn.LIST_MAP_PARTIAL
-
LIST_FIND
private static final Applicable LIST_FIND
- See Also:
BuiltIn.LIST_FIND
-
LIST_FILTER
private static final Applicable LIST_FILTER
- See Also:
BuiltIn.LIST_FILTER
-
LIST_PARTITION
private static final Applicable LIST_PARTITION
- See Also:
BuiltIn.LIST_PARTITION
-
LIST_FOLDL
private static final Applicable LIST_FOLDL
- See Also:
BuiltIn.LIST_FOLDL
-
LIST_FOLDR
private static final Applicable LIST_FOLDR
- See Also:
BuiltIn.LIST_FOLDR
-
LIST_EXISTS
private static final Applicable LIST_EXISTS
- See Also:
BuiltIn.LIST_EXISTS
-
LIST_ALL
private static final Applicable LIST_ALL
- See Also:
BuiltIn.LIST_ALL
-
LIST_TABULATE
private static final Applicable LIST_TABULATE
- See Also:
BuiltIn.LIST_TABULATE
-
LIST_COLLATE
private static final Applicable LIST_COLLATE
- See Also:
BuiltIn.LIST_COLLATE
-
MATH_ACOS
private static final Applicable MATH_ACOS
- See Also:
BuiltIn.MATH_ACOS
-
MATH_ASIN
private static final Applicable MATH_ASIN
- See Also:
BuiltIn.MATH_ASIN
-
MATH_ATAN
private static final Applicable MATH_ATAN
- See Also:
BuiltIn.MATH_ATAN
-
MATH_ATAN2
private static final Applicable MATH_ATAN2
- See Also:
BuiltIn.MATH_ATAN2
-
MATH_COS
private static final Applicable MATH_COS
- See Also:
BuiltIn.MATH_COS
-
MATH_COSH
private static final Applicable MATH_COSH
- See Also:
BuiltIn.MATH_COSH
-
MATH_E
private static final float MATH_E
- See Also:
BuiltIn.MATH_E, Constant Field Values
-
MATH_EXP
private static final Applicable MATH_EXP
- See Also:
BuiltIn.MATH_EXP
-
MATH_LN
private static final Applicable MATH_LN
- See Also:
BuiltIn.MATH_LN
-
MATH_LOG10
private static final Applicable MATH_LOG10
- See Also:
BuiltIn.MATH_LOG10
-
MATH_PI
private static final float MATH_PI
- See Also:
BuiltIn.MATH_PI, Constant Field Values
-
MATH_POW
private static final Applicable MATH_POW
- See Also:
BuiltIn.MATH_POW
-
MATH_SIN
private static final Applicable MATH_SIN
- See Also:
BuiltIn.MATH_SIN
-
MATH_SINH
private static final Applicable MATH_SINH
- See Also:
BuiltIn.MATH_SINH
-
MATH_SQRT
private static final Applicable MATH_SQRT
- See Also:
BuiltIn.MATH_SQRT
-
MATH_TAN
private static final Applicable MATH_TAN
- See Also:
BuiltIn.MATH_TAN
-
MATH_TANH
private static final Applicable MATH_TANH
- See Also:
BuiltIn.MATH_TANH
-
OPTION_APP
private static final Applicable OPTION_APP
- See Also:
BuiltIn.OPTION_APP
-
OPTION_GET_OPT
private static final Applicable OPTION_GET_OPT
- See Also:
BuiltIn.OPTION_GET_OPT
-
OPTION_IS_SOME
private static final Applicable OPTION_IS_SOME
- See Also:
BuiltIn.OPTION_IS_SOME
-
OPTION_VAL_OF
private static final Applicable OPTION_VAL_OF
- See Also:
BuiltIn.OPTION_VAL_OF
-
OPTION_FILTER
private static final Applicable OPTION_FILTER
- See Also:
BuiltIn.OPTION_FILTER
-
OPTION_FLATTEN
private static final Applicable OPTION_FLATTEN
- See Also:
BuiltIn.OPTION_FLATTEN
-
OPTION_MAP
private static final Applicable OPTION_MAP
- See Also:
BuiltIn.OPTION_MAP
-
OPTION_MAP_PARTIAL
private static final Applicable OPTION_MAP_PARTIAL
- See Also:
BuiltIn.OPTION_MAP_PARTIAL
-
OPTION_COMPOSE
private static final Applicable OPTION_COMPOSE
- See Also:
BuiltIn.OPTION_COMPOSE
-
OPTION_COMPOSE_PARTIAL
private static final Applicable OPTION_COMPOSE_PARTIAL
- See Also:
BuiltIn.OPTION_COMPOSE_PARTIAL
-
REAL_ABS
private static final Applicable REAL_ABS
- See Also:
BuiltIn.REAL_ABS
-
REAL_CEIL
private static final Applicable REAL_CEIL
- See Also:
BuiltIn.REAL_CEIL
-
REAL_CHECK_FLOAT
private static final Applicable REAL_CHECK_FLOAT
- See Also:
BuiltIn.REAL_CHECK_FLOAT
-
REAL_COMPARE
private static final Applicable REAL_COMPARE
- See Also:
BuiltIn.REAL_COMPARE
-
REAL_COPY_SIGN
private static final Applicable REAL_COPY_SIGN
- See Also:
BuiltIn.REAL_COPY_SIGN
-
REAL_FLOOR
private static final Applicable REAL_FLOOR
- See Also:
BuiltIn.REAL_FLOOR
-
REAL_FROM_INT
private static final Applicable REAL_FROM_INT
- See Also:
BuiltIn.REAL_FROM_INT
-
REAL_FROM_MAN_EXP
private static final Applicable REAL_FROM_MAN_EXP
- See Also:
BuiltIn.REAL_FROM_MAN_EXP
-
FLOAT_PATTERN
static final Pattern FLOAT_PATTERN
Pattern for floating point numbers (after '~' has been converted to '-'). ".", ".e", ".e-", ".e5", "e7" are invalid; "2.", ".5", "2.e5", "2.e" are valid.
-
REAL_FROM_STRING
private static final Applicable REAL_FROM_STRING
- See Also:
BuiltIn.REAL_FROM_STRING
-
REAL_IS_FINITE
private static final Applicable REAL_IS_FINITE
- See Also:
BuiltIn.REAL_IS_FINITE
-
REAL_IS_NAN
private static final Applicable REAL_IS_NAN
- See Also:
BuiltIn.REAL_IS_NAN
-
REAL_IS_NORMAL
private static final Applicable REAL_IS_NORMAL
- See Also:
BuiltIn.REAL_IS_NORMAL
-
REAL_NEG_INF
private static final float REAL_NEG_INF
- See Also:
BuiltIn.REAL_NEG_INF, Constant Field Values
-
REAL_POS_INF
private static final float REAL_POS_INF
- See Also:
BuiltIn.REAL_POS_INF, Constant Field Values
-
REAL_RADIX
private static final int REAL_RADIX
- See Also:
BuiltIn.REAL_RADIX, Constant Field Values
-
REAL_PRECISION
private static final int REAL_PRECISION
- See Also:
BuiltIn.REAL_PRECISION, Constant Field Values
-
REAL_MIN
private static final Applicable REAL_MIN
- See Also:
BuiltIn.REAL_MIN
-
REAL_MAX
private static final Applicable REAL_MAX
- See Also:
BuiltIn.REAL_MAX
-
REAL_MAX_FINITE
private static final float REAL_MAX_FINITE
- See Also:
BuiltIn.REAL_MAX_FINITE, Constant Field Values
-
REAL_MIN_POS
private static final float REAL_MIN_POS
- See Also:
BuiltIn.REAL_MIN_POS, Constant Field Values
-
REAL_MIN_NORMAL_POS
private static final float REAL_MIN_NORMAL_POS
- See Also:
BuiltIn.REAL_MIN_NORMAL_POS, Constant Field Values
-
REAL_REAL_MOD
private static final Applicable REAL_REAL_MOD
- See Also:
BuiltIn.REAL_REAL_MOD
-
REAL_REAL_CEIL
private static final Applicable REAL_REAL_CEIL
- See Also:
BuiltIn.REAL_REAL_CEIL
-
REAL_REAL_FLOOR
private static final Applicable REAL_REAL_FLOOR
- See Also:
BuiltIn.REAL_REAL_FLOOR
-
REAL_REAL_ROUND
private static final Applicable REAL_REAL_ROUND
- See Also:
BuiltIn.REAL_REAL_ROUND
-
REAL_REAL_TRUNC
private static final Applicable REAL_REAL_TRUNC
- See Also:
BuiltIn.REAL_REAL_TRUNC
-
REAL_REM
private static final Applicable REAL_REM
- See Also:
BuiltIn.REAL_REM
-
REAL_ROUND
private static final Applicable REAL_ROUND
- See Also:
BuiltIn.REAL_ROUND
-
REAL_SAME_SIGN
private static final Applicable REAL_SAME_SIGN
- See Also:
BuiltIn.REAL_SAME_SIGN
-
REAL_SIGN
private static final Applicable REAL_SIGN
- See Also:
BuiltIn.REAL_SIGN
-
REAL_SIGN_BIT
private static final Applicable REAL_SIGN_BIT
- See Also:
BuiltIn.REAL_SIGN_BIT
-
REAL_SPLIT
private static final Applicable REAL_SPLIT
- See Also:
BuiltIn.REAL_SPLIT
-
REAL_TO_MAN_EXP
private static final Applicable REAL_TO_MAN_EXP
- See Also:
BuiltIn.REAL_TO_MAN_EXP
-
REAL_TO_STRING
private static final Applicable REAL_TO_STRING
- See Also:
BuiltIn.REAL_TO_STRING
-
REAL_TRUNC
private static final Applicable REAL_TRUNC
- See Also:
BuiltIn.REAL_TRUNC
-
REAL_UNORDERED
private static final Applicable REAL_UNORDERED
- See Also:
BuiltIn.REAL_UNORDERED
-
RELATIONAL_COUNT
private static final Applicable RELATIONAL_COUNT
- See Also:
BuiltIn.RELATIONAL_COUNT
-
RELATIONAL_EXISTS
private static final Applicable RELATIONAL_EXISTS
- See Also:
BuiltIn.RELATIONAL_EXISTS
-
RELATIONAL_NOT_EXISTS
private static final Applicable RELATIONAL_NOT_EXISTS
- See Also:
BuiltIn.RELATIONAL_NOT_EXISTS
-
RELATIONAL_ITERATE
private static final Applicable RELATIONAL_ITERATE
- See Also:
BuiltIn.RELATIONAL_ITERATE
-
RELATIONAL_ONLY
private static final Applicable RELATIONAL_ONLY
- See Also:
BuiltIn.RELATIONAL_ONLY
-
Z_SUM_INT
private static final Applicable Z_SUM_INT
ImplementsRELATIONAL_SUMfor typeint list.
-
Z_SUM_REAL
private static final Applicable Z_SUM_REAL
ImplementsRELATIONAL_SUMfor typereal list.
-
RELATIONAL_SUM
private static final Macro RELATIONAL_SUM
- See Also:
BuiltIn.RELATIONAL_SUM
-
RELATIONAL_MIN
private static final Applicable RELATIONAL_MIN
- See Also:
BuiltIn.RELATIONAL_MIN
-
RELATIONAL_MAX
private static final Applicable RELATIONAL_MAX
- See Also:
BuiltIn.RELATIONAL_MAX
-
SYS_PLAN
private static final Applicable SYS_PLAN
- See Also:
BuiltIn.SYS_PLAN
-
SYS_SET
private static final Applicable SYS_SET
- See Also:
BuiltIn.SYS_SET
-
SYS_SHOW
private static final Applicable SYS_SHOW
- See Also:
BuiltIn.SYS_SHOW
-
SYS_UNSET
private static final Applicable SYS_UNSET
- See Also:
BuiltIn.SYS_UNSET
-
ORDER_LESS
private static final List ORDER_LESS
-
ORDER_EQUAL
private static final List ORDER_EQUAL
-
ORDER_GREATER
private static final List ORDER_GREATER
-
VECTOR_MAX_LEN
private static final int VECTOR_MAX_LEN
- See Also:
BuiltIn.VECTOR_MAX_LEN, Constant Field Values
-
VECTOR_FROM_LIST
private static final Applicable VECTOR_FROM_LIST
- See Also:
BuiltIn.VECTOR_FROM_LIST
-
VECTOR_TABULATE
private static final Applicable VECTOR_TABULATE
- See Also:
BuiltIn.VECTOR_TABULATE
-
VECTOR_LENGTH
private static final Applicable VECTOR_LENGTH
- See Also:
BuiltIn.VECTOR_LENGTH
-
VECTOR_SUB
private static final Applicable VECTOR_SUB
- See Also:
BuiltIn.VECTOR_SUB
-
VECTOR_UPDATE
private static final Applicable VECTOR_UPDATE
- See Also:
BuiltIn.VECTOR_UPDATE
-
VECTOR_CONCAT
private static final Applicable VECTOR_CONCAT
- See Also:
BuiltIn.VECTOR_CONCAT
-
VECTOR_APPI
private static final Applicable VECTOR_APPI
- See Also:
BuiltIn.VECTOR_APPI
-
VECTOR_APP
private static final Applicable VECTOR_APP
- See Also:
BuiltIn.VECTOR_APP
-
VECTOR_MAPI
private static final Applicable VECTOR_MAPI
- See Also:
BuiltIn.VECTOR_MAPI
-
VECTOR_MAP
private static final Applicable VECTOR_MAP
- See Also:
BuiltIn.VECTOR_MAP
-
VECTOR_FOLDLI
private static final Applicable VECTOR_FOLDLI
- See Also:
BuiltIn.VECTOR_FOLDLI
-
VECTOR_FOLDRI
private static final Applicable VECTOR_FOLDRI
- See Also:
BuiltIn.VECTOR_FOLDRI
-
VECTOR_FOLDL
private static final Applicable VECTOR_FOLDL
- See Also:
BuiltIn.VECTOR_FOLDL
-
VECTOR_FOLDR
private static final Applicable VECTOR_FOLDR
- See Also:
BuiltIn.VECTOR_FOLDR
-
VECTOR_FINDI
private static final Applicable VECTOR_FINDI
- See Also:
BuiltIn.VECTOR_FINDI
-
VECTOR_FIND
private static final Applicable VECTOR_FIND
- See Also:
BuiltIn.VECTOR_FIND
-
VECTOR_EXISTS
private static final Applicable VECTOR_EXISTS
- See Also:
BuiltIn.VECTOR_EXISTS
-
VECTOR_ALL
private static final Applicable VECTOR_ALL
- See Also:
BuiltIn.VECTOR_ALL
-
VECTOR_COLLATE
private static final Applicable VECTOR_COLLATE
- See Also:
BuiltIn.VECTOR_COLLATE
-
Z_LIST
private static final Applicable Z_LIST
- See Also:
BuiltIn.Z_LIST
-
BUILT_IN_VALUES
public static final com.google.common.collect.ImmutableMap<BuiltIn,Object> BUILT_IN_VALUES
-
BUILT_IN_MAP
public static final Map<Applicable,BuiltIn> BUILT_IN_MAP
-
EMPTY_ENV
private static final EvalEnv EMPTY_ENV
-
-
Method Detail
-
constant
public static Code constant(Object value)
Returns a Code that evaluates to the same value in all environments.
-
andAlso
public static Code andAlso(Code code0, Code code1)
Returns a Code that evaluates "andalso".
-
strip
public static Code strip(Code code)
Removes wrappers, in particular the one due towrapRelList(Code).
-
get
public static Code get(String name)
Returns a Code that returns the value of variable "name" in the current environment.
-
getTuple
public static Code getTuple(Iterable<String> names)
Returns a Code that returns a tuple consisting of the values of variables "name0", ... "nameN" in the current environment.
-
apply
public static Code apply(Code fnCode, Code argCode)
Generates the code for applying a function (or function value) to an argument.
-
apply
public static Code apply(Applicable fnValue, Code argCode)
Generates the code for applying a function value to an argument.
-
apply2
public static Code apply2(Applicable2 fnValue, Code argCode0, Code argCode1)
Generates the code for applying a function value to two arguments.
-
apply3
public static Code apply3(Applicable3 fnValue, Code argCode0, Code argCode1, Code argCode2)
Generates the code for applying a function value to three arguments.
-
tyCon
public static Applicable tyCon(Type dataType, String name)
Returns an applicable that constructs an instance of a datatype. The instance is a list with two elements [constructorName, value].
-
from
public static Code from(Supplier<Codes.RowSink> rowSinkFactory)
-
scanRowSink
public static Codes.RowSink scanRowSink(Op op, Core.Pat pat, Code code, Code conditionCode, Codes.RowSink rowSink)
Creates aCodes.RowSinkfor ajoinclause.
-
whereRowSink
public static Codes.RowSink whereRowSink(Code filterCode, Codes.RowSink rowSink)
Creates aCodes.RowSinkfor awhereclause.
-
orderRowSink
public static Codes.RowSink orderRowSink(com.google.common.collect.ImmutableList<Pair<Code,Boolean>> codes, com.google.common.collect.ImmutableList<Binding> bindings, Codes.RowSink rowSink)
Creates aCodes.RowSinkfor aorderclause.
-
groupRowSink
public static Codes.RowSink groupRowSink(Code keyCode, com.google.common.collect.ImmutableList<Applicable> aggregateCodes, com.google.common.collect.ImmutableList<String> inNames, com.google.common.collect.ImmutableList<String> keyNames, com.google.common.collect.ImmutableList<String> outNames, Codes.RowSink rowSink)
Creates aCodes.RowSinkfor agroupclause.
-
yieldRowSink
public static Codes.RowSink yieldRowSink(Map<String,Code> yieldCodes, Codes.RowSink rowSink)
Creates aCodes.RowSinkfor a non-terminalyieldstep.
-
collectRowSink
public static Codes.RowSink collectRowSink(Code code)
Creates aCodes.RowSinkto collect the results of afromexpression.
-
nth
public static Applicable nth(int slot)
Returns an applicable that returns theslotth field of a tuple or record.
-
stringMap
private static Applicable stringMap(Applicable f)
-
translate
private static Applicable translate(Applicable f)
-
isPrefix
private static Applicable isPrefix(String s)
-
isSubstring
private static Applicable isSubstring(String s)
-
isSuffix
private static Applicable isSuffix(String s)
-
length
private static ApplicableImpl length(BuiltIn builtIn)
-
union
private static ApplicableImpl union(BuiltIn builtIn)
-
listApp
private static Applicable listApp(Applicable consumer)
-
listMap
private static Applicable listMap(Applicable fn)
-
listMapPartial
private static Applicable listMapPartial(Applicable f)
-
find
private static ApplicableImpl find(BuiltIn builtIn)
-
find
private static Applicable find(Applicable f)
-
listFilter
private static Applicable listFilter(Applicable f)
-
listPartition
private static Applicable listPartition(Applicable f)
-
listFold
private static Applicable listFold(boolean left, Applicable f)
-
listFold2
private static Applicable listFold2(boolean left, Applicable f, Object init)
-
exists
private static ApplicableImpl exists(BuiltIn builtIn)
-
listExists
private static Applicable listExists(Applicable f)
-
all
private static ApplicableImpl all(BuiltIn builtIn)
-
listAll
private static Applicable listAll(Applicable f)
-
collate
private static ApplicableImpl collate(BuiltIn builtIn)
-
collate
private static Applicable collate(Applicable comparator)
-
optionApp
private static Applicable optionApp(Applicable f)
ImplementsOPTION_APP.
-
optionFilter
private static Applicable optionFilter(Applicable f)
Implementation ofOPTION_FILTER.
-
optionMap
private static Applicable optionMap(Applicable f)
ImplementsOPTION_MAP.
-
optionSome
private static List optionSome(Object o)
Creates a value ofSOME v.- See Also:
OPTION_NONE
-
optionMapPartial
private static Applicable optionMapPartial(Applicable f)
ImplementsOPTION_MAP_PARTIAL.
-
optionCompose
private static Applicable optionCompose(Applicable f, Applicable g)
ImplementsOPTION_COMPOSE.
-
optionComposePartial
private static Applicable optionComposePartial(Applicable f, Applicable g)
ImplementsOPTION_COMPOSE_PARTIAL.
-
isEmpty
private static ApplicableImpl isEmpty(BuiltIn builtIn)
-
isNotEmpty
private static ApplicableImpl isNotEmpty(BuiltIn builtIn)
-
sysEnv
private static Core.Exp sysEnv(TypeSystem typeSystem, Environment env, Type argType)
- See Also:
BuiltIn.SYS_ENV
-
vectorAppi
private static Applicable vectorAppi(Applicable f)
ImplementsVECTOR_APPI.
-
vectorApp
private static Applicable vectorApp(Applicable f)
ImplementsVECTOR_APP.
-
vectorMapi
private static Applicable vectorMapi(Applicable f)
ImplementsVECTOR_MAPI.
-
vectorMap
private static Applicable vectorMap(Applicable f)
ImplementsVECTOR_MAP.
-
vectorFindi
private static Applicable vectorFindi(Applicable f)
ImplementsVECTOR_FINDI.
-
emptyEnv
public static EvalEnv emptyEnv()
Creates an empty evaluation environment.
-
emptyEnvWith
public static EvalEnv emptyEnvWith(Session session, Environment env)
Creates an evaluation environment that contains the bound values from a compilation environment.
-
env
public static Environment env(TypeSystem typeSystem, Environment environment)
Creates a compilation environment.
-
aggregate
public static Applicable aggregate(Environment env0, Code aggregateCode, List<String> names, @Nullable Code argumentCode)
-
get
private static Map<Applicable,BuiltIn> get()
-
makeEmptyEnv
private static EvalEnv makeEmptyEnv()
-
appendFloat
public static StringBuilder appendFloat(StringBuilder buf, float f)
-
floatToString
static String floatToString(float f)
Converts a Javafloatto the format expected of Standard MLrealvalues.
-
-