GetOperationName() public abstract method

return the name of the operation.
public abstract GetOperationName ( ) : String
return String
 public SemanticOperationExecutionException(SemanticOperation action)
 {
     Debug.WriteLine("\n########################### ERROR " + action.GetOperationName()
             + " FAILED ###########################");
     //Console.WriteLine(ERROR_STRING);
 }
Example #2
0
        /**
         * main entry to handle semantic operations. FOR loops and IFs are handled directly (they have built-
         * in semantics and are not overridable). otherwise it will can the perform() method on the operation
         * object.
         *
         * @param action
         * @param parser
         * @param infoCollector
         */
        public void HandleSemanticOperation(SemanticOperation operation, DocumentParser parser, SemanticsGlobalScope infoCollector)
        {
            int state = GetOperationState(operation, "state", SemanticOperation.INIT);

            if (state == SemanticOperation.FIN || requestWaiting)
            {
                return;
            }
            //		debug("["+parser+"] semantic operation: " + action.getActionName() + ", SA class: " + action.getClassSimpleName() + "\n");

            operation.SemanticOperationHandler = this;

            // here state must be INTER or INIT

            // if state == INIT, we check pre-conditions
            // if state == INTER, because this must have been started, we skip checking pre-conditions
            if (state == SemanticOperation.INIT)
            {
                if (!CheckConditionsIfAny(operation))
                {
                    if (!(operation is IfSemanticOperation))
                    {
                        Debug.WriteLine("Semantic operation {0} not taken since (some) pre-requisite conditions are not met", operation);
                    }
                    return;
                }
            }
            else
            {
                Debug.WriteLine("re-entering operations with pre-conditions; checking pre-conditions skipped: " + operation.GetOperationName());
            }

            operation.SessionScope             = infoCollector;
            operation.SemanticOperationHandler = this;
            operation.DocumentParser           = parser;

            String operationName = operation.GetOperationName();

            try
            {
                if (SemanticOperationStandardMethods.ForEach.Equals(operationName))
                {
                    HandleForLoop((ForEachSemanticOperation)operation, parser, infoCollector);
                }
                else if (SemanticOperationStandardMethods.If.Equals(operationName))
                {
                    HandleIf((IfSemanticOperation)operation, parser, infoCollector);
                }
                else
                {
                    HandleGeneralOperation(operation);
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine("The action " + operationName
                                + " could not be executed. Please see the stack trace for errors.");
            }
            finally
            {
                if (!requestWaiting)
                {
                    SetOperationState(operation, "state", SemanticOperation.FIN);
                }
            }
        }