public override string ToCode() { var sb = new StringBuilder("if("); if (IfCondition != null) { sb.Append(IfCondition.ToString()); } else if (IfVariable != null) { sb.Append(IfVariable.ToString(true, false, true)); } sb.AppendLine(")"); if (ScopedStatement != null) { sb.Append(ScopedStatement.ToCode()); } if (ElseStatement != null) { sb.AppendLine().Append("else ").Append(ElseStatement.ToCode()); } return(sb.ToString()); }
public static string GeneratePrototype(DVariable dv) { var sb = new StringBuilder("Variable in "); sb.Append(AbstractNode.GetNodePath(dv, false)); sb.Append(": "); sb.Append(dv.ToString(false)); return(sb.ToString()); }
public override ISymbolValue this[DVariable variable] { get { ISymbolValue v; if (Locals.TryGetValue(variable, out v)) { return(v); } throw new CtfeException("Variable " + variable.ToString() + " not set yet!"); } set { if (variable == null) { throw new CtfeException("Can't set non-existent variable"); } Locals[variable] = value; } }
public override string ToCode() { return("catch" + (CatchParameter != null ? ('(' + CatchParameter.ToString() + ')') : "") + (ScopedStatement != null ? (' ' + ScopedStatement.ToCode()) : "")); }
public override string ToCode() { return(Variable == null ?"null":Variable.ToString(false)); }
public override string ToCode() { return(Definition.ToString(false, true)); }
public override string ToCode() { return(BaseExpression == null ? (Variable == null ?"null":Variable.ToString(false)) : BaseExpression.ToString()); }