public object Visit(ASTReaction node, object data) { System.Console.Out.WriteLine(IndentString() + node); ++indent; data = node.ChildrenAccept(this, data); --indent; return(data); }
public object Visit(ASTReaction node, object data) { IAtomContainer query = new QueryAtomContainer(builder); for (int grpIdx = 0; grpIdx < node.JjtGetNumChildren(); grpIdx++) { int rollback = query.Atoms.Count; ASTGroup group = (ASTGroup)node.JjtGetChild(grpIdx); group.JjtAccept(this, query); // fill in the roles for newly create atoms if (group.Role != ReactionRoles.Any) { IQueryAtom roleQueryAtom = null; ReactionRole?role = null; // use single instances switch (group.Role) { case ReactionRoles.Reactant: roleQueryAtom = ReactionRoleQueryAtom.RoleReactant; role = ReactionRole.Reactant; break; case ReactionRoles.Agent: roleQueryAtom = ReactionRoleQueryAtom.RoleAgent; role = ReactionRole.Agent; break; case ReactionRoles.Product: roleQueryAtom = ReactionRoleQueryAtom.RoleProduct; role = ReactionRole.Product; break; } if (roleQueryAtom != null) { while (rollback < query.Atoms.Count) { IAtom org = query.Atoms[rollback]; IAtom rep = LogicalOperatorAtom.And(roleQueryAtom, (IQueryAtom)org); // ensure AAM is propagated rep.SetProperty(CDKPropertyName.AtomAtomMapping, org.GetProperty <int?>(CDKPropertyName.AtomAtomMapping)); rep.SetProperty(CDKPropertyName.ReactionRole, role); AtomContainerManipulator.ReplaceAtomByAtom(query, org, rep); rollback++; } } } } return(query); }
public object Visit(ASTReaction node, object data) { return(node.JjtGetChild(0).JjtAccept(this, data)); }