Пример #1
0
 public If(Expression e, Statement t, Statement f, int l, int c)
     : base(l, c)
 {
     Expression = e;
     Body = t;
     Else = f;
 }
Пример #2
0
 public If(Expression e, Statement s, int l, int c)
     : base(l, c)
 {
     Expression = e;
     Body = s;
     Else = Statement.Nop;
 }
Пример #3
0
 public For(Statement init, Expression test, Statement iterator, Statement body, int l, int c)
     : base(l, c)
 {
     Initializer = init;
     Iterator = iterator;
     Body = body;
     Test = test;
 }
Пример #4
0
 public Sequence(Statement s1, Statement s2, int line, int col)
     : base(line, col)
 {
     First = s1;
     Second = s2;
 }
Пример #5
0
 public With(Expression e, Statement s, int l, int c)
     : base(l, c)
 {
     Instance = e; Body = s;
 }
Пример #6
0
 public While(Expression e, Statement s, int line, int col) 
     : base(line,col)
 {
     Expression = e;
     Body = s;
 }
Пример #7
0
 public Do(Statement s, Expression e, int l, int c)
     : base(l, c)
 {
     Expression = e;
     Body = s;
 }
Пример #8
0
 public void VisitStatement(Statement s)
 {
     switch (s.Kind)
     {
         case StatementKind.AdditionAssignment:
         case StatementKind.AndAssignment:
         case StatementKind.Assignment:
         case StatementKind.DivideAssignment:
         case StatementKind.MultiplyAssignment:
         case StatementKind.OrAssignment:
         case StatementKind.SubtractionAssignment:
         case StatementKind.XorAssignment:
             VisitAssignment(s as Assignment);
             break;
         case StatementKind.Break:
             VisitBreak(s as Break);
             break;
         case StatementKind.Call:
             VisitCallStatement(s as CallStatement);
             break;
         case StatementKind.Case:
             VisitCaseLabel(s as Case);
             break;
         case StatementKind.Continue:
             VisitContinue(s as Continue);
             break;
         case StatementKind.Default:
             VisitDefaultCaseLabel(s as Default);
             break;
         case StatementKind.Do:
             VisitDo(s as Do);
             break;
         case StatementKind.Exit:
             VisitExit(s as Exit);
             break;
         case StatementKind.For:
             VisitFor(s as For);
             break;
         case StatementKind.Globalvar:
             VisitGlobalvar(s as Globalvar);
             break;
         case StatementKind.If:
             VisitIf(s as If);
             break;
         case StatementKind.Nop:
             VisitNop(s as Nop);
             break;
         case StatementKind.Repeat:
             VisitRepeat(s as Repeat);
             break;
         case StatementKind.Return:
             VisitReturn(s as Return);
             break;
         case StatementKind.Sequence:
             VisitSequence(s as Sequence);
             break;
         case StatementKind.Switch:
             VisitSwitch(s as Switch);
             break;
         case StatementKind.Var:
             VisitVar(s as Var);
             break;
         case StatementKind.While:
             VisitWhile(s as While);
             break;
         case StatementKind.With:
             VisitWith(s as With);
             break;
     }
 }
Пример #9
0
 public Repeat(Expression e, Statement s, int l, int c)
     : base(l, c)
 {
     Expression = e;
     Body = s;
 }
Пример #10
0
        public void VisitStatement(Statement s)
        {
            switch (s.Kind)
            {
            case StatementKind.AdditionAssignment:
            case StatementKind.AndAssignment:
            case StatementKind.Assignment:
            case StatementKind.DivideAssignment:
            case StatementKind.MultiplyAssignment:
            case StatementKind.OrAssignment:
            case StatementKind.SubtractionAssignment:
            case StatementKind.XorAssignment:
                VisitAssignment(s as Assignment);
                break;

            case StatementKind.Break:
                VisitBreak(s as Break);
                break;

            case StatementKind.Call:
                VisitCallStatement(s as CallStatement);
                break;

            case StatementKind.Case:
                VisitCaseLabel(s as Case);
                break;

            case StatementKind.Continue:
                VisitContinue(s as Continue);
                break;

            case StatementKind.Default:
                VisitDefaultCaseLabel(s as Default);
                break;

            case StatementKind.Do:
                VisitDo(s as Do);
                break;

            case StatementKind.Exit:
                VisitExit(s as Exit);
                break;

            case StatementKind.For:
                VisitFor(s as For);
                break;

            case StatementKind.Globalvar:
                VisitGlobalvar(s as Globalvar);
                break;

            case StatementKind.If:
                VisitIf(s as If);
                break;

            case StatementKind.Nop:
                VisitNop(s as Nop);
                break;

            case StatementKind.Repeat:
                VisitRepeat(s as Repeat);
                break;

            case StatementKind.Return:
                VisitReturn(s as Return);
                break;

            case StatementKind.Sequence:
                VisitSequence(s as Sequence);
                break;

            case StatementKind.Switch:
                VisitSwitch(s as Switch);
                break;

            case StatementKind.Var:
                VisitVar(s as Var);
                break;

            case StatementKind.While:
                VisitWhile(s as While);
                break;

            case StatementKind.With:
                VisitWith(s as With);
                break;
            }
        }