« Return to Thread: newbie question regarding lookahead (I think)

newbie question regarding lookahead (I think)

by Rajarshi Guha-3 :: Rate this Message:

Reply to Author | View in Thread

Hi, I'm trying to fix a JJTree parser but am I little confused as to  
the source of the problem.

First: the parser tries to parse SMARTS, which are query patterns for  
molecular substructure matching.

Given a string: Sc1ccccc1

the parser should recognize S and c as two separate atom (tokens). The  
problem is that Sc is also a valid token - but the specification says  
that it must be enclosed in [ and ] - which is not the case here.

As a result, the parser only sees the S and c as Sc and then reports  
the pattern as invalid.
So I'm trying to work out how to make the parser recognize the Sc as  
two separate tokens - S & c.

(I have probably not given enough information but I've tried to keep  
the description simple and generic. The entire parser code is  
available at http://cdk.git.sourceforge.net/git/gitweb.cgi?p=cdk;a=blob_plain;f=src/main/org/openscience/cdk/smiles/smarts/parser/SMARTSParser.jjt;hb=master)

Any pointers would be approciated

-------------------------------------------------------------------
Rajarshi Guha  <rguha@...>
GPG Fingerprint: D070 5427 CC5B 7938 929C  DD13 66A1 922C 51E7 9E84
-------------------------------------------------------------------
Q:  What's polite and works for the phone company?
A:  A deferential operator.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

 « Return to Thread: newbie question regarding lookahead (I think)