예제 #1
0
		public ConditionalStmt(ShortPosition position, Expression condition, Statement/*!*/ statement)
		{
            this.Position = position;
			this.condition = condition;
			this.statement = statement;
		}
예제 #2
0
		/// <summary>
		/// Emits a body of an arg-full function or method overload.
		/// </summary>
		public void EmitArgfullOverloadBody(PhpRoutine/*!*/ routine, List<Statement>/*!*/ body, Position entirePosition, ShortPosition declarationBodyPosition)
		{
			Debug.Assert(!routine.IsAbstract);

            if (context.Config.Compiler.Debug)
            {
                if (!routine.IsLambda)
                {
                    MarkSequencePoint(declarationBodyPosition.Line, declarationBodyPosition.Column,
                        declarationBodyPosition.Line, declarationBodyPosition.Column + 1);
                }
                il.Emit(OpCodes.Nop);

                EmitArgsAwareCheck(routine);
            }

			// declares and initializes real locals (should be before args init):
			EmitArgfullLocalsInitialization(routine);

			// initializes locals (from arguments or by empty value):
			EmitArgfullArgsInitialization(routine);

            // remember late static bind type from <stack>
            EmitArgfullLateStaticBindTypeInitialization(routine);

            // custom body prolog emittion:
            PluginHandler.EmitBeforeBody(il, body);

			// define user labels:
			DefineLabels(routine.Builder.Labels);

			// emits function's body:
            body.Emit(this);

			// marks ending "}" as the last sequence point of the routine:
			// (do not mark it in lambda functions as they are created from source code without braces);
			if (!routine.IsLambda)
			{
				MarkSequencePoint(entirePosition.LastLine, entirePosition.LastColumn,
					entirePosition.LastLine, entirePosition.LastColumn + 1);
			}else if (context.Config.Compiler.Debug)
            {
                il.Emit(OpCodes.Nop);
            }

			EmitRoutineEpilogue(null, false);
		}