public override void Evaluate() { var targetTerm = new Term(RegexMatch.Groups[1].Value); var e = new Expression.Expression(RegexMatch.Groups[2].Value, ParentContext); if (targetTerm.Type == Term.TermTypes.STRUCTURE) { var baseObj = new Expression.Expression(targetTerm.SubTerms[0], ParentContext).GetValue(); var obj = baseObj as ISuffixed; if (obj != null) { if (obj.SetSuffix(targetTerm.SubTerms[1].Text.ToUpper(), e.GetValue())) { State = ExecutionState.DONE; return; } throw new KOSException( "Suffix '" + targetTerm.SubTerms[1].Text + "' doesn't exist or is read only", this); } throw new KOSException( "Can't set subvalues on a " + Expression.Expression.GetFriendlyNameOfItem(baseObj), this); } var v = FindOrCreateVariable(targetTerm.Text); if (v == null) return; v.Value = e.GetValue(); State = ExecutionState.DONE; }
public override void Evaluate() { var targetTerm = new Term(RegexMatch.Groups[1].Value); var e = new Expression.Expression(RegexMatch.Groups[2].Value, ParentContext); if (targetTerm.Type == Term.TermTypes.STRUCTURE) { var baseObj = new Expression.Expression(targetTerm.SubTerms[0], ParentContext).GetValue(); var obj = baseObj as ISuffixed; if (obj != null) { if (obj.SetSuffix(targetTerm.SubTerms[1].Text.ToUpper(), e.GetValue())) { State = ExecutionState.DONE; return; } throw new KOSException( "Suffix '" + targetTerm.SubTerms[1].Text + "' doesn't exist or is read only", this); } throw new KOSException( "Can't set subvalues on a " + Expression.Expression.GetFriendlyNameOfItem(baseObj), this); } var v = FindOrCreateVariable(targetTerm.Text); if (v == null) { return; } v.Value = e.GetValue(); State = ExecutionState.DONE; }
public override void Evaluate() { var e = new Expression.Expression(RegexMatch.Groups[1].Value, ParentContext); StdOut(e.GetValue().ToString()); State = ExecutionState.DONE; }
public override void Evaluate() { var e = new Expression.Expression(RegexMatch.Groups[1].Value, ParentContext); StdOut(e.GetValue().ToString()); State = ExecutionState.DONE; }
public override void Evaluate() { // External functions are now handled within expressions, // so simply execute the expression and throw away the value var subEx = new Expression.Expression(RegexMatch.Groups[1].Value, this); subEx.GetValue(); State = ExecutionState.DONE; }
public override void Evaluate() { // External functions are now handled within expressions, // so simply execute the expression and throw away the value var subEx = new Expression.Expression(RegexMatch.Groups[1].Value, this); subEx.GetValue(); State = ExecutionState.DONE; }
public override void Evaluate() { var ex = new Expression.Expression(RegexMatch.Groups[1].Value, this); var obj = ex.GetValue(); var node = obj as Node; if (node != null) { node.Remove(); } else { throw new KOSException("Supplied object ineligible for removal", this); } State = ExecutionState.DONE; }
public override void Evaluate() { var ex = new Expression.Expression(RegexMatch.Groups[1].Value, this); var obj = ex.GetValue(); var node = obj as Node; if (node != null) { node.Remove(); } else { throw new KOSException("Supplied object ineligible for removal", this); } State = ExecutionState.DONE; }