Class Operation

    • Field Detail

      • _parseTreeWriter

        protected ParseTreeWriter _parseTreeWriter
        A parse tree writer to output the contents of a parse tree. For a node in the parse tree that is a string constant, it outputs the result of stringValue() instead of toString().
    • Constructor Detail

      • Operation

        public Operation​(GTIngredientList owner,
                         int elementCount)
        Construct an operation within the given list as its owner containing a given number of elements. All elements are enabled at the beginning.
        Parameters:
        owner - The list as the owner of the constructed GTIngredientList.
        elementCount - The number of elements that the GTIngredient has.
    • Method Detail

      • getChangeRequest

        public abstract ChangeRequest getChangeRequest​(Pattern pattern,
                                                       Replacement replacement,
                                                       MatchResult matchResult,
                                                       NamedObj patternObject,
                                                       NamedObj replacementObject,
                                                       NamedObj hostObject)
                                                throws IllegalActionException
        Get the change request to update the object in the host model.
        Parameters:
        pattern - The pattern of the transformation rule.
        replacement - The replacement of the transformation rule.
        matchResult - The match result.
        patternObject - The object in the pattern, or null.
        replacementObject - The object in the replacement that corresponds to the object in the pattern.
        hostObject - The object in the host model corresponding to the object in the replacement.
        Returns:
        The change request.
        Throws:
        IllegalActionException - If error occurs in generating the change request.
      • _evaluate

        protected ASTPtLeafNode _evaluate​(ASTPtRootNode parseTree,
                                          ParseTreeEvaluator evaluator,
                                          ParserScope scope)
                                   throws IllegalActionException
        Given a parse tree of a Ptolemy expression, evaluate it in the given scope and return a new constant AST node that has the result as its value.
        Parameters:
        parseTree - The parse tree.
        evaluator - The evaluator to be used.
        scope - The scope.
        Returns:
        The new AST node with the result as its value.
        Throws:
        IllegalActionException - If an error occurs during the evaluation.