예제 #1
0
            public void Analyze(NamedActualParam/*!*/node, Analyzer/*!*/ analyzer, DType/*!*/ propertiesDeclarer)
            {
                // TODO: Named parameters can target the non-static, public, and read-write fields 
                // or properties of the attribute class

                bool visibility_check;

                if (!propertiesDeclarer.IsUnknown)
                {
                    property = analyzer.ResolveProperty(propertiesDeclarer, node.Name, node.Span, false, null, null, out visibility_check);
                }

                node.expression = node.Expression.Analyze(analyzer, ExInfoFromParent.DefaultExInfo).Literalize();
            }
예제 #2
0
파일: Chains.cs 프로젝트: dw4dev/Phalanger
		/// <summary>
		/// Emits IL instructions that ensure that a static field is of <see cref="PhpObject"/> or <see cref="PhpArray"/>
		/// type. Handles the case when field name is known at compile time (see <see cref="AST.DirectStFldUse"/>).
		/// </summary>
		/// <param name="property">The corresponding <see cref="DProperty"/> or <B>null</B>.</param>
        /// <param name="typeRef">The class type reference (identifier index).</param>
		/// <param name="fieldName">The field name (identifier index).</param>
		/// <param name="ensureArray">Whether to ensure that static field is an array (or an object).</param>
		/// <remarks>
		/// Nothing is expected on the evaluation stack. A <see cref="PhpObject"/> or <see cref="DObject"/> is left
		/// on the evaluation stack or the last emitted instruction is unconditional branch to <see cref="Chain.ErrorLabel"/>.
		/// </remarks>
		public PhpTypeCode EmitEnsureStaticProperty(DProperty property, TypeRef typeRef,
			VariableName fieldName, bool ensureArray)
		{
			ILEmitter il = codeGenerator.IL;

			PhpField php_field = property as PhpField;
			if (php_field != null)
			{
				// HACK HACK
				EmitEnsureStaticPhpFieldDirect(php_field, ensureArray);

				EmitErrorCheck(ensureArray);
				return (ensureArray) ? PhpTypeCode.PhpArray : PhpTypeCode.DObject;
			}
            else return EmitEnsureStaticProperty(typeRef, fieldName, null, ensureArray);
		}
예제 #3
0
		internal override Evaluation Analyze(Analyzer/*!*/ analyzer, ExInfoFromParent info)
		{
			base.Analyze(analyzer, info);

			property = analyzer.ResolveProperty(type, propertyName, position, true, analyzer.CurrentType, analyzer.CurrentRoutine, out runtimeVisibilityCheck);

			return new Evaluation(this);
		}