Пример #1
0
        public override IPStmt VisitPopStmt(PParser.PopStmtContext context)
        {
            if (machine?.IsSpec == true)
            {
                throw handler.IllegalMonitorOperation(context, context.POP().Symbol, machine);
            }

            if (!method.Signature.ReturnType.IsSameTypeAs(PrimitiveType.Null))
            {
                throw handler.ChangeStateInNonVoidFunction(context);
            }

            method.CanChangeState = true;
            if (method.Role.HasFlag(FunctionRole.TransitionFunction))
            {
                throw handler.ChangedStateMidTransition(context, method);
            }

            return(new PopStmt(context));
        }