Esempio n. 1
0
 /// <summary>
 /// Returns  variables modified in statement that have passed number.
 /// statementType is additional filter parameter, if this parameter is passsed only var in statement of given type will be return
 /// </summary>
 public List <string> ModifiesVarModInStmt(int statementNumber, NodeType statementType = NodeType.Statement)
 {
     if (statementType == NodeType.Statement)
     {
         return(StatementModifiesTable.Where(x => x.StatementNumber == statementNumber).Select(x => x.Variables).FirstOrDefault());
     }
     else
     {
         return(StatementModifiesTable.Where(x => x.StatementNumber == statementNumber && x.StatementType == statementType).Select(x => x.Variables).FirstOrDefault());
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Returns all statement numbers that modifies passed variable
 ///  statementType is additional filter parameter, if this parameter is passsed only statement of given type will be return
 /// </summary>
 public List <int> ModifiesStmtThatModVar(string variable, NodeType statementType = NodeType.Statement)
 {
     if (statementType == NodeType.Statement)
     {
         return(StatementModifiesTable.Where(x => x.Variables.Any(y => y.Equals(variable, StringComparison.InvariantCultureIgnoreCase))).Select(x => x.StatementNumber).ToList());
     }
     else
     {
         return(StatementModifiesTable.Where(x => x.Variables.Any(y => y.Equals(variable, StringComparison.InvariantCultureIgnoreCase)) && x.StatementType == statementType).Select(x => x.StatementNumber).ToList());
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Check if stetement modifies variable
 /// </summary>
 public bool ModifiesStatement(int statementNumber, string variable)
 {
     if (String.IsNullOrEmpty(variable))
     {
         return(false);
     }
     if (StatementModifiesTable.Where(x => x.StatementNumber == statementNumber && x.Variables.Any(y => y.Equals(variable, StringComparison.InvariantCultureIgnoreCase))).Any())
     {
         return(true);
     }
     return(false);
 }