From: Jiao, D. <dj...@in...> - 2007-04-26 13:59:16
|
sushil ronghe wrote: > ok, > > I want some more information about recursively traversing the tree. > Means how the code will look like. Please look at the visitor classes. > > also tell me how can we print the AST tree. SmartsDumpVisitor (should rename to ASTDumpVisitor) > > > For cases without recursive smarts, this is easy. Anything between the > [] can be think as a SMARTSAtom. So bonds and atoms are broken apart > during parsing. > > > Yes, that is very nice. > > > With recursive smarts, things are much more complicated, because they > could also appear in []. For example, [$(CCC),N]=O. Now we not > only have > atom, but also an atomcontainer. I haven't cleared my thoughts > either. I > could imagine there being a SMARTSAtomContainer, working like the > SMARTSAtom (or your SMARTSOperatorAtom), that could contain both an > SMARTSAtom or a AtomContainer.But how that could affect the matching > algorithms, I have no idea > > > > Also you claim that this parser is best and should be adapted because > it will be > easy for resursive smarts and opertors but it is also looking like > having a trouble > for recursion. No I didn't claim it's the best :) I claimed that JJTree is good for the architecture and reusability. Which recursion are you referring, AST Tree or the LogicalOperator tree? There are problems mainly because the API is not ready, but parsing is nearly ready. > but we will do it together. Glad to work with you! > > What i think we should also have to implement the ( ) expression. > and left the recursion as a last stop. Which () expression are your referring to, group or recursive smarts? Both can be parsed in the JJTree code, but again, no API ready, which is the problem. > We will also have to implement the steriochemistry of bond. Yes! That I definately have a problem. I think the JJTree code is parsing them now, but I am not sure if 100% correctly. Also the JJTree is making assumptions on the [H], you can find the discussion in a previous email sent to this list. The OpenBabel smarts parser seems to have the same problem. Also JJTree is not parsing AtomicMass, it's also mentioned in a previous email. |