public List <IStatementList> GetPathsFrom(Statement statement) { List <IStatementList> paths = new List <IStatementList>(); IStatementList newPath = ImplementationFactory.CreateStatementList(); BuildPath(paths, newPath, statement); return(paths); }
public Assign(Variable left, Token operation, Factor right, int programLine) : base(programLine) { Left = left; Operation = operation; Right = right; AffectedBy = ImplementationFactory.CreateStatementList(); Affecting = ImplementationFactory.CreateStatementList(); }
public Variable(string name) { Name = name; Attribute = new Attribute("varName", Name); ModifiedByProcedures = ImplementationFactory.CreateProcedureList(); ModifiedByStatements = ImplementationFactory.CreateStatementList(); UsedByProcedures = ImplementationFactory.CreateProcedureList(); UsedByStatements = ImplementationFactory.CreateStatementList(); }
public Variable(Token token) { Name = token.Value.ToString(); Attribute = new Attribute("varName", Name); ModifiedByProcedures = ImplementationFactory.CreateProcedureList(); ModifiedByStatements = ImplementationFactory.CreateStatementList(); UsedByProcedures = ImplementationFactory.CreateProcedureList(); UsedByStatements = ImplementationFactory.CreateStatementList(); }
protected override IEntityList ProcessRightSide(IProgramKnowledgeBase pkb, IEntity arg) { Statement statement = arg as Statement; Statement parent = pkb.ParentTable.GetParent(statement); IStatementList result = ImplementationFactory.CreateStatementList(); result.AddStatement(parent); return(result); }
protected override IEntityList ProcessRightSide(IProgramKnowledgeBase pkb, IEntity arg) { Statement statement = arg as Statement; Statement followed = pkb.FollowsTable.GetFollowedBy(statement); IStatementList result = ImplementationFactory.CreateStatementList(); result.AddStatement(followed); return(result); }
public Statement(int programLine) { ProgramLine = programLine; Attribute = new Attribute("progLine", ProgramLine.ToString()); Modifying = ImplementationFactory.CreateVariableList(); Using = ImplementationFactory.CreateVariableList(); NextedBy = ImplementationFactory.CreateStatementList(); Nexting = ImplementationFactory.CreateStatementList(); Children = ImplementationFactory.CreateStatementList(); }
public Procedure(string name) { Name = name; Body = ImplementationFactory.CreateStatementList(); Attribute = new Attribute("procName", Name); Modifying = ImplementationFactory.CreateVariableList(); Using = ImplementationFactory.CreateVariableList(); CalledBy = ImplementationFactory.CreateProcedureList(); Calling = ImplementationFactory.CreateProcedureList(); }
public IStatementList GetUsesStatements(Variable variable) { if (variable != null) { return(variable.UsedByStatements); } else { return(ImplementationFactory.CreateStatementList()); } }
public IStatementList GetParentedBy(Statement statement) { if (statement != null) { return(statement.Children.Copy()); } else { return(ImplementationFactory.CreateStatementList()); } }
public IStatementList GetAffects(Assign assignment) { if (assignment != null) { return(assignment.AffectedBy.Copy()); } else { return(ImplementationFactory.CreateStatementList()); } }
public IStatementList GetNextedBy(Statement statement) { if (statement != null) { return(statement.Nexting.Copy()); } else { return(ImplementationFactory.CreateStatementList()); } }
public IStatementList GetParentT(Statement statement) { IStatementList parents = ImplementationFactory.CreateStatementList(); Statement parentStatement = GetParent(statement); parents.AddStatement(parentStatement); for (int i = 0; i < parents.GetSize(); i++) { parents.AddEntity(GetParent(parents[i])); } return(parents); }
public IStatementList GetFollowsT(Statement statement) { IStatementList following = ImplementationFactory.CreateStatementList(); Statement followingStatement = GetFollows(statement); following.AddStatement(followingStatement); for (int i = 0; i < following.GetSize(); i++) { following.AddStatement(GetFollows(following[i])); } return(following); }
public IStatementList GetFollowedByT(Statement statement) { IStatementList followed = ImplementationFactory.CreateStatementList(); Statement followedStatement = GetFollowedBy(statement); followed.AddStatement(followedStatement); for (int i = 0; i < followed.GetSize(); i++) { followed.AddStatement(GetFollowedBy(followed[i])); } return(followed); }
private IStatementList Statements() { Statement statement = SingleStatement(); IStatementList statements = ImplementationFactory.CreateStatementList(); statements.AddStatement(statement); while (currentToken.Type != TokenType.RBRACE) { statements.AddStatement(SingleStatement()); } return(statements); }
public DesignExtractor() { Statements = ImplementationFactory.CreateStatementList(); Variables = ImplementationFactory.CreateVariableList(); Procedures = ImplementationFactory.CreateProcedureList(); Constants = ImplementationFactory.CreateConstantList(); FollowsTable = ImplementationFactory.CreateFollowsTable(); ModifiesTable = ImplementationFactory.CreateModifiesTable(); ParentTable = ImplementationFactory.CreateParentTable(); UsesTable = ImplementationFactory.CreateUsesTable(); CallsTable = ImplementationFactory.CreateCallsTable(); NextTable = ImplementationFactory.CreateNextTable(); AffectsTable = ImplementationFactory.CreateAffectsTable(); calls = new Dictionary <Procedure, List <Call> >(); }
private IStatementList StmtLst() { Eat(TokenType.LBRACE); IStatementList statements = Statements(); Eat(TokenType.RBRACE); IStatementList root = ImplementationFactory.CreateStatementList(); foreach (Statement statement in statements) { root.AddStatement(statement); } return(root); }
public While(int programLine) : base(programLine) { Body = ImplementationFactory.CreateStatementList(); }
public override IEntityList CreateNewList() { return(ImplementationFactory.CreateStatementList()); }