Class TreeUtils


  • public class TreeUtils
    extends java.lang.Object
    Some tree utility methods.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • TreeUtils

        public TreeUtils()
    • Method Detail

      • getContainingRule

        public static RuleTreeNode getContainingRule​(TreeNode node)
        Returns the containing rule.
        Parameters:
        node - the node to start searching at
        Returns:
        the containing rule (null if there is no containing rule)
      • addErrorString

        private static final java.lang.String addErrorString​(java.lang.String error,
                                                             java.lang.String text)
        Adds text to error.
        Parameters:
        error - the error text accumulated so far (may be null)
        text - the text to be added
        Returns:
        the modified error text
      • insertOperation

        public static java.lang.String insertOperation​(Script script,
                                                       TreeNode node,
                                                       TreeNode.InsertionPoint insertionPoint,
                                                       IMetaOperation operation,
                                                       Argument[] arguments)
        Inserts operation at node into the containing rule considering the insertionPoint and the user specified arguments.
        Parameters:
        script - the script to insert into
        node - the node to insert at
        insertionPoint - the actual insertion point
        operation - the operation (call) to insert
        arguments - the user-supplied arguments of the call
        Returns:
        null in case of success, the errors detected else
      • store

        public static void store​(Script script)
                          throws VilException
        Stores a VIL script.
        Parameters:
        script - the script to be stored
        Throws:
        VilException - in case of something going wrong