Esempio n. 1
0
 void Analyze(Jint.Expressions.Statement Stmt)
 {
     SetCurrentLineAndCharNos(Stmt);
     Type T = Stmt.GetType();
     switch (T.Name)
     {
         case("ArrayDeclaration"):
             ArrayDeclaration AD = (ArrayDeclaration)Stmt;
             Analyze(AD);
             break;
         case ("AssignmentExpression"):
             AssignmentExpression AE = (AssignmentExpression)Stmt;
             Analyze(AE);
             break;
         case ("BinaryExpression"):
             BinaryExpression BE = (BinaryExpression)Stmt;
             Analyze(BE);
             break;
         case ("BlockStatement"):
             BlockStatement BS = (BlockStatement)Stmt;
             Analyze(BS);
             break;
         case ("BreakStatement"):
             BreakStatement BrS = (BreakStatement)Stmt;
             Analyze(BrS);
             break;
         case ("CaseClause"):
             CaseClause CC = new CaseClause();
             try
             {
                 CC.Expression = (Expression)Stmt;
                 Analyze(CC);
             }
             catch { }
             break;
         case ("CatchClause"):
             try
             {
                 CatchClause CaC = new CatchClause("a", Stmt);
                 Analyze(CaC);
             }
             catch { }
             break;
         case ("ClrIdentifier"):
             ClrIdentifier CI = (ClrIdentifier)Stmt;
             Analyze(CI);
             break;
         case ("CommaOperatorStatement"):
             CommaOperatorStatement COS = (CommaOperatorStatement)Stmt;
             Analyze(COS);
             break;
         case ("ContinueStatement"):
             ContinueStatement CS = (ContinueStatement)Stmt;
             Analyze(CS);
             break;
         case ("DoWhileStatement"):
             DoWhileStatement DWS = (DoWhileStatement)Stmt;
             Analyze(DWS);
             break;
         case ("EmptyStatement"):
             EmptyStatement ES = (EmptyStatement)Stmt;
             Analyze(ES);
             break;
         case ("ExpressionStatement"):
             ExpressionStatement ExS = (ExpressionStatement)Stmt;
             Analyze(ExS);
             break;
         case ("FinallyClause"):
             try
             {
                 FinallyClause FC = new FinallyClause(Stmt);
                 Analyze(FC);
             }
             catch { }
             break;
         case ("ForEachInStatement"):
             ForEachInStatement FEIS = (ForEachInStatement)Stmt;
             Analyze(FEIS);
             break;
         case ("ForStatement"):
             ForStatement FoS = (ForStatement)Stmt;
             Analyze(FoS);
             break;
         case ("FunctionDeclarationStatement"):
             FunctionDeclarationStatement FDS = (FunctionDeclarationStatement)Stmt;
             Analyze(FDS);
             break;
         case ("FunctionExpression"):
             FunctionExpression FE = (FunctionExpression)Stmt;
             Analyze(FE);
             break;
         case ("Identifier"):
             Identifier Id = (Identifier)Stmt;
             Analyze(Id);
             break;
         case ("IfStatement"):
             IfStatement IS = (IfStatement)Stmt;
             Analyze(IS);
             break;
         case ("Indexer"):
             Indexer Ind = (Indexer)Stmt;
             Analyze(Ind);
             break;
         case ("JsonExpression"):
             JsonExpression JE = (JsonExpression)Stmt;
             Analyze(JE);
             break;
         case ("MemberExpression"):
             MemberExpression ME = (MemberExpression)Stmt;
             Analyze(ME);
             break;
         case ("MethodCall"):
             MethodCall MC = (MethodCall)Stmt;
             Analyze(MC);
             break;
         case ("NewExpression"):
             NewExpression NE = (NewExpression)Stmt;
             Analyze(NE);
             break;
         case ("Program"):
             Jint.Expressions.Program Pr = (Jint.Expressions.Program)Stmt;
             Analyze(Pr);
             break;
         case ("PropertyDeclarationExpression"):
             PropertyDeclarationExpression PDP = (PropertyDeclarationExpression)Stmt;
             Analyze(PDP);
             break;
         case ("PropertyExpression"):
             PropertyExpression PE = (PropertyExpression)Stmt;
             Analyze(PE);
             break;
         case ("RegexpExpression"):
             RegexpExpression RE = (RegexpExpression)Stmt;
             Analyze(RE);
             break;
         case ("ReturnStatement"):
             ReturnStatement RS = (ReturnStatement)Stmt;
             Analyze(RS);
             break;
         case ("SwitchStatement"):
             SwitchStatement SS = (SwitchStatement)Stmt;
             Analyze(SS);
             break;
         case ("TernaryExpression"):
             TernaryExpression TE = (TernaryExpression)Stmt;
             Analyze(TE);
             break;
         case ("ThrowStatement"):
             ThrowStatement TS = (ThrowStatement)Stmt;
             Analyze(TS);
             break;
         case ("TryStatement"):
             TryStatement TrS = (TryStatement)Stmt;
             Analyze(TrS);
             break;
         case ("UnaryExpression"):
             UnaryExpression UE = (UnaryExpression)Stmt;
             Analyze(UE);
             break;
         case ("ValueExpression"):
             ValueExpression VE = (ValueExpression)Stmt;
             Analyze(VE);
             break;
         case ("VariableDeclarationStatement"):
             VariableDeclarationStatement VDS = (VariableDeclarationStatement)Stmt;
             Analyze(VDS);
             break;
         case ("WhileStatement"):
             WhileStatement WS = (WhileStatement)Stmt;
             Analyze(WS);
             break;
         case ("WithStatement"):
             WithStatement WiS = (WithStatement)Stmt;
             Analyze(WiS);
             break;
     }
 }
Esempio n. 2
0
 void Analyze(CatchClause Stmt)
 {
     //if (Stmt.Identifier != null) Analyze(Stmt.Identifier);
     if (Stmt.Statement != null) Analyze(Stmt.Statement);
 }