Skip to content

foresight_expression ​

foresight_expression, arithmetic expressions of gnuplot using fields and plotted functions.

An expression such as ($2*1e3) or ($3 > 0 ? log10($3) : 1/0) is compiled once into stack code and evaluated on each data row; compiled with a dummy variable, sin(x)/x is a function evaluated at sample abscissae (value_at), where columns are errors. The semantics are gnuplot's:

  • operators, loosest first: ?:, ||, &&, == !=, < <= > >=, + -, * / %, unary - + !, ** (right associative, so -2**2 is -4 and 2**3**2 is 512); &&, || and ?: evaluate only what they need;
  • operands: numbers, $N and column(N) (column N of the row, 0 is the point number), column("name") (the column of that header, see resolve), pi, and the functions abs acos asin atan atan2 ceil cos cosh exp floor int log log10 sgn sin sinh sqrt tan tanh, and gnuplot's special functions of foresight_mathlib (erf, gamma, igamma, besj0, lambertw, ...);
  • with a symbols_object, user variables (a = 2: their value when the expression is compiled, integer or real) and user functions (f(x, y) = ...: compiled inline where called, the arguments read from their stack slots; a call of a function already being compiled, a recursion, jumps to a copy of its body compiled once after the main code, run on a call stack: past 251 nested calls, gnuplot's recursion depth limit exceeded), as gnuplot's a = 2 and f(x) = a*sin(x);
  • integer constants are integers: 1/2 is 0, -5/2 is -2, 7/2. is 3.5; an integer overflow gives a real; columns are real; floor, ceil, int, sgn, comparisons and logical operators give integers; an integer overflow of +, -, * and ** follows overflow_mode (gnuplot set|unset overflow, global as gnuplot's): a real (default), wrapped (+ and - only, unset overflow), NaN or undefined;
  • a missing cell, a division by zero, a domain error (sqrt(-1), log(0)) or an overflow make the whole value undefined: NaN, a gap in the plot, as gnuplot's 1/0;
  • compiled with degrees (gnuplot set angles degrees), sin, cos, tan take degrees and asin, acos, atan, atan2 return them.

Strings, as gnuplot's: literals in double quotes (\t, \n, \", \\ escapes) or single quotes (literal), string user variables and functions; a . b joins (b a string or an integer), eq and ne compare, s[i:j] is a substring (1-based, ends clamped, * or nothing for an open end); sprintf (C conversions, from the exact binary value), gprintf, strlen, substr, strstrt, words, word, trim; value("name"), exists("name") (quoted names only). Arrays (symbols_object%declare_array): A[i] an element (an index known now resolved now, else on each row), |A| the size, index(A, value); datablocks (string variables named $NAME): $NAME[i] a line, |$NAME| their number; gnuplot 6.0's split(s [, sep]) (an array: assigned, printed, sized |split(s)|, in index and join) and join(A, sep), their arguments known when compiled. Arithmetic and == read a string's leading number ("3" + 1 is 4); a string as a condition, or where a number cannot be read, is an error of a constant expression and a gap on a data row.

Complex numbers, as gnuplot's: constants {re, im} and I ({0,1}); + - * / ** (gnuplot's formulas: powers in polar form, a negative base with a fractional exponent complex), abs, arg, real, imag, conj, sqrt, exp, log, log10 (of negative reals too), sin, cos, tan, sinh, cosh, tanh, asin, acos, atan, asinh, acosh, atanh (asin, acos off [-1:1] and acosh below 1 too); comparisons <... of the real parts, == != of both; a plotted value whose imaginary part exceeds 1e-8 is undefined (gnuplot's set zero); the other functions of a complex argument are undefined.

Accepted beyond gnuplot: % and the logical operators on reals (gnuplot rejects them), and overflows give a gap where gnuplot stops the plot. Every floating point operation is checked beforehand, so evaluation never raises an IEEE invalid, division by zero or overflow exception.

Source: src/lib/foresight_expression.F90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
OP_CONSTANTinteger(kind=I4P)parameterPush the constant.
OP_COLUMNinteger(kind=I4P)parameterPush column arg.
OP_COLUMN_OFinteger(kind=I4P)parameterReplace the top with the column it numbers.
OP_NEGATEinteger(kind=I4P)parameterUnary minus.
OP_NOTinteger(kind=I4P)parameterLogical not.
OP_TRUTHinteger(kind=I4P)parameterReplace the top with 0 or 1.
OP_ADDinteger(kind=I4P)parameter+; binary operators run from here to OP_NE.
OP_SUBTRACTinteger(kind=I4P)parameter-.
OP_MULTIPLYinteger(kind=I4P)parameter*.
OP_DIVIDEinteger(kind=I4P)parameter/.
OP_MODULOinteger(kind=I4P)parameter%.
OP_POWERinteger(kind=I4P)parameter**.
OP_ATAN2integer(kind=I4P)parameteratan2(y, x).
OP_LTinteger(kind=I4P)parameter<.
OP_LEinteger(kind=I4P)parameter<=.
OP_GTinteger(kind=I4P)parameter>.
OP_GEinteger(kind=I4P)parameter>=.
OP_EQinteger(kind=I4P)parameter==.
OP_NEinteger(kind=I4P)parameter!=.
OP_FUNCTIONinteger(kind=I4P)parameterFunction arg of the top.
OP_JUMPinteger(kind=I4P)parameterJump to arg.
OP_JUMP_UNLESSinteger(kind=I4P)parameterPop; jump to arg if false.
OP_AND_JUMPinteger(kind=I4P)parameterIf the top is false: make it 0, jump to arg; else pop.
OP_OR_JUMPinteger(kind=I4P)parameterIf the top is true: make it 1, jump to arg; else pop.
OP_COLUMN_NAMEDinteger(kind=I4P)parameterPush the column of header names(arg): undefined until resolved.
OP_LOADinteger(kind=I4P)parameterPush a copy of stack slot arg (a user function argument).
SUM_FRAMEcharacter(len=*)parameterFrame name of a sum variable (no function is named so).
OP_COLLAPSEinteger(kind=I4P)parameterDrop the arg values under the top (a call's arguments).
OP_CONCATinteger(kind=I4P)parameter.: string join.
OP_STREQinteger(kind=I4P)parametereq.
OP_STRNEinteger(kind=I4P)parameterne.
OP_SUBSTRINGinteger(kind=I4P)parameters[i:j]: the string and both ends on the stack.
OP_CALLinteger(kind=I4P)parameterString function arg of the top v%i values.
OP_STRCOLinteger(kind=I4P)parameterReplace the top with the text of the column it numbers or names.
OP_COLUMNHEADinteger(kind=I4P)parameterReplace the top with the header text of the column it numbers.
OP_TIMECOLUMNinteger(kind=I4P)parameterColumn (under the top) read as a time with the format (top).
OP_ELEMENTinteger(kind=I4P)parameterReplace the top (an index) with that element of lists(arg).
OP_RECURSEinteger(kind=I4P)parameterCall the body at arg on its v%i arguments (a recursion).
OP_RETURNinteger(kind=I4P)parameterEnd of a called body: its value replaces its arguments.
OP_STOPinteger(kind=I4P)parameterEnd of the main code, before the called bodies.
OP_DEPTHinteger(kind=I4P)parameterA call inlined in a called body: check the nested calls.
OP_BANDinteger(kind=I4P)parameter&; the bitwise operators of integers run from here to OP_SHR.
OP_BORinteger(kind=I4P)parameter|.
OP_BXORinteger(kind=I4P)parameter^.
OP_SHLinteger(kind=I4P)parameter<<.
OP_SHRinteger(kind=I4P)parameter>>, logical (gnuplot's on x86).
OP_BNOTinteger(kind=I4P)parameter~, unary.
OP_BLOCKinteger(kind=I4P)parameterCall the function block blocks(arg) on its v%i arguments.
OP_RANDinteger(kind=I4P)parametergnuplot's rand(x) of the top: the next pseudo-random number.
OP_SPECIALinteger(kind=I4P)parameterA special function MATH_FUNCTIONS(arg) (foresight_mathlib) of its MATH_ARGS(arg) arguments.
OP_ASSIGNinteger(kind=I4P)parametername = value inside an expression: the top stored in the user variable stores(arg) (store_hook), and kept.
OP_FETCHinteger(kind=I4P)parameterPush the user variable stores(arg) as it is now (fetch_hook), v its value when compiled if none (calls 1 when it had one).
OP_ASSIGN_ELEMENTinteger(kind=I4P)parametername[i] = value inside an expression: the top stored in element i (below it) of the array stores(arg) (element_hook); the index dropped, the value kept.
OP_VOXELinteger(kind=I4P)parametervoxel(x, y, z): the three tops replaced by the active voxel grid's value there (voxel_hook), gnuplot 6.0's.
OP_FETCH_ELEMENTinteger(kind=I4P)parameterReplace the top (an index) with that element of the array stores(arg) as it is now (element_fetch_hook).
ROW_FUNCTIONScharacter(len=*)parameter
NO_COLUMNinteger(kind=I4P)parameterColumn of a header name found nowhere: reads nothing.
DEFAULT_TIMEFMTcharacter(len=*)parametergnuplot's default set timefmt.
FUNCTIONScharacter(len=*)parameter
STRING_FUNCTIONScharacter(len=*)parameter
LEAST_ARGSinteger(kind=I4P)parameter
MOST_ARGSinteger(kind=I4P)parameter
E_NONEinteger(kind=I4P)parameterNo error.
E_NONNUMERICinteger(kind=I4P)parameterA string without a leading number in arithmetic.
E_NOTSTRINGinteger(kind=I4P)parameterA number given to a string operator or function.
E_BOOLEANinteger(kind=I4P)parameterA string as a condition.
E_FORMATinteger(kind=I4P)parameterA bad sprintf/gprintf format.
E_STRING_ARGinteger(kind=I4P)parameterA string printed with a numeric conversion.
E_NUMBER_ARGinteger(kind=I4P)parameterA number printed with %s.
E_INDEXinteger(kind=I4P)parameterAn array index out of range.
E_UNSETinteger(kind=I4P)parameterAn array element never set.
E_DEPTHinteger(kind=I4P)parameterToo many nested calls of recursive user functions.
E_BITWISEinteger(kind=I4P)parameterA real or a string given to a bitwise operator.
E_BLOCKinteger(kind=I4P)parameterA function block failed: its message in block_message.
E_UNDEFinteger(kind=I4P)parameterThe value is gnuplot's undefined one (print shows ``).
E_UNINITinteger(kind=I4P)parameterAn operation on gnuplot's undefined value.
E_SEEDinteger(kind=I4P)parameterrand(x): x not an integer seed.
E_ORDERinteger(kind=I4P)parameterA real order of besjn, besyn, besin or expint (order_message).
E_NOVARinteger(kind=I4P)parameterA variable assigned by an expression read before it has a value.
E_NOVOXELinteger(kind=I4P)parametervoxel() without an active voxel grid.
LEVELScharacter(len=*)parameterC's, as gnuplot.
MAX_NESTINGinteger(kind=I4P)parameterDeepest parentheses and unary chains.
MAX_CALLSinteger(kind=I4P)parameterMost nested user function calls (gnuplot's).
MOSTinteger(kind=I8P)parameterLargest integer.
LEASTinteger(kind=I8P)parameterSmallest integer.
OVERFLOW_IGNOREinteger(kind=I4P)parameterunset overflow: + and - wrap, * and ** give a real.
OVERFLOW_FLOATinteger(kind=I4P)parameterset overflow [float]: a real (gnuplot's default).
OVERFLOW_UNDEFINEDinteger(kind=I4P)parameterset overflow undefined: the value is undefined.
OVERFLOW_NANinteger(kind=I4P)parameterset overflow NaN: NaN.
overflow_modeinteger(kind=I4P)saveInteger overflow handling, gnuplot's global setting.
HUGE_REALreal(kind=R8P)parameterLargest real.
LOG_HUGEreal(kind=R8P)parameterLargest safe exp argument.
LOG_TINYreal(kind=R8P)parameterexp of less is 0.
INT_LIMITreal(kind=R8P)parameterReals from here on are not I8P integers.
INT_GUARANTEEDreal(kind=R8P)parametergnuplot's LARGEST_GUARANTEED_NONOVERFLOW: int().
EXACT_HALFreal(kind=R8P)parametergnuplot's LARGEST_EXACT_INT/2: floor(), ceil().
PIreal(kind=R8P)parameterpi.
ZERO_IMAGreal(kind=R8P)parametergnuplot's set zero: a larger imaginary part makes a plotted value undefined.
block_hookprocedure(block_call_interface)pointerThe interpreter's runner of function blocks.
store_hookprocedure(store_interface)pointerThe interpreter's store of a user variable.
fetch_hookprocedure(fetch_interface)pointerThe interpreter's value of a user variable.
voxel_hookprocedure(voxel_interface)pointerThe interpreter's active voxel grid.
element_hookprocedure(element_store_interface)pointerThe interpreter's store of an array element.
element_fetch_hookprocedure(element_fetch_interface)pointerThe interpreter's array element now.
rand_seedsinteger(kind=I8P)savegnuplot's rand seeds (L'Ecuyer's combined generator).
block_messagecharacter(len=:)allocatableMessage of the last function block failure.

Derived Types ​

value_object ​

Stack value: an integer, a real or a string, as in gnuplot.

Components

NameTypeAttributesDescription
rreal(kind=R8P)Real value.
iinteger(kind=I8P)Integer value.
is_intlogicalInteger.
is_stringlogicalString, in s.
is_undeflogicalgnuplot's undefined value: an array element without one, a function block's missing return.
imreal(kind=R8P)Imaginary part of a complex value, gnuplot's {re, im}.
scharacter(len=:)allocatableString value.

instruction_object ​

Stack code instruction.

Components

NameTypeAttributesDescription
opinteger(kind=I4P)Operation code.
arginteger(kind=I4P)Column, function or jump target.
vtype(value_object)Constant.
callsinteger(kind=I4P)OP_RECURSE: the nested calls it adds (the inline ones it is inside).

name_object ​

Column header name.

Components

NameTypeAttributesDescription
textcharacter(len=:)allocatableName.

frame_object ​

A user function being compiled inline: its parameters read the stack slots from base.

Components

NameTypeAttributesDescription
namecharacter(len=:)allocatableFunction name.
paramstype(name_object)allocatableParameter names.
baseinteger(kind=I4P)Stack slot of the first argument.

user_variable ​

User variable, gnuplot a = 2.

Components

NameTypeAttributesDescription
namecharacter(len=:)allocatableName.
vtype(value_object)Value, integer or real.
blocklogicalA function block, function $f << EOF (its body the value).

user_function ​

User function, gnuplot f(x, y) = ....

Components

NameTypeAttributesDescription
namecharacter(len=:)allocatableName.
paramstype(name_object)allocatableParameter names.
bodycharacter(len=:)allocatableBody text.

saved_variable ​

A variable's state, kept to be restored: the variable of a do for loop is local to the loop, as gnuplot's.

Components

NameTypeAttributesDescription
namecharacter(len=:)allocatableName.
foundlogicalIt existed.
vtype(value_object)Its value.

value_list ​

The elements of an array (gnuplot array A[N]) or the lines of a datablock, indexed at run time.

Components

NameTypeAttributesDescription
itemstype(value_object)allocatableElements.
setlogicalallocatableThe element has a value (an array element may have none).

user_array ​

User array, gnuplot array A[N]: elements of any type, some possibly without a value.

Components

NameTypeAttributesDescription
namecharacter(len=:)allocatableName.
listtype(value_list)Elements.

saved_array ​

An array's state, kept to be restored: call sets ARGV and restores it after the script.

Components

NameTypeAttributesDescription
atype(user_array)The array.
foundlogicalIt existed.

symbols_object ​

User variables and functions of a script, gnuplot's: a = 2 stores the value now (integer or real), f(x) = a*x stores the text, compiled inline where it is called, so its variables take their values at that moment (plot time); recursive functions run on a call stack.

Components

NameTypeAttributesDescription
variablestype(user_variable)allocatableVariables.
functionstype(user_function)allocatableFunctions.
arraystype(user_array)allocatableArrays, gnuplot array A[N].
timefmtcharacter(len=:)allocatableTime format of timecolumn(N) (gnuplot set timefmt), %d/%m/%y,%H:%M if unallocated.
assignedtype(name_object)allocatableVariables a user function body assigns (f(x) = (a = x, a)): read at run time wherever compiled.

Type-Bound Procedures

NameAttributesDescription
assignpass(self)name = expression.
putpass(self)Set a variable to a typed value (an assignment run by an expression).
getpass(self)Typed value of a variable.
assign_elementpass(self)name[index] = expression.
set_elementpass(self)Set an array element to a typed value.
get_elementpass(self)Typed value of an array element.
learn_assignedpass(self)Read the variables an expression assigns at run time from now on.
evaluate_constantpass(self)Typed value of a constant expression.
array_datapass(self)An array as the lines of a data file (index and value).
array_textpass(self)An array as gnuplot's print shows it.
array_valuepass(self)An array or a slice A[i:j] given as text.
store_arraypass(self)Set an array to elements.
declare_arraypass(self)array name[N] [= [...]], array name = [...].
is_arraypass(self)Whether a name is an array.
definedpass(self)Whether a name is a variable, an array or pi, NaN.
datablock_namespass(self)Names of the datablocks.
array_sizepass(self)Size of an array.
set_arraypass(self)Set an array to strings (ARGV).
clearpass(self)Forget every symbol.
constantpass(self)Value of a constant expression.
definepass(self)name(params) = body.
value_ofpass(self)Value of a variable.
set_valuepass(self)Set a variable to a number.
set_stringpass(self)Set a variable to a string.
define_blockpass(self)Define a function block.
is_blockpass(self)Whether a name is a function block.
save_variablepass(self)Keep a variable's state.
save_arraypass(self)Keep an array's state.
restore_arraypass(self)Restore a kept array's state.
restorepass(self)Restore a kept variable's state.
removepass(self)Forget a variable.
remove_prefixpass(self)Forget the variables whose name starts with a prefix.
string_ofpass(self)Value of a string variable.
text_ofpass(self)Value of a constant expression as text.
array_indexpass(self)Index of an array, 0 if none.
function_indexpass(self)Index of a function, 0 if none.
storepass(self)Set a variable to a typed value.
variable_indexpass(self)Index of a variable, 0 if none.

expression_object ​

Compiled expression.

Components

NameTypeAttributesDescription
textcharacter(len=:)allocatableSource text.
codetype(instruction_object)allocatableStack code.
namestype(name_object)allocatableColumn header names, column("name").
depthinteger(kind=I4P)Stack size needed.
recursivelogicalCalls of recursive functions (OP_RECURSE).
degreeslogicalAngles of the trigonometric functions in degrees (gnuplot set angles degrees), else radians.
timefmtcharacter(len=:)allocatableTime format of a time field (set xdata time): a plain column then reads a time with it.
liststype(value_list)allocatableArrays and datablocks indexed at run time (A[$1]).
blockstype(name_object)allocatableFunction blocks called (OP_BLOCK).
storestype(name_object)allocatableUser variables assigned or read at run time (OP_ASSIGN, OP_FETCH).

Type-Bound Procedures

NameAttributesDescription
compilepass(self)Compile an expression.
set_timepass(self)Read a plain column as a time.
evaluatepass(self)Value on a data row.
evaluate_textpass(self)Text on a data row (a label).
table_cellpass(self)Text of a plot with table field on a data row.
uses_textpass(self)Whether the row cell texts are read.
first_columnpass(self)First data column read.
name_countpass(self)Number of column header names.
name_ofpass(self)A column header name.
reads_columnpass(self)Whether a data column is read.
plain_columnpass(self)The data column of a plain column field, 0 if none.
resolvepass(self)Header names to column numbers.
set_columnpass(self)Plain column.
set_namepass(self)Plain column of a header name.
value_atpass(self)Value of a function at its variable value.

Interfaces ​

push ​

Append an item through a temporary: nvfortran 26.9 corrupts list = [list, item] (and any list = f(list)) when the items hold deferred-length characters.

Module procedures: push_name, push_variable, push_function, push_expression, push_instruction, push_array, push_list, push_value

Subroutines ​

compile ​

Compile text; on error iostat is not 0 and iomsg names the problem and its position.

With variable (gnuplot's dummy x) the expression is a function of it, evaluated by value_at; columns are then errors. The variable is held as the only cell of the row evaluate receives. With degrees true the trigonometric functions work in degrees. With symbols, user variables are constants of their current values and user functions are compiled inline (the dummy variable wins over a user variable of its name, as gnuplot). With sampled (blank-separated names), each name reads the data column of its position, everywhere: gnuplot's sample variables of the '+' and '++' pseudo-files (plot sample [t=0:1] '+' using (t):(t**2)).

fortran
subroutine compile(self, text, iostat, iomsg, variable, degrees, symbols, sampled)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inoutExpression.
textcharacter(len=*)inSource text.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
variablecharacter(len=*)inoptionalDummy variable name, for a function.
degreeslogicalinoptionalAngles in degrees.
symbolstype(symbols_object)inoptionalUser variables and functions.
sampledcharacter(len=*)inoptionalSample variables, columns 1, 2, ...

Call graph

compile_expression ​

compile, and the syntax check of a user function body: parameters of the function frame_name read the stack slots from 1, and with lenient unknown names and functions are accepted (resolved when called).

Not recursive (nvfortran 26.9 -O2 then loops on a syntax error): the code it runs while compiling (system, the ends of a slice) calls no function block, so it is never entered again.

fortran
subroutine compile_expression(self, text, iostat, iomsg, variable, degrees, symbols, frame_name, parameters, lenient, sampled)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inoutExpression.
textcharacter(len=*)inSource text.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
variablecharacter(len=*)inoptionalDummy variable name, for a function.
degreeslogicalinoptionalAngles in degrees.
symbolstype(symbols_object)inoptionalUser variables and functions.
frame_namecharacter(len=*)inoptionalFunction whose body text is.
parameterstype(name_object)inoptionalIts parameters.
lenientlogicalinoptionalUnknown names accepted.
sampledcharacter(len=*)inoptionalSample variables, columns 1, 2, ...

Call graph

assign ​

gnuplot name = text: the value of the expression now, integer, real or string, kept as a constant (a redefinition replaces it). Columns, undefined values (1/0), type errors and bad names are errors.

Attributes: recursive

fortran
subroutine assign(self, name, text, iostat, iomsg, degrees)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inouttargetSymbols.
namecharacter(len=*)inVariable name.
textcharacter(len=*)inExpression.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
degreeslogicalinoptionalAngles in degrees.

Call graph

define ​

gnuplot name(params) = body: the body is checked now, its names resolved when the function is called (a redefinition replaces it). Builtin function names, repeated or bad parameter names and recursion are errors.

fortran
subroutine define(self, name, params, body, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inoutSymbols.
namecharacter(len=*)inFunction name.
paramscharacter(len=*)inParameter names.
bodycharacter(len=*)inBody.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

constant ​

Value of the constant expression text (numbers, user variables and functions, pi), as a range end [0:2*pi]; columns and undefined values are errors.

Attributes: recursive

fortran
subroutine constant(self, text, v, iostat, iomsg, degrees)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)intargetSymbols.
textcharacter(len=*)inExpression.
vreal(kind=R8P)outValue.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
degreeslogicalinoptionalAngles in degrees.

Call graph

text_of ​

Value of the constant expression text as text: a string as it is (is_string), a number as gnuplot's print shows it (3, 2.5, 100.0, 1e+20). Columns, undefined values and type errors are errors.

Attributes: recursive

fortran
subroutine text_of(self, text, value, is_string, iostat, iomsg, degrees)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)intargetSymbols.
textcharacter(len=*)inExpression.
valuecharacter(len=:)outallocatableValue as text.
is_stringlogicaloutA string.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
degreeslogicalinoptionalAngles in degrees.

Call graph

clear ​

Forget every variable and function.

Attributes: pure

fortran
subroutine clear(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inoutSymbols.

Call graph

set_value ​

Set the variable name to the real v (an integer with is_int), creating it: fit sets its parameters and results so. The name is not checked.

Attributes: pure

fortran
subroutine set_value(self, name, v, is_int)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inoutSymbols.
namecharacter(len=*)inVariable name.
vreal(kind=R8P)inValue.
is_intlogicalinInteger value.

Call graph

set_string ​

Set the variable name to the string text, creating it. The name is not checked.

Attributes: pure

fortran
subroutine set_string(self, name, text)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inoutSymbols.
namecharacter(len=*)inVariable name.
textcharacter(len=*)inValue.

Call graph

save_variable ​

The state of the variable name (its value, or that it does not exist), for restore.

Attributes: pure

fortran
subroutine save_variable(self, name, saved)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inSymbols.
namecharacter(len=*)inVariable name.
savedtype(saved_variable)outState.

Call graph

restore ​

Restore a variable kept by save_variable: its value, or remove it if it did not exist.

Attributes: pure

fortran
subroutine restore(self, saved)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inoutSymbols.
savedtype(saved_variable)inState.

Call graph

remove ​

Forget the variable name, if it exists.

Attributes: pure

fortran
subroutine remove(self, name)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inoutSymbols.
namecharacter(len=*)inVariable name.

Call graph

remove_prefix ​

Forget every variable whose name starts with prefix (gnuplot undefine prefix*).

Attributes: pure

fortran
subroutine remove_prefix(self, prefix)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inoutSymbols.
prefixcharacter(len=*)inName prefix.

Call graph

string_of ​

Value of the string variable name; found false (and text empty) if there is none or it is a number.

Attributes: pure

fortran
subroutine string_of(self, name, text, found)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inSymbols.
namecharacter(len=*)inVariable name.
textcharacter(len=:)outallocatableValue.
foundlogicaloutA string variable found.

Call graph

put ​

Set the variable name to the typed value v, creating it: an assignment run by an expression (store_hook).

Attributes: pure

fortran
subroutine put(self, name, v)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inoutSymbols.
namecharacter(len=*)inVariable name.
vtype(value_object)inValue.

Call graph

get ​

Typed value of the variable name, found false (and v empty) if none.

Attributes: pure

fortran
subroutine get(self, name, v, found)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inSymbols.
namecharacter(len=*)inVariable name.
vtype(value_object)outValue.
foundlogicaloutA variable of that name.

Call graph

store ​

Set the variable name to v, creating it (by components: nvfortran 26.9 corrupts constructors of types holding deferred-length characters).

Attributes: pure

fortran
subroutine store(self, name, v)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inoutSymbols.
namecharacter(len=*)inVariable name.
vtype(value_object)inValue.

Call graph

define_block ​

gnuplot 6.0 function $name << EOF ... EOF: the function block name, its body the lines body.

Attributes: pure

fortran
subroutine define_block(self, name, body)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inoutSymbols.
namecharacter(len=*)inBlock name, $f.
bodycharacter(len=*)inIts lines, each ended by a new line.

Call graph

value_of ​

Value of the variable name (real), found false (and NaN) if none; is_int whether an integer. Its number. A number read. Type error.

Attributes: pure

fortran
subroutine value_of(self, name, v, found, is_int)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inSymbols.
namecharacter(len=*)inVariable name.
vreal(kind=R8P)outValue.
foundlogicaloutVariable found.
is_intlogicaloutoptionalInteger value.

Call graph

declare_array ​

gnuplot array name[size_text], its elements without a value, or with the values of the constant expressions items (array A[3] = [1, 2, 3], array A = [...], size_text empty: the items' number). A redeclaration replaces the array; a variable of the name is removed.

Attributes: recursive

fortran
subroutine declare_array(self, name, size_text, items, iostat, iomsg, degrees)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inouttargetSymbols.
namecharacter(len=*)inArray name.
size_textcharacter(len=*)inSize expression, empty for the items' number.
itemscharacter(len=*)inoptionalElement expressions.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
degreeslogicalinoptionalAngles in degrees.

Call graph

assign_element ​

gnuplot name[index_text] = text: the element of the array set to the value of the expression now.

Attributes: recursive

fortran
subroutine assign_element(self, name, index_text, text, iostat, iomsg, degrees)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inouttargetSymbols.
namecharacter(len=*)inArray name.
index_textcharacter(len=*)inIndex expression.
textcharacter(len=*)inValue expression.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
degreeslogicalinoptionalAngles in degrees.

Call graph

set_element ​

Set element i of the array name to the typed value v, ok false if no such array or i is out of range.

Attributes: pure

fortran
subroutine set_element(self, name, i, v, ok)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inoutSymbols.
namecharacter(len=*)inArray name.
iinteger(kind=I8P)inElement.
vtype(value_object)inValue.
oklogicaloutSet.

Call graph

learn_assigned ​

The variables the expression e assigns (name = value) read at run time wherever compiled from now on, as those of a user function body: using (Total = $2 + $3):($4 / Total).

Attributes: pure

fortran
subroutine learn_assigned(self, e)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inoutSymbols.
etype(expression_object)inCompiled expression.

Call graph

get_element ​

Typed value of element i of the array name, found false if no such array or i is out of range, set false if the element has no value.

Attributes: pure

fortran
subroutine get_element(self, name, i, v, found, set)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inSymbols.
namecharacter(len=*)inArray name.
iinteger(kind=I8P)inElement.
vtype(value_object)outValue.
foundlogicaloutIn range.
setlogicaloutWith a value.

Call graph

evaluate_constant ​

Typed value of the constant expression text: columns, undefined values and type errors are errors; with undefined gnuplot's undefined value is not (v%is_undef, a function block's return A[9]).

Attributes: recursive

fortran
subroutine evaluate_constant(self, text, v, iostat, iomsg, degrees, undefined)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)intargetSymbols.
textcharacter(len=*)inExpression.
vtype(value_object)outValue.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
degreeslogicalinoptionalAngles in degrees.
undefinedlogicalinoptionalgnuplot's undefined value accepted.

Call graph

set_array ​

Set the array name to the strings texts (gnuplot's ARGV), replacing it. The name is not checked.

Attributes: pure

fortran
subroutine set_array(self, name, texts)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inoutSymbols.
namecharacter(len=*)inArray name.
textscharacter(len=*)inElements, trailing blanks dropped.

Call graph

save_array ​

The state of the array name (its elements, or that it does not exist), for restore_array.

Attributes: pure

fortran
subroutine save_array(self, name, saved)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inSymbols.
namecharacter(len=*)inArray name.
savedtype(saved_array)outState.

Call graph

restore_array ​

Restore an array kept by save_array: its elements, or remove it if it did not exist.

Attributes: pure

fortran
subroutine restore_array(self, saved)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inoutSymbols.
savedtype(saved_array)inState.

Call graph

datablock_names ​

Names of the datablocks (the variables named $NAME).

Attributes: pure

fortran
subroutine datablock_names(self, names)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inSymbols.
namescharacter(len=:)outallocatableNames, blank padded.

array_value ​

The elements of text if it is an array, A, or a slice, A[i:j] (gnuplot 6.0: ends known now, an empty or * end the first or the last element, clamped, [] when empty); found false for anything else (A[i], A + 1). String and separator. The top-level comma, 0 if none.

Attributes: recursive

fortran
subroutine array_value(self, text, list, found, iostat, iomsg, degrees)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)intargetSymbols.
textcharacter(len=*)inExpression.
listtype(value_list)outElements.
foundlogicaloutAn array or a slice.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.
degreeslogicalinoptionalAngles in degrees.

Call graph

store_array ​

Set the array name to the elements list (gnuplot's B = A[2:3]), replacing a variable or an array of the name.

Attributes: pure

fortran
subroutine store_array(self, name, list, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inoutSymbols.
namecharacter(len=*)inArray name.
listtype(value_list)inElements.
iostatinteger(kind=I4P)out0 on success.
iomsgcharacter(len=:)outallocatableError message.

Call graph

set_time ​

Make the field a time field: a plain column is read with timefmt (empty: a number again).

Attributes: pure

fortran
subroutine set_time(self, timefmt)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inoutExpression.
timefmtcharacter(len=*)inTime format.

Call graph

table_cell ​

A field of gnuplot's plot ... with table on a data row (arguments as evaluate): a string as it is, a number as %g, nan if undefined.

Attributes: recursive

fortran
subroutine table_cell(self, row, point, text, is_string, cells, heads, place)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inExpression.
rowreal(kind=R8P)inRow cells.
pointinteger(kind=I4P)inPoint number.
textcharacter(len=:)outallocatableText.
is_stringlogicaloutA string value.
cellstype(name_object)inoptionalRow cell texts.
headstype(name_object)inoptionalHeader cell texts of the row's dataset.
placeinteger(kind=I4P)inoptionalBlock within the dataset and dataset, from 0.

Call graph

run ​

Run the stack code on a data row: top is the typed value, defined false if undefined; error the type error that made it undefined (E_NONE if none: a missing cell, a domain error); cells, heads, place as evaluate. The point. The value. A grid active.

With a value.

The variable has a value.

Attributes: recursive

fortran
subroutine run(self, row, point, top, defined, error, cells, heads, place)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inExpression.
rowreal(kind=R8P)inRow cells.
pointinteger(kind=I4P)inPoint number.
toptype(value_object)outValue.
definedlogicaloutDefined.
errorinteger(kind=I4P)outoptionalType error.
cellstype(name_object)inoptionalRow cell texts.
headstype(name_object)inoptionalHeader cell texts of the dataset.
placeinteger(kind=I4P)inoptionalBlock within the dataset and dataset.

Call graph

set_column ​

Make the expression the plain column c (0 is the point number).

Attributes: pure

fortran
subroutine set_column(self, c)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inoutExpression.
cinteger(kind=I4P)inColumn.

Call graph

set_name ​

Make the expression the plain column of header name, as gnuplot using 1:"name".

Attributes: pure

fortran
subroutine set_name(self, name)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inoutExpression.
namecharacter(len=*)inColumn header name.

Call graph

single_instruction ​

Make the code the one instruction op arg (by components: nvfortran 26.9 crashes copying an array constructor of a structure constructor whose components hold a deferred-length character, [instruction_object(...)]).

Attributes: pure

fortran
subroutine single_instruction(self, op, arg)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inoutExpression.
opinteger(kind=I4P)inOperation code.
arginteger(kind=I4P)inArgument.

Call graph

check_name ​

A user symbol name: a letter or _, then letters, digits, _.

Attributes: pure

fortran
subroutine check_name(name, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
namecharacter(len=*)inName.
iostatinteger(kind=I4P)out0 if valid.
iomsgcharacter(len=:)outallocatableError message.

Call graph

binary ​

c = a op b: an integer when both are and the result fits, else a real; ok false if undefined.

Attributes: pure

fortran
subroutine binary(op, a, b, c, ok)

Arguments

NameTypeIntentAttributesDescription
opinteger(kind=I4P)inOperation code.
atype(value_object)inLeft operand.
btype(value_object)inRight operand.
ctype(value_object)outResult.
oklogicalinoutDefined.

Call graph

integer_binary ​

c = i op j on integers; done false when the result is not an integer (overflow, negative power, atan2).

Attributes: pure

fortran
subroutine integer_binary(op, i, j, c, done, ok)

Arguments

NameTypeIntentAttributesDescription
opinteger(kind=I4P)inOperation code.
iinteger(kind=I8P)inLeft operand.
jinteger(kind=I8P)inRight operand.
ctype(value_object)inoutResult.
donelogicaloutInteger result computed.
oklogicalinoutDefined.

Call graph

unary_degrees ​

c = FUNCTIONS(f)(a) with the angles of the trigonometric functions in degrees; ok false if undefined. The argument in radians, both parts.

Attributes: pure

fortran
subroutine unary_degrees(f, a, c, ok)

Arguments

NameTypeIntentAttributesDescription
finteger(kind=I4P)inFunction index.
atype(value_object)inArgument.
ctype(value_object)outResult.
oklogicalinoutDefined.

Call graph

unary ​

c = FUNCTIONS(f)(a); ok false if undefined.

Attributes: pure, recursive

fortran
subroutine unary(f, a, c, ok)

Arguments

NameTypeIntentAttributesDescription
finteger(kind=I4P)inFunction index.
atype(value_object)inArgument.
ctype(value_object)outResult.
oklogicalinoutDefined.

Call graph

complex_binary ​

c = a op b, one of them complex, by gnuplot's formulas (internal.c); ok false if undefined.

Attributes: pure

fortran
subroutine complex_binary(op, a, b, c, ok)

Arguments

NameTypeIntentAttributesDescription
opinteger(kind=I4P)inOperation code.
atype(value_object)inLeft operand.
btype(value_object)inRight operand.
ctype(value_object)outResult.
oklogicalinoutDefined.

Call graph

complex_unary ​

c = name(a) for a complex argument (or a negative real one of sqrt, log, log10), by gnuplot's formulas (standard.c); the functions with no complex form here are undefined.

Attributes: pure, recursive

fortran
subroutine complex_unary(name, a, c, ok)

Arguments

NameTypeIntentAttributesDescription
namecharacter(len=*)inFunction name.
atype(value_object)inArgument.
ctype(value_object)outResult.
oklogicalinoutDefined.

Call graph

inverse_trig ​

c = name(re + i im) of the inverse circular and hyperbolic functions, gnuplot 6.0's formulas (standard.c: f_asin, f_acos, f_atan, f_asinh, f_acosh, f_atanh), their branch cuts and their undefined points included.

Attributes: pure

fortran
subroutine inverse_trig(name, re, im, c, ok)

Arguments

NameTypeIntentAttributesDescription
namecharacter(len=*)inasin, acos, atan, asinh, acosh or atanh.
rereal(kind=R8P)inReal part.
imreal(kind=R8P)inImaginary part.
ctype(value_object)outResult.
oklogicalinoutDefined.

Call graph

safe_add ​

z = x + y, undefined on overflow.

Attributes: pure

fortran
subroutine safe_add(x, y, z, ok)

Arguments

NameTypeIntentAttributesDescription
xreal(kind=R8P)inAddend.
yreal(kind=R8P)inAddend.
zreal(kind=R8P)outSum.
oklogicalinoutDefined.

Call graph

safe_power ​

z = x ** y on reals; undefined when complex (negative base, fractional exponent), infinite or overflowing.

Attributes: pure

fortran
subroutine safe_power(x, y, z, ok)

Arguments

NameTypeIntentAttributesDescription
xreal(kind=R8P)inBase.
yreal(kind=R8P)inExponent.
zreal(kind=R8P)outPower.
oklogicalinoutDefined.

Call graph

random_next ​

gnuplot 6.0's rand(x) on a, replaced by its value: x = 0 the next number of L'Ecuyer's combined generator (from seeds 1234567890), x < 0 the generator reset first, x > 0 an integer seed first; another x is "Illegal seed value".

fortran
subroutine random_next(a, ok, error)

Arguments

NameTypeIntentAttributesDescription
atype(value_object)inoutArgument, then value.
oklogicalinoutDefined.
errorinteger(kind=I4P)inoutType error.

Call graph

bitwise ​

c = a op b for the bitwise operators, of integers only (gnuplot: "non-integer passed to boolean operator"); the shifts as gnuplot's on x86: the count modulo 64, >> logical.

Attributes: pure

fortran
subroutine bitwise(op, a, b, c, ok, error)

Arguments

NameTypeIntentAttributesDescription
opinteger(kind=I4P)inOperation code.
atype(value_object)inLeft operand.
btype(value_object)inRight operand.
ctype(value_object)outResult.
oklogicalinoutDefined.
errorinteger(kind=I4P)inoutType error.

Call graph

special ​

c = special function f (MATH_FUNCTIONS) of args: strings read as numbers; an order (besjn, besyn, besin, expint) must be an integer, as gnuplot (E_ORDER); undefined (ok false) where gnuplot's is, and for a NaN or an infinity.

Attributes: pure

fortran
subroutine special(f, args, c, ok, error)

Arguments

NameTypeIntentAttributesDescription
finteger(kind=I4P)inFunction.
argstype(value_object)inoutArguments.
ctype(value_object)outValue.
oklogicalinoutDefined.
errorinteger(kind=I4P)inoutType error.

Call graph

numeric ​

Replace the string a by its leading number, as gnuplot reads a string in arithmetic: blanks, a sign, 0x and hex digits, or digits with a point and a lower case e exponent (an integer without point nor exponent); the rest is ignored. No number: ok false, E_NONNUMERIC.

Attributes: pure

fortran
subroutine numeric(a, ok, error)

Arguments

NameTypeIntentAttributesDescription
atype(value_object)inoutValue.
oklogicalinoutDefined.
errorinteger(kind=I4P)inoutType error.

Call graph

condition ​

A condition must be a number: a string is an error (gnuplot: non-integer passed to boolean operator).

Attributes: pure

fortran
subroutine condition(a, ok, error)

Arguments

NameTypeIntentAttributesDescription
atype(value_object)inValue.
oklogicalinoutDefined.
errorinteger(kind=I4P)inoutType error.

Call graph

string_binary ​

c = a . b (a a string, b a string or an integer), a eq b, a ne b (strings).

Attributes: pure

fortran
subroutine string_binary(op, a, b, c, ok, error)

Arguments

NameTypeIntentAttributesDescription
opinteger(kind=I4P)inOperation code.
atype(value_object)inLeft operand.
btype(value_object)inRight operand.
ctype(value_object)outResult.
oklogicalinoutDefined.
errorinteger(kind=I4P)inoutType error.

Call graph

substring ​

c = a[first:last], 1-based, the ends clamped to the string, empty if they cross.

Attributes: pure

fortran
subroutine substring(a, first, last, c, ok, error)

Arguments

NameTypeIntentAttributesDescription
atype(value_object)inString.
firsttype(value_object)inFirst character.
lasttype(value_object)inLast character.
ctype(value_object)outResult.
oklogicalinoutDefined.
errorinteger(kind=I4P)inoutType error.

Call graph

whole ​

Integer value of a (a real truncated, a string read as a number), for indices and counts.

Attributes: pure

fortran
subroutine whole(a, i, ok, error)

Arguments

NameTypeIntentAttributesDescription
atype(value_object)inValue.
iinteger(kind=I8P)outInteger.
oklogicalinoutDefined.
errorinteger(kind=I4P)inoutType error.

Call graph

string_function ​

c = STRING_FUNCTIONS(f)(args), as gnuplot's. SVG color, #rrggbb or #rrggbbaa (opacity). Value. Read status. A color.

Time read. Text matched.

Attributes: pure

fortran
subroutine string_function(f, args, c, ok, error)

Arguments

NameTypeIntentAttributesDescription
finteger(kind=I4P)inFunction index.
argstype(value_object)inArguments.
ctype(value_object)outResult.
oklogicalinoutDefined.
errorinteger(kind=I4P)inoutType error.

Call graph

sprintf_value ​

gnuplot's sprintf(format, ...): each C conversion takes the next argument (%s a string, the others a number: d i u o x X c its integer part, f F e E g G its real value), %% is %; once the arguments are used up the rest of the format is copied as it is, extra arguments are ignored.

Attributes: pure

fortran
subroutine sprintf_value(args, c, ok, error)

Arguments

NameTypeIntentAttributesDescription
argstype(value_object)inFormat and values.
ctype(value_object)outResult.
oklogicalinoutDefined.
errorinteger(kind=I4P)inoutType error.

Call graph

push_instruction ​

Append item to list (an unallocated list is empty), through a temporary: see push.

Attributes: pure

fortran
subroutine push_instruction(list, item)

Arguments

NameTypeIntentAttributesDescription
listtype(instruction_object)inoutallocatableList.
itemtype(instruction_object)inNew item.

index_of ​

v as an array index (a real truncated, a string's leading number): false if it is not a number.

Attributes: pure

fortran
subroutine index_of(v, i, ok)

Arguments

NameTypeIntentAttributesDescription
vtype(value_object)inValue.
iinteger(kind=I8P)outIndex.
oklogicaloutA number.

Call graph

push_array ​

Append item to list (an unallocated list is empty), through a temporary: see push.

Attributes: pure

fortran
subroutine push_array(list, item)

Arguments

NameTypeIntentAttributesDescription
listtype(user_array)inoutallocatableList.
itemtype(user_array)inNew item.

push_list ​

Append item to list (an unallocated list is empty), through a temporary: see push.

Attributes: pure

fortran
subroutine push_list(list, item)

Arguments

NameTypeIntentAttributesDescription
listtype(value_list)inoutallocatableList.
itemtype(value_list)inNew item.

push_value ​

Append item to list (an unallocated list is empty), through a temporary: see push.

Attributes: pure

fortran
subroutine push_value(list, item)

Arguments

NameTypeIntentAttributesDescription
listtype(value_object)inoutallocatableList.
itemtype(value_object)inNew item.

Call graph

push_name ​

Append item to list (an unallocated list is empty), through a temporary: see push.

Attributes: pure

fortran
subroutine push_name(list, item)

Arguments

NameTypeIntentAttributesDescription
listtype(name_object)inoutallocatableList.
itemtype(name_object)inNew item.

Call graph

push_variable ​

Append item to list (an unallocated list is empty), through a temporary: see push.

Attributes: pure

fortran
subroutine push_variable(list, item)

Arguments

NameTypeIntentAttributesDescription
listtype(user_variable)inoutallocatableList.
itemtype(user_variable)inNew item.

push_function ​

Append item to list (an unallocated list is empty), through a temporary: see push.

Attributes: pure

fortran
subroutine push_function(list, item)

Arguments

NameTypeIntentAttributesDescription
listtype(user_function)inoutallocatableList.
itemtype(user_function)inNew item.

push_expression ​

Append item to list (an unallocated list is empty), through a temporary: see push.

Attributes: pure

fortran
subroutine push_expression(list, item)

Arguments

NameTypeIntentAttributesDescription
listtype(expression_object)inoutallocatableList.
itemtype(expression_object)inNew item.

Functions ​

is_block ​

Whether name is a function block.

Attributes: pure

Returns: logical

fortran
function is_block(self, name) result(yes)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inSymbols.
namecharacter(len=*)inName.

Call graph

is_array ​

Whether name is an array.

Attributes: pure

Returns: logical

fortran
function is_array(self, name) result(yes)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inSymbols.
namecharacter(len=*)inName.

Call graph

array_size ​

Size of the array name, 0 if there is none.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function array_size(self, name) result(n)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inSymbols.
namecharacter(len=*)inName.

Call graph

array_text ​

The array name as gnuplot's print shows it: [1,2.5,"x",] (strings quoted, an element without a value empty); empty if there is no such array.

Attributes: pure

Returns: character(len=:)

fortran
function array_text(self, name) result(text)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inSymbols.
namecharacter(len=*)inArray name.

Call graph

defined ​

Whether name is a user variable, an array, or one of gnuplot's predefined pi and NaN.

Attributes: pure

Returns: logical

fortran
function defined(self, name) result(yes)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inSymbols.
namecharacter(len=*)inName.

Call graph

array_data ​

The array name as data lines (gnuplot's plot A): the index, then the value (a string quoted, NaN for an element without a value); empty if there is no such array.

Attributes: pure

Returns: character(len=:)

fortran
function array_data(self, name) result(text)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inSymbols.
namecharacter(len=*)inArray name.

Call graph

array_index ​

Index of the array name, 0 if none.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function array_index(self, name) result(k)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inSymbols.
namecharacter(len=*)inName.

Call graph

variable_index ​

Index of the variable name, 0 if none.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function variable_index(self, name) result(k)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inSymbols.
namecharacter(len=*)inName.

Call graph

function_index ​

Index of the function name, 0 if none.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function function_index(self, name) result(k)

Arguments

NameTypeIntentAttributesDescription
selfclass(symbols_object)inSymbols.
namecharacter(len=*)inName.

Call graph

evaluate ​

Value on a data row: row holds its cells (NaN if missing), point is its point number (column 0).

cells are the texts of the row cells (strcol), heads those of the first row of its dataset (columnhead), place its block within the dataset and its dataset (the pseudo-columns -1 and -2), all from 0; without them those functions and pseudo-columns are undefined. A complex value is undefined, or its real part with real_part (gnuplot's fit).

NaN if undefined. Every floating point operation is checked beforehand, so no IEEE exception is raised.

Attributes: recursive

Returns: real(kind=R8P)

fortran
function evaluate(self, row, point, cells, heads, place, real_part) result(v)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inExpression.
rowreal(kind=R8P)inRow cells.
pointinteger(kind=I4P)inPoint number.
cellstype(name_object)inoptionalRow cell texts.
headstype(name_object)inoptionalHeader cell texts of the row's dataset.
placeinteger(kind=I4P)inoptionalBlock within the dataset and dataset, from 0.
real_partlogicalinoptionalA complex value's real part, not undefined.

Call graph

cells_time ​

The time format reads from cell c on, the following cells joined by a blank as many times as the format has blanks (a time 2024-03-01 10:00 spans two whitespace separated cells, as gnuplot reads it); NaN if it does not match.

Attributes: pure

Returns: real(kind=R8P)

fortran
function cells_time(cells, c, format) result(t)

Arguments

NameTypeIntentAttributesDescription
cellstype(name_object)inRow cell texts.
cinteger(kind=I4P)inFirst cell.
formatcharacter(len=*)inTime format.

Call graph

evaluate_text ​

Text on a data row (arguments as evaluate), as gnuplot's label and tick label fields: a string value as it is; a number, the text of the first column the expression reads (gnuplot's using 1:2:($2*2) with labels writes the text of column 2), or the number as %g if it reads none; empty if undefined.

Attributes: recursive

Returns: character(len=:)

fortran
function evaluate_text(self, row, point, cells, heads, place) result(text)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inExpression.
rowreal(kind=R8P)inRow cells.
pointinteger(kind=I4P)inPoint number.
cellstype(name_object)inoptionalRow cell texts.
headstype(name_object)inoptionalHeader cell texts of the row's dataset.
placeinteger(kind=I4P)inoptionalBlock within the dataset and dataset, from 0.

Call graph

uses_text ​

Whether the expression reads the texts of the row cells (strcol), which the data must then keep.

Attributes: elemental

Returns: logical

fortran
function uses_text(self) result(uses)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inExpression.

Call graph

first_column ​

First data column (from 1) the expression reads, 0 if none (an unresolved name is none): the column whose header titles the item, as gnuplot title columnhead.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function first_column(self) result(c)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inExpression.

Call graph

plain_column ​

The data column (from 1) of a plain column field (using 2, using "name" once resolved), 0 for any other expression ($2, ($2*2), column 0): gnuplot skips a point whose plain column holds no number, and leaves an expression on it undefined.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function plain_column(self) result(c)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inExpression.

Call graph

reads_column ​

Whether the expression reads the data column c (from 1): as a plain column or $c. A column read through column(expr) is known only when evaluated: a missing cell there reads as undefined (gnuplot reads the column the expression asks for, histograms.dem's column(i) with set datafile missing).

Attributes: pure

Returns: logical

fortran
function reads_column(self, c) result(reads)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inExpression.
cinteger(kind=I4P)inColumn.

name_count ​

Number of column header names used.

Attributes: elemental

Returns: integer(kind=I4P)

fortran
function name_count(self) result(n)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inExpression.

Call graph

name_of ​

The k-th column header name.

Attributes: pure

Returns: character(len=:)

fortran
function name_of(self, k) result(name)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inExpression.
kinteger(kind=I4P)inName index.

Call graph

resolve ​

The expression with its column header names replaced by their column numbers in header (the names of columns 1, 2, ...; trailing blanks ignored); a name not in it reads no column: undefined.

Attributes: pure

Returns: type(expression_object)

fortran
function resolve(self, header) result(resolved)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inExpression.
headercharacter(len=*)inColumn names.

Call graph

value_at ​

Value of an expression compiled with a dummy variable at the variable value x; NaN if undefined (a complex value too, unless real_part: its real part).

Attributes: recursive

Returns: real(kind=R8P)

fortran
function value_at(self, x, real_part) result(v)

Arguments

NameTypeIntentAttributesDescription
selfclass(expression_object)inExpression.
xreal(kind=R8P)inVariable value.
real_partlogicalinoptionalA complex value's real part.

Call graph

present_true ​

Whether the optional flag is present and true.

Attributes: pure

Returns: logical

fortran
function present_true(flag) result(yes)

Arguments

NameTypeIntentAttributesDescription
flaglogicalinoptionalFlag.

Call graph

in_level ​

Whether operator is a binary operator of grammar level level.

Attributes: pure

Returns: logical

fortran
function in_level(operator, level) result(yes)

Arguments

NameTypeIntentAttributesDescription
operatorcharacter(len=*)inOperator.
levelinteger(kind=I4P)inLevel in LEVELS.

binary_code ​

Operation code of a binary operator.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function binary_code(operator) result(op)

Arguments

NameTypeIntentAttributesDescription
operatorcharacter(len=*)inOperator.

real_of ​

Real value of a.

Attributes: pure

Returns: real(kind=R8P)

fortran
function real_of(a) result(r)

Arguments

NameTypeIntentAttributesDescription
atype(value_object)inValue.

Call graph

truth ​

Whether a is not zero.

Attributes: pure

Returns: logical

fortran
function truth(a) result(yes)

Arguments

NameTypeIntentAttributesDescription
atype(value_object)inValue.

Call graph

logical_value ​

Integer 1 or 0.

Attributes: pure

Returns: type(value_object)

fortran
function logical_value(yes) result(a)

Arguments

NameTypeIntentAttributesDescription
yeslogicalinTruth.

Call graph

int_value ​

Integer value.

Attributes: pure

Returns: type(value_object)

fortran
function int_value(i) result(a)

Arguments

NameTypeIntentAttributesDescription
iinteger(kind=I8P)inInteger.

Call graph

fits_product ​

Whether i*j fits an I8P integer.

Attributes: pure

Returns: logical

fortran
function fits_product(i, j) result(yes)

Arguments

NameTypeIntentAttributesDescription
iinteger(kind=I8P)inFactor.
jinteger(kind=I8P)inFactor.

Call graph

magnitude ​

gnuplot's magnitude of a complex value, without spurious overflow.

Attributes: pure

Returns: real(kind=R8P)

fortran
function magnitude(a) result(m)

Arguments

NameTypeIntentAttributesDescription
atype(value_object)inValue.

Call graph

angle ​

gnuplot's angle of a complex value: 0 or pi for a real, atan2 else.

Attributes: pure

Returns: real(kind=R8P)

fortran
function angle(a) result(t)

Arguments

NameTypeIntentAttributesDescription
atype(value_object)inValue.

Call graph

complex_value ​

The value {re, im} (a real when im is 0).

Attributes: pure

Returns: type(value_object)

fortran
function complex_value(re, im) result(c)

Arguments

NameTypeIntentAttributesDescription
rereal(kind=R8P)inReal part.
imreal(kind=R8P)inImaginary part.

Call graph

divisible ​

Whether x / y is finite.

Attributes: pure

Returns: logical

fortran
function divisible(x, y) result(ok)

Arguments

NameTypeIntentAttributesDescription
xreal(kind=R8P)inDividend.
yreal(kind=R8P)inDivisor.

Call graph

closing ​

Position of the parenthesis closing the one at open in text (quotes skipped), 0 if none.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function closing(text, open) result(k)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.
openinteger(kind=I4P)inOpening parenthesis.

Call graph

top_comma ​

Position of the first comma of text outside quotes and brackets, 0 if none.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function top_comma(text) result(k)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.

Call graph

split_list ​

gnuplot 6.0's split: the pieces of string between occurrences of sep (each kept, blanks too), or its words for a blank or empty sep (runs of white space between them); none for an empty string.

Attributes: pure

Returns: type(value_list)

fortran
function split_list(string, sep) result(list)

Arguments

NameTypeIntentAttributesDescription
stringcharacter(len=*)inString.
sepcharacter(len=*)inSeparator.

Call graph

string_value ​

String value.

Attributes: pure

Returns: type(value_object)

fortran
function string_value(text) result(a)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.

Call graph

number_text ​

a as text: a string as it is, an integer in decimal, a real as gnuplot's print (%.15g, .0 if integral).

Attributes: pure

Returns: character(len=:)

fortran
function number_text(a) result(text)

Arguments

NameTypeIntentAttributesDescription
atype(value_object)inValue.

Call graph

undefined_value ​

gnuplot's undefined value (by components: nvfortran 26.9 crashes on its constructor here).

Attributes: pure

Returns: type(value_object)

fortran
function undefined_value() result(a)

Call graph

operands ​

Stack values the operation op reads (nargs, its v%i, for a string function call), 0 for those that only move them (a load, a call's arguments, a return).

Attributes: pure

Returns: integer(kind=I4P)

fortran
function operands(op, nargs) result(n)

Arguments

NameTypeIntentAttributesDescription
opinteger(kind=I4P)inOperation code.
nargsinteger(kind=I4P)inArguments of OP_CALL.

Call graph

error_text ​

Message of a type error.

Attributes: pure

Returns: character(len=:)

fortran
function error_text(error) result(text)

Arguments

NameTypeIntentAttributesDescription
errorinteger(kind=I4P)inError code.

Call graph

count_words ​

Number of blank-separated words of text.

Attributes: pure

Returns: integer(kind=I4P)

fortran
function count_words(text) result(n)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.

Call graph

nth_word ​

Word k (from 1) of text, empty if none.

Attributes: pure

Returns: character(len=:)

fortran
function nth_word(text, k) result(w)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.
kinteger(kind=I8P)inWord number.

Call graph

trim_blanks ​

text without leading and trailing blanks (spaces, tabs, new lines).

Attributes: pure

Returns: character(len=:)

fortran
function trim_blanks(text) result(t)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.

Call graph

is_blank ​

Whether c is a space, a tab or a new line.

Attributes: elemental

Returns: logical

fortran
function is_blank(c) result(yes)

Arguments

NameTypeIntentAttributesDescription
ccharacter(len=1)inCharacter.

Call graph

to_lower ​

Lower case of an ASCII letter.

Attributes: pure

Returns: character(len=1)

fortran
function to_lower(c) result(l)

Arguments

NameTypeIntentAttributesDescription
ccharacter(len=1)inCharacter.

Call graph

list_text ​

Elements as gnuplot's print shows an array: [1,2.5,"x",] (strings quoted, an element without a value empty).

Attributes: pure

Returns: character(len=:)

fortran
function list_text(list) result(text)

Arguments

NameTypeIntentAttributesDescription
listtype(value_list)inElements.

Call graph

slice_list ​

Elements first to last of list, clamped to it (gnuplot's A[0:9]), none if first > last.

Attributes: pure

Returns: type(value_list)

fortran
function slice_list(list, first, last) result(piece)

Arguments

NameTypeIntentAttributesDescription
listtype(value_list)inElements.
firstinteger(kind=I8P)inFirst index.
lastinteger(kind=I8P)inLast index.

Call graph

lines_list ​

The lines of a datablock text (each ended by a newline) as string elements.

Attributes: pure

Returns: type(value_list)

fortran
function lines_list(text) result(list)

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)inDatablock text.

Call graph

any_name ​

Whether list holds name.

Attributes: pure

Returns: logical

fortran
function any_name(list, name) result(yes)

Arguments

NameTypeIntentAttributesDescription
listtype(name_object)inList.
namecharacter(len=*)inName.

Call graph

Released under the GPL v3, BSD 2-Clause, BSD 3-Clause or MIT License.