Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] questions about OffsetLimitReachedException

Hi Mike,
the exception is needed when the content-assist is invoked in the
context of the preprocessor, i.e. within:
char-literal, string-literal, number-literal, header-name,
preprocessor-directive, inactive branch of conditional compilation,
macro-expansion.

Currently there is no good interface to pass the information to
content-assist, so it creates a completion node in a way that:
(a) forbids content assist for the literals and header-names.
(b) provides the prefix for the rest of the cases.

There is room for improvement:
header-names: should trigger a specific content assist (bug 113568)
macro-expansion: the preprocessor could return the tokens of the current
  macro argument to the parser and hope that they make sense within the

  current context of the grammer. (bug 77348 and probably others)

Markus.

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Mike Kucera
Sent: Friday, December 07, 2007 11:34 PM
To: CDT General developers list.
Subject: [cdt-dev] questions about OffsetLimitReachedException
Importance: Low


Hi,

I'm trying to improve my integration with CPreprocessor and I have some
questions for you parser folks.

What causes an OffsetLimitReachedException and how should it be handled?
I'm guessing that this exception is thrown when content assist is
invoked in a difficult context. I'm not really understanding what the
DOM parser is doing to handle this exception. It appears to create a
completion node and then just quit parsing. No names are added to the
completion node so it looks like its not linked into the AST.

Whats really going on here? Can anyone give me a code example where
content assist triggers an OLRE and what the results are? There doesn't
appear to be any JUnits that directly test for OLRE being thrown at
certain points.

 I need to figure out how to handle this in a bottom-up parser as the
parser can't just exit at any point. I use EOC tokens to "unwind" the
parse after a completion token is encountered, would it be appropriate
to handle an OLRE using the same approach?


Mike Kucera
Software Developer
IBM CDT Team, Toronto
mkucera@xxxxxxxxxx

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top