hi jiao,
 
I also made modifications to the JavaCC code. Right now, the parser could parse most of Smarts syntax, except for the implicit logical syntax.
 
That is very nice.
So far my code is also able to parse all kind of smart expression.
But searching is not possible for all.
For every new parsed token one has to make new class and then do the matching.
 
However, there seems to be not enough query API in CDK that could encapsulate all of the queries logics. I am wondering if I could modify the SMARTSAtom class.
 
yes correct but,modifying the SMARTSAtom class to add boolean relationship will really work.
today itself i am going to write the code for all operators.Before that i will have to discuss this
on devel-list.Let's see what solution comes out.
 
I uses a different approach than the original SMARTSParser. I uses the JJTree in JavaCC. So basically I am building an AST (Abstract Syntax Tree) when parsing a Smarts String. Then I uses a visitor class to traverse the nodes in the AST tree
 
yes this is the way JJTree works.
and structures can significantly be converted to tree with idea of each atom a node .
Your concept is valuable and i think there is no restriction to  experiment
 
 wonder if I could create a different package
 
I think you will need a different package. If you have a green signal from the administrator
you can start working.
 
regards.
 

 


 
On 4/12/07, Jiao, Dazhi <djiao@indiana.edu> wrote:
Hi, This is David Jiao from Indiana University. I also made modifications to the JavaCC code. Right now, the parser could parse most of Smarts syntax, except for the implicit logical syntax. However, there seems to be not enough query API in CDK that could encapsulate all of the queries logics. I am wondering if I could modify the SMARTSAtom class. Basically I want to make the class a place where boolean relationships can be added and used in matching. Not sure if this class was created for this purpose.

I also wonder how I should commit my JavaCC code to CDK. I uses a different approach than the original SMARTSParser. I uses the JJTree in JavaCC. So basically I am building an AST (Abstract Syntax Tree) when parsing a Smarts String. Then I uses a visitor class to traverse the nodes in the AST tree and build a QueryAtomContainer class. Different visitor classes can be built to use the AST tree. For example, I also wrote a dumpvisitor class to dump the AST to the console so I can check whether the parser works as expected. In order to not overwrite the original parser code, I wonder if I could create a different package, org.openscience.cdk.smiles.smarts.parser, for example, to put my code in, just for now. Later we can merge the codes into one parser.

Thank you!

David


-----Original Message-----
From: cdk-devel-bounces@lists.sourceforge.net on behalf of Guha, Rajarshi
Sent: Wed 4/11/2007 9:08 PM
To: sushil ronghe
Cc: cdk-devel@lists.sourceforge.net
Subject: Re: [Cdk-devel] TotalRingConnectionAtom x<n>

On Thu, 2007-04-12 at 05:25 +0530, sushil ronghe wrote:
>         But should we move these constants to something local to the
>         SMARTS
>         package?
>
> ok as you wish.

> One more move i will like to suggest is SMARTSQuaryTool from org
> \openscience\cdk\smiles\smarts to org\openscience\cdk\isomorphism
> because most of matching code is there. and if we keep the
> cdk.smiles.smarts only for file
> created with javacc it will be better i think.

Well the query tool is really only a user of the isomorphism code. I
think it's OK where it is

>
-------------------------------------------------------------------
Rajarshi Guha <rguha@indiana.edu>
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
-------------------------------------------------------------------
"I'd love to go out with you, but my favorite commercial is on TV."



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Cdk-devel mailing list
Cdk-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-devel




--
********************************
sushil ronghe
Center of Pharmacoinformatics
India
*********************************