コード例 #1
0
ファイル: While.cs プロジェクト: shurik111333/spbu
 public While(Condition condition, Statement first, End end)
 {
     Condition = condition;
     FirstStatement = first;
     Head = condition;
     Tail = end;
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: shurik111333/spbu
 public Program(Statement Statement)
 {
     if (Statement == null)
     {
         throw new ArgumentNullException("listOfStatements");
     }
     FirstStatement = Statement;
 }
コード例 #3
0
ファイル: Condition.cs プロジェクト: shurik111333/spbu
 public Condition(Expression left, CompareSign compare, Expression right)
 {
     Compare = compare;
     Left = left;
     Right = right;
     NextTrue = null;
     NextFalse = null;
 }
コード例 #4
0
ファイル: If.cs プロジェクト: shurik111333/spbu
 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;
 }
コード例 #5
0
ファイル: For.cs プロジェクト: shurik111333/spbu
 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;
 }
コード例 #6
0
ファイル: Interpreter.cs プロジェクト: shurik111333/spbu
        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;
        }
コード例 #7
0
ファイル: Interpreter.cs プロジェクト: shurik111333/spbu
 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;
 }
コード例 #8
0
ファイル: Label.cs プロジェクト: shurik111333/spbu
 public Label(string name, Statement statement)
 {
     Name = name;
     Statement = statement;
 }