Esempio n. 1
0
 public ForStatement(BasicExpression v, BasicExpression start, BasicExpression end, BasicExpression step)
 {
     this.v     = v;
     this.start = start;
     this.end   = end;
     this.step  = step;
 }
Esempio n. 2
0
            public void IfThen(BasicExpression cond, BasicStatement[] ifTrue)
            {
                this.sb.Append("If(").Append(cond);

                foreach (BasicStatement stmt in ifTrue)
                {
                    this.sb.Append(", ");
                    this.sb.Append(stmt);
                }

                this.sb.Append(")");
            }
Esempio n. 3
0
 public static BasicOperator Ternary(string name, BasicType type, BasicExpression x, BasicExpression y, BasicExpression z)
 {
     return(new BasicOperator(name, type, new BasicExpression[] { x, y, z }));
 }
Esempio n. 4
0
 public static BasicOperator Unary(string name, BasicType type, BasicExpression x)
 {
     return(new BasicOperator(name, type, new BasicExpression[] { x }));
 }
Esempio n. 5
0
        public static void Bad(string input)
        {
            Action act = () => BasicExpression.FromString(input);

            act.Should().Throw <FormatException>("[{0}]", input).WithMessage("*'" + input + "'*").WithInnerException <Exception>();
        }
Esempio n. 6
0
 public static void Good(string input, string output)
 {
     BasicExpression.FromString(input).ToString().Should().Be(output, "[{0}]", input);
 }
Esempio n. 7
0
 public void Input(string prompt, BasicExpression v)
 {
     this.sb.Append("Input(\"").Append(prompt).Append("\", ").Append(v).Append(")");
 }
Esempio n. 8
0
 public void For(BasicExpression v, BasicExpression start, BasicExpression end, BasicExpression step)
 {
     this.Write("For", v, start, end, step);
 }
Esempio n. 9
0
 public void Assign(BasicExpression left, BasicExpression right)
 {
     this.Write("Assign", left, right);
 }
Esempio n. 10
0
 public IfThenStatement(BasicExpression cond, IEnumerable <BasicStatement> ifTrue)
 {
     this.cond   = cond;
     this.ifTrue = ifTrue.ToArray();
 }
Esempio n. 11
0
 public AssignmentStatement(BasicExpression left, BasicExpression right)
 {
     this.left  = left;
     this.right = right;
 }
Esempio n. 12
0
 public InputStatement(string prompt, BasicExpression v)
 {
     this.prompt = prompt;
     this.v      = v;
 }