Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » TextEditor connection
TextEditor connection [message #526933] Tue, 13 April 2010 14:16 Go to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
Hi All,
I am cross-posting on emf and rcp because I am actually asking two,
tightly bound, questions.

I need to connect a (simple) model to a TextEditor Syntax scanner.
More precisely I need:

1) highlight with a certain color/font all words in a certain list; list
is dynamic and list is in the model; color/font is in the model.
Usage case: I have a list of locations in the model and each time I type
in the Text Editor the name of a known place I want it highlighted in
the text. Of course I can add a location to the model and I want to have
the Text to be updated accordingly. I can have different classes of
locations, hence the different colors/fonts.

2) highlight with a certain color/font everything *between* two matched
tags; start-tag, end-tag and TextAttribute are in the model.
Usage case: implement several kind of semantic quoting in the Text: this
is a place description, this is a touristic information, this is
historical note, ...

I have tried using the usual partition/syntax scanners, but those have
(at least) two issues:

a) they are virtually static, I found no (easy) way to change them "on
the fly", while I would like to be able to add a new "location" or even
a new "semantic class" (adding them to the model, that's the easy part!)
while I'm typing in the TextEditor.

b) I would like to recognize the class (1) (keywords) even inside the
class (2) (semantic tagging), sometimes it would even make sense to nest
one semantic class into another (I am speaking about history and I then
insert info about a specific museum, which is touristic info).
All this doesn't seem possible with stock partition/syntax scanners.

Nearest thing I found would be to implement Semantic via
IDocumentPartitioner and Keyword using DefaultDamagerRepairer.
This approach still suffers from (a) and does not allow for nested
semantic sections.

Before I start (re)writing a huge portion of code:
Can someone tell me if something along these lines is available somewhere?
If the answer is "no": can someone tell me what is the "eclipse correct"
way to tackle the problem?

Thanks in advance.
Re: TextEditor connection [message #526958 is a reply to message #526933] Tue, 13 April 2010 15:04 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050300040209090600070302
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Mauro,

Comments below.


Mauro Condarelli wrote:
> Hi All,
> I am cross-posting on emf and rcp because I am actually asking two,
> tightly bound, questions.
>
> I need to connect a (simple) model to a TextEditor Syntax scanner.
> More precisely I need:
Sounds like a job for Xtext <http://www.eclipse.org/Xtext/>...
>
> 1) highlight with a certain color/font all words in a certain list;
> list is dynamic and list is in the model; color/font is in the model.
> Usage case: I have a list of locations in the model and each time I
> type in the Text Editor the name of a known place I want it
> highlighted in the text. Of course I can add a location to the model
> and I want to have the Text to be updated accordingly. I can have
> different classes of locations, hence the different colors/fonts.
>
> 2) highlight with a certain color/font everything *between* two
> matched tags; start-tag, end-tag and TextAttribute are in the model.
> Usage case: implement several kind of semantic quoting in the Text:
> this is a place description, this is a touristic information, this is
> historical note, ...
>
> I have tried using the usual partition/syntax scanners, but those have
> (at least) two issues:
>
> a) they are virtually static, I found no (easy) way to change them "on
> the fly", while I would like to be able to add a new "location" or
> even a new "semantic class" (adding them to the model, that's the easy
> part!) while I'm typing in the TextEditor.
>
> b) I would like to recognize the class (1) (keywords) even inside the
> class (2) (semantic tagging), sometimes it would even make sense to
> nest one semantic class into another (I am speaking about history and
> I then insert info about a specific museum, which is touristic info).
> All this doesn't seem possible with stock partition/syntax scanners.
>
> Nearest thing I found would be to implement Semantic via
> IDocumentPartitioner and Keyword using DefaultDamagerRepairer.
> This approach still suffers from (a) and does not allow for nested
> semantic sections.
>
> Before I start (re)writing a huge portion of code:
> Can someone tell me if something along these lines is available
> somewhere?
> If the answer is "no": can someone tell me what is the "eclipse
> correct" way to tackle the problem?
Before you write a line of code, you need to explore Xtext. It
generates everything you describe from BNF-style grammar.
>
> Thanks in advance.

--------------050300040209090600070302
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Mauro,<br>
<br>
Comments below.<br>
<br>
<br>
Mauro Condarelli wrote:
<blockquote cite="mid:hq1ubo$p2d$1@build.eclipse.org" type="cite">Hi
All,
<br>
I am cross-posting on emf and rcp because I am actually asking two,
tightly bound, questions.
<br>
<br>
I need to connect a (simple) model to a TextEditor Syntax scanner.
<br>
More precisely I need:
<br>
</blockquote>
Sounds like a job for <a href="http://www.eclipse.org/Xtext/">Xtext</a>...<br>
<blockquote cite="mid:hq1ubo$p2d$1@build.eclipse.org" type="cite"><br>
1) highlight with a certain color/font all words in a certain list;
list is dynamic and list is in the model; color/font is in the model.
<br>
Usage case: I have a list of locations in the model and each time I
type in the Text Editor the name of a known place I want it highlighted
in the text. Of course I can add a location to the model and I want to
have the Text to be updated accordingly. I can have different classes
of locations, hence the different colors/fonts.
<br>
<br>
2) highlight with a certain color/font everything *between* two matched
tags; start-tag, end-tag and TextAttribute are in the model.
<br>
Usage case: implement several kind of semantic quoting in the Text:
this is a place description, this is a touristic information, this is
historical note, ...
<br>
<br>
I have tried using the usual partition/syntax scanners, but those have
(at least) two issues:
<br>
<br>
a) they are virtually static, I found no (easy) way to change them "on
the fly", while I would like to be able to add a new "location" or even
a new "semantic class" (adding them to the model, that's the easy
part!) while I'm typing in the TextEditor.
<br>
<br>
b) I would like to recognize the class (1) (keywords) even inside the
class (2) (semantic tagging), sometimes it would even make sense to
nest one semantic class into another (I am speaking about history and I
then insert info about a specific museum, which is touristic info).
<br>
All this doesn't seem possible with stock partition/syntax scanners.
<br>
<br>
Nearest thing I found would be to implement Semantic via
IDocumentPartitioner and Keyword using DefaultDamagerRepairer.
<br>
This approach still suffers from (a) and does not allow for nested
semantic sections.
<br>
<br>
Before I start (re)writing a huge portion of code:
<br>
Can someone tell me if something along these lines is available
somewhere?
<br>
If the answer is "no": can someone tell me what is the "eclipse
correct" way to tackle the problem?
<br>
</blockquote>
Before you write a line of code, you need to explore Xtext.&nbsp; It
generates everything you describe from BNF-style grammar.<br>
<blockquote cite="mid:hq1ubo$p2d$1@build.eclipse.org" type="cite"><br>
Thanks in advance.
<br>
</blockquote>
</body>
</html>

--------------050300040209090600070302--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: TextEditor connection [message #527060 is a reply to message #526958] Tue, 13 April 2010 20:14 Go to previous messageGo to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
Thanks for Your answer,
Comments below.

On 13/04/2010 17.04, Ed Merks wrote:
> Mauro,
>
> Comments below.
>
>
> Mauro Condarelli wrote:
>> Hi All,
>> I am cross-posting on emf and rcp because I am actually asking two,
>> tightly bound, questions.
>>
>> I need to connect a (simple) model to a TextEditor Syntax scanner.
>> More precisely I need:
> Sounds like a job for Xtext <http://www.eclipse.org/Xtext/>...

Sorry, but I fail to follow You.
I had a (admittedly brief) look at Xtext and it looks like a very nice
framework to implement Special-purpose languages.

What I need, OTOH, is something akin to a Desktop Publishing program
where I can tag sections of (arbitrary) text as having certain
characteristics (style) and be able to change the visual appearance of
the text changing the style definition.
Exactly like in a DTP I need to be able to define new "styles" (they
will be in the model), unlike a DTP (Word, OpenOffice) I want to have a
textual representation of the start/end tag (something like HTML, but
instead of fixed <StyleA>...</StyleA> I want generic patterns held in
the model, like "@A{" and "}A@").

Xtext doesn't seem able to do something like that.
Am I missing something?

What I need is a Syntax highlighter whose syntax is not fixed, but model
driven.

The key is that the syntax I'm speaking about is trivial: just a
(dynamic) bunch of keywords and a (again dynamic) bunch of fancy
open/close brackets. Otherwise it would be helpless.

Thanks
Mauro

>>
>> 1) highlight with a certain color/font all words in a certain list;
>> list is dynamic and list is in the model; color/font is in the model.
>> Usage case: I have a list of locations in the model and each time I
>> type in the Text Editor the name of a known place I want it
>> highlighted in the text. Of course I can add a location to the model
>> and I want to have the Text to be updated accordingly. I can have
>> different classes of locations, hence the different colors/fonts.
>>
>> 2) highlight with a certain color/font everything *between* two
>> matched tags; start-tag, end-tag and TextAttribute are in the model.
>> Usage case: implement several kind of semantic quoting in the Text:
>> this is a place description, this is a touristic information, this is
>> historical note, ...
>>
>> I have tried using the usual partition/syntax scanners, but those have
>> (at least) two issues:
>>
>> a) they are virtually static, I found no (easy) way to change them "on
>> the fly", while I would like to be able to add a new "location" or
>> even a new "semantic class" (adding them to the model, that's the easy
>> part!) while I'm typing in the TextEditor.
>>
>> b) I would like to recognize the class (1) (keywords) even inside the
>> class (2) (semantic tagging), sometimes it would even make sense to
>> nest one semantic class into another (I am speaking about history and
>> I then insert info about a specific museum, which is touristic info).
>> All this doesn't seem possible with stock partition/syntax scanners.
>>
>> Nearest thing I found would be to implement Semantic via
>> IDocumentPartitioner and Keyword using DefaultDamagerRepairer.
>> This approach still suffers from (a) and does not allow for nested
>> semantic sections.
>>
>> Before I start (re)writing a huge portion of code:
>> Can someone tell me if something along these lines is available
>> somewhere?
>> If the answer is "no": can someone tell me what is the "eclipse
>> correct" way to tackle the problem?
> Before you write a line of code, you need to explore Xtext. It generates
> everything you describe from BNF-style grammar.
>>
>> Thanks in advance.
Re: TextEditor connection [message #527257 is a reply to message #527060] Wed, 14 April 2010 15:13 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Mauro,

Mauro Condarelli schrieb:
>> Mauro Condarelli wrote:
>>> Hi All,
>>> I am cross-posting on emf and rcp because I am actually asking two,
>>> tightly bound, questions.
>>>
>>> I need to connect a (simple) model to a TextEditor Syntax scanner.
>>> More precisely I need:
>> Sounds like a job for Xtext <http://www.eclipse.org/Xtext/>...
>
> Sorry, but I fail to follow You.
> I had a (admittedly brief) look at Xtext and it looks like a very nice
> framework to implement Special-purpose languages.

From what I understood your DTP language looks like it is exactly that.

> What I need, OTOH, is something akin to a Desktop Publishing program
> where I can tag sections of (arbitrary) text as having certain
> characteristics (style) and be able to change the visual appearance of
> the text changing the style definition.
> Exactly like in a DTP I need to be able to define new "styles" (they
> will be in the model), unlike a DTP (Word, OpenOffice) I want to have a
> textual representation of the start/end tag (something like HTML, but
> instead of fixed <StyleA>...</StyleA> I want generic patterns held in
> the model, like "@A{" and "}A@").

Xtext provides a hook to do semantic coloring, that is coloring based on
the parsed (and referenced) models. It should eb straight forward to
read the referenced styling and apply it to a certain text
representation. Looks like a funny and interesting exercise so I'll give
it a try. Stay tuned :-)

Sven


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: TextEditor connection [message #527422 is a reply to message #527257] Thu, 15 April 2010 08:39 Go to previous messageGo to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
Hi Sven,
Comments below.

On 14/04/2010 17.13, Sven Efftinge wrote:
> Hi Mauro,
>
> Mauro Condarelli schrieb:
>>> Mauro Condarelli wrote:
>>>> Hi All,
>>>> I am cross-posting on emf and rcp because I am actually asking two,
>>>> tightly bound, questions.
>>>>
>>>> I need to connect a (simple) model to a TextEditor Syntax scanner.
>>>> More precisely I need:
>>> Sounds like a job for Xtext <http://www.eclipse.org/Xtext/>...
>>
>> Sorry, but I fail to follow You.
>> I had a (admittedly brief) look at Xtext and it looks like a very nice
>> framework to implement Special-purpose languages.
>
> From what I understood your DTP language looks like it is exactly that.
I have the distinct feeling I'm making a fool of myself, but I really
want to understand (if I can).

For what I understand my "DTP language" would be a "variable" one, since
I'm adding both "keywords" and "semantic brackets" at runtime.

To be more precise:
- I plan to handle adding new "Semantic Brackets" via preferences: I
have a small EMF model that holds all the info and I load/save it as a
String in preferences.
- Keywords are handled in the main model which holds a lot of stuff,
including "Places" whose getName() will become keywords and the vaious
texts I want to edit with this TextEditor.

I didn't understand from the docs I read how to handle this with Xtext.

I understand I could define a fixed set of keywords and/or "brackets"
and have Xtext generate a parser for that. It is the dynamic part that
baffles me.

What am I missing?

>
>> What I need, OTOH, is something akin to a Desktop Publishing program
>> where I can tag sections of (arbitrary) text as having certain
>> characteristics (style) and be able to change the visual appearance of
>> the text changing the style definition.
>> Exactly like in a DTP I need to be able to define new "styles" (they
>> will be in the model), unlike a DTP (Word, OpenOffice) I want to have
>> a textual representation of the start/end tag (something like HTML,
>> but instead of fixed <StyleA>...</StyleA> I want generic patterns held
>> in the model, like "@A{" and "}A@").
>
> Xtext provides a hook to do semantic coloring, that is coloring based on
> the parsed (and referenced) models. It should eb straight forward to
> read the referenced styling and apply it to a certain text
> representation. Looks like a funny and interesting exercise so I'll give
> it a try. Stay tuned :-)

I would love to see a real example (especially if I can steal it for my
project! ;) ).
Coding a new ITokenScanner from scratch (which is what I started doing)
does not look like fun.
I'm looking forward at Your code.

>
> Sven
>
>

P.S.: Perhaps You can just P.M. me, if You think this is not interesting
for the EMF community at large.

Regards
Mauro
Re: TextEditor connection [message #527558 is a reply to message #527422] Thu, 15 April 2010 15:19 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
I've implemented a prototype of something like that:
http://blog.efftinge.de/2010/04/wysiwyg-with-xtext.html

Not sure if it is what you are looking for, though.

Cheers,
Sven

Mauro Condarelli schrieb:
> Hi Sven,
> Comments below.
>
> On 14/04/2010 17.13, Sven Efftinge wrote:
>> Hi Mauro,
>>
>> Mauro Condarelli schrieb:
>>>> Mauro Condarelli wrote:
>>>>> Hi All,
>>>>> I am cross-posting on emf and rcp because I am actually asking two,
>>>>> tightly bound, questions.
>>>>>
>>>>> I need to connect a (simple) model to a TextEditor Syntax scanner.
>>>>> More precisely I need:
>>>> Sounds like a job for Xtext <http://www.eclipse.org/Xtext/>...
>>>
>>> Sorry, but I fail to follow You.
>>> I had a (admittedly brief) look at Xtext and it looks like a very nice
>>> framework to implement Special-purpose languages.
>>
>> From what I understood your DTP language looks like it is exactly that.
> I have the distinct feeling I'm making a fool of myself, but I really
> want to understand (if I can).
>
> For what I understand my "DTP language" would be a "variable" one, since
> I'm adding both "keywords" and "semantic brackets" at runtime.
>
> To be more precise:
> - I plan to handle adding new "Semantic Brackets" via preferences: I
> have a small EMF model that holds all the info and I load/save it as a
> String in preferences.
> - Keywords are handled in the main model which holds a lot of stuff,
> including "Places" whose getName() will become keywords and the vaious
> texts I want to edit with this TextEditor.
>
> I didn't understand from the docs I read how to handle this with Xtext.
>
> I understand I could define a fixed set of keywords and/or "brackets"
> and have Xtext generate a parser for that. It is the dynamic part that
> baffles me.
>
> What am I missing?
>
>>
>>> What I need, OTOH, is something akin to a Desktop Publishing program
>>> where I can tag sections of (arbitrary) text as having certain
>>> characteristics (style) and be able to change the visual appearance of
>>> the text changing the style definition.
>>> Exactly like in a DTP I need to be able to define new "styles" (they
>>> will be in the model), unlike a DTP (Word, OpenOffice) I want to have
>>> a textual representation of the start/end tag (something like HTML,
>>> but instead of fixed <StyleA>...</StyleA> I want generic patterns held
>>> in the model, like "@A{" and "}A@").
>>
>> Xtext provides a hook to do semantic coloring, that is coloring based on
>> the parsed (and referenced) models. It should eb straight forward to
>> read the referenced styling and apply it to a certain text
>> representation. Looks like a funny and interesting exercise so I'll give
>> it a try. Stay tuned :-)
>
> I would love to see a real example (especially if I can steal it for my
> project! ;) ).
> Coding a new ITokenScanner from scratch (which is what I started doing)
> does not look like fun.
> I'm looking forward at Your code.
>
>>
>> Sven
>>
>>
>
> P.S.: Perhaps You can just P.M. me, if You think this is not interesting
> for the EMF community at large.
>
> Regards
> Mauro


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: TextEditor connection [message #527575 is a reply to message #527558] Thu, 15 April 2010 16:24 Go to previous messageGo to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
On 15/04/2010 17.19, Sven Efftinge wrote:
> I've implemented a prototype of something like that:
> http://blog.efftinge.de/2010/04/wysiwyg-with-xtext.html
>
> Not sure if it is what you are looking for, though.
>

Thanks a lot Sven!

Got it.
Trying to study it.

I installed Xtext from: 'TMF Xtext Update Site (Milestones) -
http://download.itemis.com/updates/milestones'.

but I get the error: 'The method getNode(FormattedContent) is undefined
for the type NodeUtil' at DocumentsClourer.java:23.

Should I use the nightly builds or is there something else amiss?

Regards
Mauro

> Cheers,
> Sven
>
> Mauro Condarelli schrieb:
>> Hi Sven,
>> Comments below.
>>
>> On 14/04/2010 17.13, Sven Efftinge wrote:
>>> Hi Mauro,
>>>
>>> Mauro Condarelli schrieb:
>>>>> Mauro Condarelli wrote:
>>>>>> Hi All,
>>>>>> I am cross-posting on emf and rcp because I am actually asking two,
>>>>>> tightly bound, questions.
>>>>>>
>>>>>> I need to connect a (simple) model to a TextEditor Syntax scanner.
>>>>>> More precisely I need:
>>>>> Sounds like a job for Xtext <http://www.eclipse.org/Xtext/>...
>>>>
>>>> Sorry, but I fail to follow You.
>>>> I had a (admittedly brief) look at Xtext and it looks like a very nice
>>>> framework to implement Special-purpose languages.
>>>
>>> From what I understood your DTP language looks like it is exactly that.
>> I have the distinct feeling I'm making a fool of myself, but I really
>> want to understand (if I can).
>>
>> For what I understand my "DTP language" would be a "variable" one,
>> since I'm adding both "keywords" and "semantic brackets" at runtime.
>>
>> To be more precise:
>> - I plan to handle adding new "Semantic Brackets" via preferences: I
>> have a small EMF model that holds all the info and I load/save it as a
>> String in preferences.
>> - Keywords are handled in the main model which holds a lot of stuff,
>> including "Places" whose getName() will become keywords and the vaious
>> texts I want to edit with this TextEditor.
>>
>> I didn't understand from the docs I read how to handle this with Xtext.
>>
>> I understand I could define a fixed set of keywords and/or "brackets"
>> and have Xtext generate a parser for that. It is the dynamic part that
>> baffles me.
>>
>> What am I missing?
>>
>>>
>>>> What I need, OTOH, is something akin to a Desktop Publishing program
>>>> where I can tag sections of (arbitrary) text as having certain
>>>> characteristics (style) and be able to change the visual appearance of
>>>> the text changing the style definition.
>>>> Exactly like in a DTP I need to be able to define new "styles" (they
>>>> will be in the model), unlike a DTP (Word, OpenOffice) I want to have
>>>> a textual representation of the start/end tag (something like HTML,
>>>> but instead of fixed <StyleA>...</StyleA> I want generic patterns held
>>>> in the model, like "@A{" and "}A@").
>>>
>>> Xtext provides a hook to do semantic coloring, that is coloring based on
>>> the parsed (and referenced) models. It should eb straight forward to
>>> read the referenced styling and apply it to a certain text
>>> representation. Looks like a funny and interesting exercise so I'll give
>>> it a try. Stay tuned :-)
>>
>> I would love to see a real example (especially if I can steal it for
>> my project! ;) ).
>> Coding a new ITokenScanner from scratch (which is what I started
>> doing) does not look like fun.
>> I'm looking forward at Your code.
>>
>>>
>>> Sven
>>>
>>>
>>
>> P.S.: Perhaps You can just P.M. me, if You think this is not
>> interesting for the EMF community at large.
>>
>> Regards
>> Mauro
>
>
Re: TextEditor connection [message #527686 is a reply to message #527575] Fri, 16 April 2010 06:47 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Mauro Condarelli schrieb:
> On 15/04/2010 17.19, Sven Efftinge wrote:
>> I've implemented a prototype of something like that:
>> http://blog.efftinge.de/2010/04/wysiwyg-with-xtext.html
>>
>> Not sure if it is what you are looking for, though.
>>
>
> Thanks a lot Sven!
>
> Got it.
> Trying to study it.
>
> I installed Xtext from: 'TMF Xtext Update Site (Milestones) -
> http://download.itemis.com/updates/milestones'.
>
> but I get the error: 'The method getNode(FormattedContent) is undefined
> for the type NodeUtil' at DocumentsClourer.java:23.

Oops, I accidently used a method which has been introduced after M6.

It is
public static CompositeNode getNode(EObject obj) {
NodeAdapter nodeAdapter = getNodeAdapter(obj);
return nodeAdapter == null ? null : nodeAdapter.getParserNode();
}

The nightlies can be downloaded from
http://download.itemis.com/updates/nightly/

Regards,
Sven


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Previous Topic:Tweaking genModel from schema
Next Topic:[CDO] Transaction status still dirty in CDOTransactionHandler#committedTransaction()
Goto Forum:
  


Current Time: Thu Apr 25 19:36:56 GMT 2024

Powered by FUDForum. Page generated in 0.02925 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top