Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Why JFace Text uses partitions?
Why JFace Text uses partitions? [message #778199] Wed, 11 January 2012 11:06 Go to next message
Aivar Annamaa is currently offline Aivar Annamaa
Messages: 32
Registered: July 2009
Member
It seems that Eclipse source code editors use something like two-level lexing -- they first divide text into partitions and then divide partitions into actual grammar tokens (in some articles the objects corresponding to partitions are also called tokens).

Why was this extra notion of partitions introduced?

[Updated on: Wed, 11 January 2012 11:06]

Report message to a moderator

Re: Why JFace Text uses partitions? [message #778416 is a reply to message #778199] Thu, 12 January 2012 02:41 Go to previous messageGo to next message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
On 11.01.2012 17:06, Aivar Annamaa wrote:
> It seems that Eclipse source code editors use something like two-level
> lexing -- they first divide text into partitions and then divide
> partitions into actual grammar tokens (in some places the objects
> corresponding to partitions are also called tokens).
>
> Why was this extra notion of partitions introduced?
The partition information is not just used for the scanner. It also
allows to contribute/enable different implementations of a feature (e.g.
hovers) directly to a partition (e.g. the JavadocHover to the Javadoc
partition). Of course this might not make sense in all cases. You are
free to only use the default partition.

Dani
Re: Why JFace Text uses partitions? [message #778600 is a reply to message #778416] Fri, 13 January 2012 08:32 Go to previous message
Aivar Annamaa is currently offline Aivar Annamaa
Messages: 32
Registered: July 2009
Member
Thanks! I suspected that the partitions might be non-essential and your message gave me confirmation.
Previous Topic:How to customise the console/problem views?
Next Topic:Eclipse 3.6: org.eclipse.ui.commands.IElementUpdater - How to update before beeing executed?
Goto Forum:
  


Current Time: Thu Jul 31 13:37:22 EDT 2014

Powered by FUDForum. Page generated in 0.08183 seconds