Exemplo n.º 1
0
 public While(Condition condition, Statement first, End end)
 {
     Condition = condition;
     FirstStatement = first;
     Head = condition;
     Tail = end;
 }
Exemplo n.º 2
0
 public Program(Statement Statement)
 {
     if (Statement == null)
     {
         throw new ArgumentNullException("listOfStatements");
     }
     FirstStatement = Statement;
 }
Exemplo n.º 3
0
 public Condition(Expression left, CompareSign compare, Expression right)
 {
     Compare = compare;
     Left = left;
     Right = right;
     NextTrue = null;
     NextFalse = null;
 }
Exemplo n.º 4
0
 public If(Condition condition, Statement ifBlock, Statement elseBlock, End end, Node.Coords coords)
 {
     Condition = condition;
     IfBlock = ifBlock;
     ElseBlock = elseBlock;
     Head = condition;
     Tail = end;
     this.Coords = coords;
 }
Exemplo n.º 5
0
 public For(Assignment assn, Condition cond, Assignment chngAssn, Statement first, End end, Node.Coords coords)
 {
     Assignment = assn;
     Condition = cond;
     ChngAssignment = chngAssn;
     FirstStatement = first;
     Head = assn;
     Tail = end;
     this.Coords = coords;
 }
Exemplo n.º 6
0
        internal static string OneStep(Nodes.Statement currStatement)
        {
            string result = null;
            if (currStatement is Nodes.Print)
            {
                result = currStatement.Interpreter().StringValue;

            }
            else
                currStatement.Interpreter();
            currStatement = currStatement.Next;
            return result;
        }
Exemplo n.º 7
0
 public static string Debug(string program, ref List<string> errors, ref List<string> watches, ref int flag)
 {
     if (currStatement == null)
     {
         Nodes.Program firstStatement = Parser.Program(program);
         firstStatement.Interpreter();
         currStatement = firstStatement.FirstStatement;
     }
     string result = OneStep(currStatement);
     watches.Clear();
     GetWatches(ref watches);
     if (currStatement == null)
         flag = 1;
     return result;
 }
Exemplo n.º 8
0
 public Label(string name, Statement statement)
 {
     Name = name;
     Statement = statement;
 }