/// <inheritdoc /> protected override void flowThrough() { ValuePoint firstPart, secondPart; switch (Assign.PublicOperation) { case Operations.AssignPrepend: firstPart = ROperand; secondPart = LOperand; break; case Operations.AssignAppend: firstPart = LOperand; secondPart = ROperand; break; default: throw new NotSupportedException("Given concat assign is not supported"); } var concatedValue = Services.Evaluator.Concat(new MemoryEntry[] { firstPart.Value.ReadMemory(OutSnapshot), secondPart.Value.ReadMemory(OutSnapshot) }); Value = OutSet.CreateSnapshotEntry(concatedValue); Services.Evaluator.Assign(AssignTarget.LValue, concatedValue); }
/// <inheritdoc /> protected override void flowThrough() { var value = Services.Evaluator.UnaryEx( Expression.PublicOperation, Operand.Value.ReadMemory(OutSnapshot)); Value = OutSet.CreateSnapshotEntry(value); }
/// <inheritdoc /> protected override void flowThrough() { var partValues = from part in Parts select part.Value.ReadMemory(OutSnapshot); var concatedValue = Services.Evaluator.Concat(partValues); Value = OutSet.CreateSnapshotEntry(concatedValue); }
/// <inheritdoc /> protected override void flowThrough() { var binaryOperation = toBinaryOperation(Assign.PublicOperation); var value = Services.Evaluator.BinaryEx(LOperand.Value.ReadMemory(OutSnapshot), binaryOperation, ROperand.Value.ReadMemory(OutSnapshot)); Value = OutSet.CreateSnapshotEntry(value); Services.Evaluator.Assign(LOperand.LValue, value); }
/// <inheritdoc /> protected override void flowThrough() { var entries = new ReadSnapshotEntryBase[_variables.Length]; for (var i = 0; i < _variables.Length; ++i) { entries[i] = _variables[i].LValue; } var values = Services.Evaluator.IssetEx(entries); var value = new MemoryEntry(values); Value = OutSet.CreateSnapshotEntry(value); }
/// <inheritdoc /> protected override void flowThrough() { MemoryEntry value; if (ThisObj == null) { value = Services.Evaluator.ClassConstant(_partial.ClassName.QualifiedName, _partial.Name); } else { value = Services.Evaluator.ClassConstant(ThisObj.Value.ReadMemory(OutSnapshot), _partial.Name); } Value = OutSet.CreateSnapshotEntry(value); }
/// <inheritdoc /> protected override void flowThrough() { MemoryEntry result; if (ResultExpression == null) { result = new MemoryEntry(OutSet.UndefinedValue); } else { result = ResultExpression.Value.ReadMemory(OutSnapshot); } var value = Services.Evaluator.Exit(Exit, result); Value = OutSet.CreateSnapshotEntry(value); }
/// <inheritdoc /> protected override void flowThrough() { var initializer = new List <KeyValuePair <MemoryEntry, MemoryEntry> >(_initializedValues.Count); foreach (var pair in _initializedValues) { //resolve initializing values to memory entries var index = pair.Key == null ? null : pair.Key.Value.ReadMemory(OutSnapshot); var value = pair.Value.Value.ReadMemory(OutSnapshot); initializer.Add(new KeyValuePair <MemoryEntry, MemoryEntry>(index, value)); } var arrayValue = Services.Evaluator.ArrayEx(initializer); Value = OutSet.CreateSnapshotEntry(arrayValue); }
/// <inheritdoc /> protected override void flowThrough() { var expression = Expression.Value.ReadMemory(OutSnapshot); MemoryEntry value; if (Name == null) { value = Services.Evaluator.InstanceOfEx(expression, InstanceOfEx.ClassNameRef.GenericQualifiedName.QualifiedName); } else { value = Services.Evaluator.IndirectInstanceOfEx(expression, Name.Value.ReadMemory(OutSnapshot)); } Value = OutSet.CreateSnapshotEntry(value); }
/// <inheritdoc /> protected override void flowThrough() { var beforeIncrementValue = IncrementedValue.Value.ReadMemory(OutSnapshot); var afterIncrementValue = Services.Evaluator.IncDecEx(IncDecEx, beforeIncrementValue); IncrementTarget.LValue.WriteMemoryWithoutCopy(OutSnapshot, afterIncrementValue); if (IncDecEx.Post) { //return value before incrementation Value = OutSet.CreateSnapshotEntry(beforeIncrementValue); } else { //return value after incrementation Value = OutSet.CreateSnapshotEntry(afterIncrementValue); } }
public override void Foreach(MemoryEntry enumeree, ReadWriteSnapshotEntryBase keyVariable, ReadWriteSnapshotEntryBase valueVariable) { var values = new HashSet <Value>(); var array = enumeree.PossibleValues.First() as AssociativeArray; var arrayEntry = OutSet.CreateSnapshotEntry(new MemoryEntry(array)); var indexes = arrayEntry.IterateIndexes(OutSnapshot); foreach (var index in indexes) { var indexEntry = arrayEntry.ReadIndex(OutSnapshot, index); var element = indexEntry.ReadMemory(OutSnapshot); values.UnionWith(element.PossibleValues); } valueVariable.WriteMemory(OutSnapshot, new MemoryEntry(values)); }
/// <inheritdoc /> protected override void flowThrough() { switch (_partial.Type) { case PseudoConstUse.Types.Line: Value = OutSet.CreateSnapshotEntry(new MemoryEntry(OutSet.CreateInt(_partial.Position.FirstLine))); return; case PseudoConstUse.Types.File: Value = OutSet.CreateSnapshotEntry(new MemoryEntry(OutSet.CreateString(OwningScriptFullName))); return; case PseudoConstUse.Types.Dir: Value = OutSet.CreateSnapshotEntry(new MemoryEntry(OutSet.CreateString(OwningScript.Directory.FullName))); return; case PseudoConstUse.Types.Function: if (OwningPPGraph.FunctionName == null) { Value = OutSet.CreateSnapshotEntry(new MemoryEntry(OutSet.UndefinedValue)); } else { Value = OutSet.CreateSnapshotEntry(new MemoryEntry(OutSet.CreateString(OwningPPGraph.FunctionName))); } return; case PseudoConstUse.Types.Method: case PseudoConstUse.Types.Class: case PseudoConstUse.Types.Namespace: Value = OutSet.CreateSnapshotEntry(new MemoryEntry(OutSet.AnyStringValue)); return; default: Value = OutSet.CreateSnapshotEntry(new MemoryEntry(OutSet.AnyValue)); return; } }
/// <inheritdoc /> protected override void flowThrough() { PrepareArguments(); MemoryEntry value; //Create object according to class name if (Name == null) { value = Services.Evaluator.CreateObject( NewEx.ClassNameRef.GenericQualifiedName.QualifiedName); } else { value = Services.Evaluator.IndirectCreateObject(Name.Value.ReadMemory(OutSnapshot)); } //initialize created object var objectEntry = OutSet.CreateSnapshotEntry(value); var initializedObject = Services.FunctionResolver.InitializeObject(objectEntry, Flow.Arguments); Value = OutSet.CreateSnapshotEntry(initializedObject); }
/// <inheritdoc /> protected override void flowThrough() { MemoryEntry value; switch (Jump.Type) { case JumpStmt.Types.Return: if (Expression == null) { //php code: return ; value = new MemoryEntry(OutSet.UndefinedValue); } else { value = Services.FunctionResolver.Return(Expression.Value.ReadMemory(OutSnapshot)); } break; default: throw new NotSupportedException(Jump.Type + " is not supported jump type"); } Value = OutSet.CreateSnapshotEntry(value); }
/// <summary> /// Set content of Value /// </summary> /// <param name="valueContent">Content of value</param> public void SetValueContent(MemoryEntry valueContent) { Value = OutSet.CreateSnapshotEntry(valueContent); }
/// <inheritdoc /> protected override void flowThrough() { var value = _constantProvider(Services.Evaluator); Value = OutSet.CreateSnapshotEntry(value); }
/// <summary> /// Resolves return value of current sink. Resolved value is stored within Value. /// </summary> public void ResolveReturnValue() { var returnValue = Services.FunctionResolver.ResolveReturnValue(OwningExtension.Branches); Value = OutSet.CreateSnapshotEntry(returnValue); }
/// <inheritdoc /> protected override void flowThrough() { var value = Services.Evaluator.EmptyEx(Variable.LValue); Value = OutSet.CreateSnapshotEntry(value); }