Class that provides code generation helper utilities. More...
Classes |
|
| class | Type |
| Class that provides code generation helper functions dealing with SPL type inspection. More... |
|
Public Functions |
|
| void | headerPrologue (scalar model, scalar includes) |
| void | headerEpilogue (scalar model) |
| void | implementationPrologue (scalar model) |
| void | implementationEpilogue (scalar model) |
| bool | hasSideEffectInAssignments (scalar port) |
| bool | hasStreamAttributeInAssignments (scalar port) |
| string | getOutputTupleCppInitializer (scalar port) |
| string | getOutputTupleCppAssignments (scalar tupleName, scalar port) |
| string | getOutputTupleCppAssignmentsWithSideEffects (scalar tupleName, scalar port, scalar sideEffects) |
| retval | getOutputTupleCppAssignmentsWithSideEffects (scalar tupleName, scalar outputPort, scalar sideEffects) |
| list | getParameterCppTypes (scalar param) |
| string | getParameterCppInitializer (scalar param) |
| string | adaptCppExpression (scalar cppExpr, list tuples) |
| string | prefixLiteralsAndStatesInCppExpressions (scalar cppExpr, scalar prefix) |
| string | extractPerlValue (scalar cppExpr, scalar splType) |
| void | emitSubmitOutputTuple (scalar outputPort, scalar inputPort) |
| void | emitSubmitCachedOutputTuple (scalar cachedTupleName, scalar outputPort, scalar inputPort) |
| string | emitClass (scalar model, scalar name, list types) |
| string | getWindowCppType (scalar window, scalar tupleType, scalar partitionType, scalar dataType, scalar storageType) |
| string | getWindowCppInitializer (scalar window, scalar tupleType, scalar attrbGetterE, scalar attrbGetterT) |
| string | getPartitionedWindowCppInitializer (scalar window, scalar tupleType, scalar selectionType, scalar attrbGetterE, scalar attrbGetterT) |
| string | getWindowPolicyCppObject (scalar window, scalar eviction, scalar tupleType, scalar attrbGetter) |
| string | getWindowPartitionEvictionPolicyInitializer (scalar window, scalar selectionType) |
| string | getWindowEventCppType (scalar window, scalar tupleType, scalar partitionType, scalar dataType, scalar storageType) |
| list | createWindowConfigurations (list confs) |
| void | validateWindowConfiguration (scalar iport, scalar confs) |
| bool | checkWindowConfiguration (scalar iport, scalar confs) |
| bool | isInputTupleForwarded (scalar outputPort, scalar inputPort, scalar checkMutation) |
| void | checkMinimalSchema (scalar port, list schema) |
| void | checkMaximalSchema (scalar port, list schema) |
| void | checkAnySchema (scalar port, list schema) |
| void | print (scalar msg, list params) |
| void | println (scalar msg, list params) |
| void | printVerbose (scalar msg, list params) |
| void | printlnVerbose (scalar msg, list params) |
| void | warn (scalar msg, list params, scalar sloc) |
| void | warnln (scalar msg, list params, scalar sloc) |
| void | warnVerbose (scalar msg, list params, scalar sloc) |
| void | warnlnVerbose (scalar msg, list params, scalar sloc) |
| void | error (scalar msg, list params, scalar sloc) |
| void | errorln (scalar msg, list params, scalar sloc) |
| void | exit (scalar msg, list params, scalar sloc) |
| void | exitln (scalar msg, list params, scalar sloc) |
| void | runtimePath (scalar model, scalar path, scalar varName) |
| void | compileTimeExpression (scalar model, scalar paramValue) |
Additional Inherited Members |
Class that provides code generation helper utilities.
| void SPL::CodeGen::headerPrologue | ( | scalar | model, |
| scalar | includes | ||
| ) |
Given an operator instance model, produces the prolog code for the operator's header code generator template
| model | the operator instance model |
| includes | optional lines (passed in as a list reference) to be generated after the inclusion guards, but before any includes |
| void SPL::CodeGen::headerEpilogue | ( | scalar | model | ) |
Given an operator instance model, produces the epilog code for the operator's header code generator template
| model | the operator instance model |
| void SPL::CodeGen::implementationPrologue | ( | scalar | model | ) |
Given an operator instnce model, produces the prolog code for the operator's implementation code generator template
| model | the operator instance model |
| void SPL::CodeGen::implementationEpilogue | ( | scalar | model | ) |
Given an operator instance model, produces the epilog code for the operator's implementation code generator template
| model | the operator instance model |
| bool SPL::CodeGen::hasSideEffectInAssignments | ( | scalar | port | ) |
Given an output port object, return true if any output assignment expression has side effects, otherwise false. This can be used to pull output tuple initialization out of a loop.
| port | the output port object |
Example: For
tuple<int8 a, int8 b>, andoutput S : a = x, b = y; this function will return 0.For
output S : a = x++, b = statefulFunction(y); this function will return 1.| bool SPL::CodeGen::hasStreamAttributeInAssignments | ( | scalar | port | ) |
Given an output port object, return true if any output assignment expression contains an input attribute within the expression. This can be used to pull output tuple initialization out of a loop
| port | the output port object |
Example: For
tuple<int8 a, int8 b>, andoutput S : a = x, b = y; this function will return 1 if x or y are input stream attributes, 0 if they are both state variables.| string SPL::CodeGen::getOutputTupleCppInitializer | ( | scalar | port | ) |
Given an output port object, return the C++ expression which can be used to initialize a tuple for the port with the output assignments.
| port | the output port object |
Example: For
tuple<int8 a, int8 b>, andoutput S : a = x, b = y;this function will produce the following:
$iport0.get_x(), $iport0.get_y()This can be used as:
If an output assignment uses a Custom Output Function, the result will contain a call to a function of the same name. If this is not desired, the operator should walk the assignments one at a time, examining each one to generate the desired code.
| string SPL::CodeGen::getOutputTupleCppAssignments | ( | scalar | tupleName, |
| scalar | port | ||
| ) |
Given a tuple name and an output port object, return a C++ code segment which can be used to assign an already initialized tuple for the port with the output attribute assignments captured in the output port object.
| tupleName | the name of the variable holding an initialized tuple |
| port | the output port object |
Example: For
tuple<int8 a, int8 b>, andoutput S : a = x, b = y;getOutputTupleCppAssignments('fred', $port) will produce the following:
fred.set_a($iport0.get_x()); fred.set_b($iport0.get_y());| string SPL::CodeGen::getOutputTupleCppAssignmentsWithSideEffects | ( | scalar | tupleName, |
| scalar | port, | ||
| scalar | sideEffects | ||
| ) |
Given a tuple name and an output port object, return a C++ code segment which can be used to assign an already initialized tuple for the port with the output attribute assignments captured in the output port object. This is the same as getOutputTupleCppAssignments except for the additional sideEffects parameter which is used to specify whether we want assignments which contain side effects on the RHS (or not).
| tupleName | the name of the variable holding an initialized tuple |
| port | the output port object |
| sideEffects | If true then we only want assignments with side effects otherwise we only want assignments which have no side effects |
Example: For
tuple<int8 a, int8 b>, andoutput S : a = x, b = y++;getOutputTupleCppAssignments('fred', $port, 1) will produce the following:
fred.set_b($iport0.get_y());| list SPL::CodeGen::getParameterCppTypes | ( | scalar | param | ) |
Given a parameter object, return a list of C++ types corresponding to the expressions contained within the parameter. The resulting list can be used as the types parameter in an emitClass call.
| param | parameter object |
| string SPL::CodeGen::getParameterCppInitializer | ( | scalar | param | ) |
Given a parameter object, return a C++ expresion that can be used as the constructor initializer for an object of type returned by an emitClass call.
| param | parameter object |
Example: For
param key: a, sqrt(b);this function will produce the following:
$iport0.get_a(),SPL:Functions::Math::sqrt($iport0.get_b())| string SPL::CodeGen::adaptCppExpression | ( | scalar | cppExpr, |
| list | tuples | ||
| ) |
Obtain the C++ expression adapted for the given tuple context, where the references to input tuples are replaced with the names given by the tuples parameter.
| cppExpr | C++ expression to adapt to the tuple context |
| tuples | list of tuple variable names for the input ports |
Example: Consider a Filter operator with a filter parameter that defines a predicate over the input tuple attributes. Here is how one can use the filter expression from within the code generator template:
| string SPL::CodeGen::prefixLiteralsAndStatesInCppExpressions | ( | scalar | cppExpr, |
| scalar | prefix | ||
| ) |
Obtain the C++ expression with all references to lit$[0-9]*, state$ and iport$[0-9]+History prefixed by the prefix parameter.
| cppExpr | C++ expression to prefix literals and state references in |
| prefix | prefix to be prepended to the 'lit$x' and 'state$' term |
Example: Consider operator with a helper class that needs to handle general C++ expressions. The helper class will need to ensure that literals and state variable s(which are in the base operator class) can be compiled in C++. If the helper class has a reference to the operator class in variable _oper, then we can prefix "_oper." to all literals, and the C++ expression will be valid. a predicate over the input tuple attributes. Here is how one can use the C++ expression from a Helper class:
| string SPL::CodeGen::extractPerlValue | ( | scalar | cppExpr, |
| scalar | splType | ||
| ) |
Obtain the Perl value from a C++ expression of a given SPL type.
| cppExpr | C++ expression to convert to a Perl value |
| splType | SPL type of the C++ expression |
Example: Consider a Filter operator with a filter parameter that defines a predicate over the input tuple attributes. Here is how one can use the filter expression from within the code generator template:
| void SPL::CodeGen::emitSubmitOutputTuple | ( | scalar | outputPort, |
| scalar | inputPort | ||
| ) |
Generate code to submit a tuple to a given output port. If the output attribute assignments indicate that the tuple is simply forwarded from the given input port, then the generated code will not create a separate tuple and will just forward the input one, as long as the port mutability settings allow it.
| outputPort | The output port that we want to submit the tuple to |
| inputPort | The input port from which a tuple is potentially forwarded |
Example: emitSubmitOutputTuple($iport, $oport) will produce the following code submit($iport0, 0); if the output port index is 0, the output assignments indicate a simple forwarding, and the port mutability settings allow submitting the input tuple directly to the output port. Otherwise, it will generate code like: OPort0Type otuple($iport0.get_x()+5); submit(otuple, 0);.
| void SPL::CodeGen::emitSubmitCachedOutputTuple | ( | scalar | cachedTupleName, |
| scalar | outputPort, | ||
| scalar | inputPort | ||
| ) |
Generate code to submit a cached tuple to a given output port. If the output attribute assignments indicate that the tuple is simply forwarded from the given input port, then the generated code will not populate the cached tuple and will just forward the input one, as long as the port mutability settings allow it.
| cachedTupleName | Name for the output tuple |
| outputPort | The output port that we want to submit the tuple to |
| inputPort | The input port from which a tuple is potentially forwarded |
Example: emitSubmitCachedOutputTuple('fred', $iport, $oport) will produce the following code submit($iport0, 0); if the output port index is 0, the output assignments indicate a simple forwarding, and the port mutability settings allow submitting the input tuple directly to the output port. Otherwise, it will generate code like: fred.set_x($iport0.get_x()+5); submit(fred, 0);.
| string SPL::CodeGen::emitClass | ( | scalar | model, |
| scalar | name, | ||
| list | types | ||
| ) |
Given a name and a list of types, generates a C++ class that is hashable and contains member fields with the specified types. The class will have public members with the names 'field<index>_', one for each element in the $types list. The class will also have empty, copy, and member initializer constructors, assignment operator, as well as equality and non-equality comparison operators.
| model | the operator instance model |
| name | local name for the class (must uniqiely identify the class within the operator) |
| types | a list reference that holds the C++ types of the members |
Example usage from within a code generator template:
| string SPL::CodeGen::getWindowCppType | ( | scalar | window, |
| scalar | tupleType, | ||
| scalar | partitionType, | ||
| scalar | dataType, | ||
| scalar | storageType | ||
| ) |
Given a window object from the operator instance model, returns the C++ type for the window.
| window | window object from the operator instance model |
| tupleType | C++ type of the tuple to be stored in the window |
| partitionType | optional C++ type of the partitions within the window; when subsequent parameter ($dataType or $storageType) need to be specified, set $partitionType to '' for unpartitioned window |
| $dataType | optional parameter for the C++ data type for the window, can be either'std::deque' (default) or 'SPL::IncrDeque' |
| $storageType | optional parameter for the C++ storage type for the window, can be either 'std::tr1::unordered_map' (default) or 'SPL::IncrUnorderedMap' |
Example 1: For a partitioned sliding window with a count-based eviction policy and a delta-based trigger policy,
getWindowCppType($window, "MyTupleT", "MyPartitionT")will produce the following:
SPL::SlidingWindow<MyTupleT, MyPartitionT>Example 2: For an un-partitioned tumbling window with a count-based eviction and a count-based trigger policy,
getWindowCppType($window, "MyTupleT")will produce the following:
SPL::TumblingWindow<MyTupleT>Example 3: For an un-partitioned sliding window with a count-based eviction and a count-based trigger policy and incremental checkpointing,
getWindowCppType($window, "MyTupleT", '', 'SPL::IncrDeque', 'SPL::IncrUnorderedMap')will produce the following:
SPL::SlidingWindow<MyTupleT, int32_t, SPL::IncrDeque<MyTupleT>, SPL::IncrUnorderedMap<int32_t, SPL::IncrDeque<MyTupleT> > >| string SPL::CodeGen::getWindowCppInitializer | ( | scalar | window, |
| scalar | tupleType, | ||
| scalar | attrbGetterE, | ||
| scalar | attrbGetterT | ||
| ) |
Given a window object from the operator instance model, returns the C++ type initializer for the window.
| window | window object from the operator instance model |
| tupleType | C++ type of the tuple to be stored in the window |
| attrbGetterE | optional name of the member function within the $tupleType, which is used to access the delta-based eviction policy attribute. This parameter is not used for window policies other than delta-based ones. If not specified, get_<delta-attribute-name> will be used |
| attrbGetterT | optional name of the member function within the $tupleType, which is used to access the delta-based trigger policy attribute. This parameter is not used for window policies other than delta-based ones. If not specified, get_<delta-attribute-name> will be used |
Example: For a sliding window with a count-based eviction policy of size 10 and a delta-based trigger policy on an int32 attribute with a delta of 15, the call
getWindowCppInitializer($window, "MyTupleT", "", "get_age")will produce the following:
*this, 0, SPL::CountWindowPolicy(10), SPL::DeltaWindowPolicy<MyTupleT,uint32,&MyTupleT::get_age>(15)| string SPL::CodeGen::getPartitionedWindowCppInitializer | ( | scalar | window, |
| scalar | tupleType, | ||
| scalar | selectionType, | ||
| scalar | attrbGetterE, | ||
| scalar | attrbGetterT | ||
| ) |
Given a window object for a partitioned window from the operator instance model, returns the C++ type initializer for the window.
| window | window object from the operator instance model |
| tupleType | C++ type of the tuple to be stored in the window |
| selectionType | Algorithm to use for partion selection. Supported algorithms are "LRU" and "OperatorDefined". |
| attrbGetterE | optional name of the member function within the $tupleType, which is used to access the delta-based eviction policy attribute. This parameter is not used for window policies other than delta-based ones. If not specified, get_<delta-attribute-name> will be used |
| attrbGetterT | optional name of the member function within the $tupleType, which is used to access the delta-based trigger policy attribute. This parameter is not used for window policies other than delta-based ones. If not specified, get_<delta-attribute-name> will be used |
Example: For a sliding window with a count-based eviction policy of size 10 and a delta-based trigger policy on an int32 attribute with a delta of 15, and partitioned(tupleCount(100)), the call
getPartitionedWindowCppInitializer($window, "MyTupleT", "LRU", "", "get_age")will produce the following:
*this, 0, SPL::CountWindowPolicy(10), SPL::DeltaWindowPolicy<MyTupleT,uint32,&MyTupleT::get_age>(15), ::SPL::TupleCountPartitionEvictionPolicy(100, ::SPL::PartitionEvictionPolicy::LRU)| string SPL::CodeGen::getWindowPolicyCppObject | ( | scalar | window, |
| scalar | eviction, | ||
| scalar | tupleType, | ||
| scalar | attrbGetter | ||
| ) |
Given a window object from the operator instance model and a window policy, returns the code that creates a C++ object for the policy
| window | window object from the operator instance model |
| eviction | 1 if eviction policy, 0 if trigger policy |
| tupleType | C++ type of the tuple to be stored in the window |
| attrbGetter | optional name of the member function within the $tupleType, which is used to access the delta-based window policy attribute. This parameter is not used for window policies other than delta-based ones. If not specified, get_<delta-attribute-name> will be used |
Example 1: For a sliding window with a count-based eviction policy of size 10, the call
getWindowPolicyCppObject($window, 1, "MyTupleT")will produce the following:
SPL::CountWindowPolicy(10)Example 2: For a sliding window with a delta-based trigger policy on an int32 attribute with a delta of 15, the call
getWindowPolicyCppObject($window, 0, "MyTupleT", "get_age")will produce the following:
SPL::DeltaWindowPolicy<MyTupleT,uint32,&MyTupleT::get_age>(15)Example 3: For a sliding window with a delta-based trigger policy on an int32 attribute with a delta of 15, where the window stores pointers, the call
getWindowPolicyCppObject($window, 0, "MyTupleT*", "get_age")will produce the following:
SPL::DeltaWindowPolicy<MyTupleT*,uint32,&MyTupleT::get_age>(15)| string SPL::CodeGen::getWindowPartitionEvictionPolicyInitializer | ( | scalar | window, |
| scalar | selectionType | ||
| ) |
Given a window object from the operator instance model, returns the C++ initializer that can be appended to the window initializer to set the partition evicition policy. If there is no partition eviction policy, return an empty string
| window | window object from the operator instance model |
| selectionType | Algorithm to use for partion selection. Supported algorithms are "LRU" and "OperatorDefined". |
Example: For a partition eviction policy of partitionAge(value), return
, ::SPL::PartitionEvictionPolicy::PartitionAge(value)| string SPL::CodeGen::getWindowEventCppType | ( | scalar | window, |
| scalar | tupleType, | ||
| scalar | partitionType, | ||
| scalar | dataType, | ||
| scalar | storageType | ||
| ) |
Given a window object from the operator instance model, returns the C++ type for the WindowEvent class that is used to handle events from the window.
| window | window object from the operator instance model |
| tupleType | C++ type of the tuple to be stored in the window |
| partitionType | optional C++ type of the partitions within the window; when subsequent parameter ($dataType or $storageType) need to be specified, set $partitionType to '' for unpartitioned window |
| $dataType | optional parameter for the C++ data type for the window, can be either'std::deque' (default) or 'SPL::IncrDeque' |
| $storageType | optional parameter for the C++ storage type for the window, can be either 'std::tr1::unordered_map' (default) or 'SPL::IncrUnorderedMap' |
Example 1: For a partitioned sliding window with a count-based eviction policy and a delta-based trigger policy,
getWindowEventCppType($window, "MyTupleT", "MyPartitionT")will produce the following:
SPL::WindowEvent<MyTupleT, MyPartitionT>Example 2: For an un-partitioned sliding window with a count-based eviction and a count-based trigger policy,
getWindowEventCppType($window, "MyTupleT")will produce the following:
SPL::WindowEvent<MyTupleT>Example 3: For an un-partitioned sliding window with a count-based eviction and a count-based trigger policy and incremental checkpointing,
getWindowEventCppType($window, "MyTupleT", '', 'SPL::IncrDeque', 'SPL::IncrUnorderedMap')will produce the following:
SPL::WindowEvent<MyTupleT, int32_t, SPL::IncrDeque<MyTupleT>, SPL::IncrUnorderedMap<int32_t, SPL::IncrDeque<MyTupleT> > >| list SPL::CodeGen::createWindowConfigurations | ( | list | confs | ) |
Given a list of window configurations, verify that the configurations are valid and return a reference to a list of configurations that can be used as input to validateWindowConfiguration and checkWindowConfiguration functions. The input list contains one hash reference for each configuration. A hash that represents a window configuration contains one or more of the following mappings:
| confs | list of valid window configurations |
| confs | reference to the list of valid window configurations |
| void SPL::CodeGen::validateWindowConfiguration | ( | scalar | iport, |
| scalar | confs | ||
| ) |
Given an input port and a list of window configurations (created via createWindowConfigurations), verifies that the input port has a valid window configuration. Prints an error message and exits if the window configuration of the input port is not among the provided configurations.
| iport | the input port object from the operator instance model |
| confs | a list of valid window configurations, see createWindowConfigurations function for details. |
Example use from the Sort operator:
| bool SPL::CodeGen::checkWindowConfiguration | ( | scalar | iport, |
| scalar | confs | ||
| ) |
Given an input port and a list of window configurations (created via createWindowConfigurations), checks if the input port has a valid window configuration. Returns 0 if the window configuration of the input port is not among the provided configurations, and 1 otherwise.
| iport | the input port object from the operator instance model |
| confs | a list of valid window configurations, see createWindowConfigurations function for details. |
Example use from the Sort operator:
| bool SPL::CodeGen::isInputTupleForwarded | ( | scalar | outputPort, |
| scalar | inputPort, | ||
| scalar | checkMutation | ||
| ) |
Check if the output tuple to be created is an exact copy of the input tuple
| outputPort | the output port that we want to submit a tuple to |
| inputPort | the input port from which the tuples are potentially forwarded |
| checkMutation | if 1, check that the port mutation settings allow forwarding the input tuple directly, without creating a copy |
| void SPL::CodeGen::checkMinimalSchema | ( | scalar | port, |
| list | schema | ||
| ) |
Given an input or output port, and a list of schema restrictions, ensure that the tuple that the port is consuming/producing contains all of the desired schema name/types. If there are attributes/types missing from the tuple, generate an error. For each restriction, there must be at least one attribute that satisfies it.
| port | input or output port object whose schema is to be checked |
| schema | list of name/type pairs that must be present in the input/output tuple |
schema is a list of hash references that represent schema restrictions using one or more of the following mappings:
name => "attributeName"type => "splType" or type => [ "splType", "splType" ... ]NOTE: The only blanks allowed in the SPL type string are those that separate a tuple attribute type from the name ("int32 attr"). All types are 'unwound' to the expanded SPL type. User defined type names are not allowed.
Here is an example use, which is looking for an attribute foo with type rstring or int32, any attribute with type tuple<int32 x, rstring y>, and an attribute bar with any type.
| void SPL::CodeGen::checkMaximalSchema | ( | scalar | port, |
| list | schema | ||
| ) |
Given an input or output port, and a list of schema restrictions, ensure that the tuple that the port is consuming/producing only contains attributes with the desired schema name/types. If there are attributes or types in the schema that are not supported, generate an error. For each attribute, there must be at least one restriction that permits it.
| port | input or output port object whose schema is to be checked |
| schema | list of name/type pairs that are valid in the input/output tuple |
schema is a list of hash references that represent schema restrictions using one or more of the following mappings:
name => "attributeName"type => "splType" or type => [ "splType", "splType" ... ]NOTE: The only blanks allowed in the SPL type string are those that separate a tuple attribute type from the name ("int32 attr"). All types are 'unwound' to the expanded SPL type. User defined type names are not allowed.
Here is an example use: If attribute foo is present, it must have type rstring or ustring, any attribute with type tuple<int32 x, rstring y> is acceptable, and an attribute with name bar' is allowed.
| void SPL::CodeGen::checkAnySchema | ( | scalar | port, |
| list | schema | ||
| ) |
Given an input or output port, and a list of schema restrictions, ensure that the tuple that the port is consuming/producing contains attributes of the right names/types. If an attribute in the tuple is in the list of restrictions, it must have the right type. Any attributes NOT in the schema restrictions are accepted without errors. For each attribute, there must be at least one restriction with a matching name that is satisfied.
| port | input or output port from the operator model to be checked |
| schema | list of name/type pairs that must be present in the input/output tuple |
schema is a list of hash references that represent schema restrictions using one or more of the following mappings:
name => "attributeName"type => "splType" or type => [ "splType", "splType" ... ]NOTE: The only blanks allowed in the SPL type string are those that separate a tuple attribute type from the name ("int32 attr"). All types are 'unwound' to the expanded SPL type. User defined type names are not allowed.
Here is an example use: If an attribute foo is present, it must have type rstring or int32,
| void SPL::CodeGen::print | ( | scalar | msg, |
| list | params | ||
| ) |
This function allows printing to the console during code generation. During code generation STDOUT is redirected. Attempts to print to it will result in corruption of the code generator. Note that if no optional params are passed the Perl print function will be called.
| msg | a string containing text to be printed, which may optionally contain format characters (see printf function of Perl), in which case a set of parameters should follow the message |
| params | an optional list of parameters to satisfy the format chars in msg |
| void SPL::CodeGen::println | ( | scalar | msg, |
| list | params | ||
| ) |
This function is similar to the print() method with the addition of a new line added at the end.
| msg | a string containing text to be printed, which may optionally contain format characters (see printf function of Perl), in which case a set of parameters should follow the message |
| params | an optional list of parameters to satisfy the format chars in msg |
| void SPL::CodeGen::printVerbose | ( | scalar | msg, |
| list | params | ||
| ) |
This function is similar to the print() method except that it only prints if the -v or –verbose-mode compiler option has been specified.
| msg | a string containing text to be printed, which may optionally contain format characters (see printf function of Perl), in which case a set of parameters should follow the message |
| params | an optional list of parameters to satisfy the format chars in msg |
| void SPL::CodeGen::printlnVerbose | ( | scalar | msg, |
| list | params | ||
| ) |
This function is similar to the println() method except that it only prints if the -v or –verbose-mode compiler option has been specified.
| msg | a string containing text to be printed, which may optionally contain format characters (see printf function of Perl), in which case a set of parameters should follow the message |
| params | an optional list of parameters to satisfy the format chars in msg |
| void SPL::CodeGen::warn | ( | scalar | msg, |
| list | params, | ||
| scalar | sloc | ||
| ) |
Prints 'WARNING' plus the contents of the format string.
| msg | a string containing text to be printed, which may optionally contain format characters (see printf function of Perl), in which case a set of parameters should follow the message. A leading CDISP[0-9][0-9][0-9][0-9][EW] will be moved to before the WARNING |
| params | an optional list of parameters to satisfy the format chars in msg |
| sloc | an optional reference to a SourceLocation object |
| void SPL::CodeGen::warnln | ( | scalar | msg, |
| list | params, | ||
| scalar | sloc | ||
| ) |
This function is the same as warn() with the addition of a newline at the end.
| msg | a string containing text to be printed, which may optionally contain format characters (see printf function of Perl), in which case a set of parameters should follow the message |
| params | an optional list of parameters to satisfy the format chars in msg |
| sloc | an optional reference to a SourceLocation object |
| void SPL::CodeGen::warnVerbose | ( | scalar | msg, |
| list | params, | ||
| scalar | sloc | ||
| ) |
This function is the same as warn() except that it only prints if the -v or –verbose-mode compiler option has been specified.
| msg | a string containing text to be printed, which may optionally contain format characters (see printf function of Perl), in which case a set of parameters should follow the message |
| params | an optional list of parameters to satisfy the format chars in msg |
| sloc | an optional reference to a SourceLocation object |
| void SPL::CodeGen::warnlnVerbose | ( | scalar | msg, |
| list | params, | ||
| scalar | sloc | ||
| ) |
This function is the same as warnVerbose() with the addition of a new line at the end.
| msg | a string containing text to be printed, which may optionally contain format characters (see printf function of Perl), in which case a set of parameters should follow the message |
| params | an optional list of parameters to satisfy the format chars in msg |
| sloc | an optional reference to a SourceLocation object |
| void SPL::CodeGen::error | ( | scalar | msg, |
| list | params, | ||
| scalar | sloc | ||
| ) |
Prints 'ERROR ' plus the format string to STDERR.
| msg | a string containing text to be printed, which may optionally contain format characters (see printf function of Perl), in which case a set of parameters should follow the message. A leading CDISP[0-9][0-9][0-9][0-9]E will be moved to before the ERROR |
| params | an optional list of parameters to satisfy the format chars in msg |
| sloc | an optional reference to a SourceLocation object |
| void SPL::CodeGen::errorln | ( | scalar | msg, |
| list | params, | ||
| scalar | sloc | ||
| ) |
This function is the same as error() with the addition of a newline at the end.
| msg | a string containing text to be printed, which may optionally contain format characters (see printf function of Perl), in which case a set of parameters should follow the message |
| params | an optional list of parameters to satisfy the format chars in msg |
| sloc | an optional reference to a SourceLocation object |
| void SPL::CodeGen::exit | ( | scalar | msg, |
| list | params, | ||
| scalar | sloc | ||
| ) |
This function enables the printing of the format string to STDERR prior to exiting.
| msg | a string containing text to be printed, which may optionally contain format characters (see printf function of Perl), in which case a set of parameters should follow the message |
| params | an optional list of parameters to satisfy the format chars in msg |
| sloc | an optional reference to a SourceLocation object |
| void SPL::CodeGen::exitln | ( | scalar | msg, |
| list | params, | ||
| scalar | sloc | ||
| ) |
This method provides the same functionality as exitln with the addition of a new line at the end.
| msg | a string containing text to be printed, which may optionally contain format characters (see printf function of Perl), in which case a set of parameters should follow the message |
| params | an optional list of parameters to satisfy the format chars in msg |
| sloc | an optional reference to a SourceLocation object |
| void SPL::CodeGen::runtimePath | ( | scalar | model, |
| scalar | path, | ||
| scalar | varName | ||
| ) |
This method takes a compile-time path and converts it to a runtime path. If the compile-time path points into a toolkit, then that path will reflect the runtime location of that toolkit, otherwise the original path will be used.
| model | the operator instance model |
| path | the path to be converted |
| varName | the variable name to assign the runtime path to |
| void SPL::CodeGen::compileTimeExpression | ( | scalar | model, |
| scalar | paramValue | ||
| ) |
This method takes a paramenter value representing a run-time path and converts it to an expression that can be used at compile time to access resources. undef is returned if the parameter value cannot be evaluated. The operator model must specify <splExpressionTree param="true"> for this to be used.
| model | the operator instance model |
| paramValue | The parameter value to be converted |