>>>>> "Paul" == Paul Kinnucan <[EMAIL PROTECTED]> writes:

  Paul> Using RE's to parse a syntax as complex as Java's is
  Paul> tricky business and generally entails a lot of painstaking
  Paul> cut-and-try work.  Everytime you think you've accounted for
  Paul> every syntactic quirk of the language, you find another
  Paul> counter example. If anyone wants to take a shot at improving
  Paul> the JDE's stab at RE's, please feel free. We'd all be
  Paul> grateful. Meanwhile, I have been considering using the JDE's
  Paul> new Java parser to construct the speedbar display
  Paul> structure. The advantage is that the parser would enable a
  Paul> fast and fully accurate parsing of the buffer into classes,
  Paul> including inner and anonymous, methods and fields. This
  Paul> approach poses some problems.

        I think that using the parser would be the best approach in 
the long term. 

  Paul> A drawback is that it would require starting up the BeanShell
  Paul> the first time you open a Java buffer.

        For me this would be no disadvantage. I use desktop saving, 
and if I have lot of java sources previously open it can take 5 minutes
for my emacs to become usable anyway. It if for this sort of occasion
that God gave tea to the British, and coffee to the rest of the
world. Also the beanshell is going to be used for an increasing number
of things. I find that I use some facility of the JDE which requires
the beanshell pretty frequently now, and thats only going to get more
so.


  Paul> Also, what to do if a source file has parse errors from which
  Paul> the parser cannot recover? I'd be greatful to get other's
  Paul> views on this approach.

        This isnt really a problem. If the parser croaks then you
still have the RE's to fall back on (which will happen a lot when
classes are half written). This could even have an impact on the last
point. You could make an option "use RE's if bsh not open", which
would only parse if the beanshell were already open, and RE's if it
werent..


        Phil

Reply via email to