Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [xtext-dev] scope delimiter keword's (SDKS)

Hi,

the scoping delimiters could be interesting in the context of partial parsing, too.

In PP, we extend the dirty region by ascending the parse tree until we have a section that can be entered by a parser rule without lookahead. Scope rules could be an natural choice for such an entry rule, as I expect them to explicitely consume all lookahead tokens. We could e.g. mark certain parser rules as scope rules with defined start and end keywords.

Just my 2 cent.
Jan


Am 29.07.2008 um 07:48 schrieb Sven Efftinge:

Hi Michael,

sorry for the late response. I think we should discuss things in english so that we do not exclude any interested spectators. Your question was whether we should come up with something like 'scope delimiter keywords' (like e.g, '{' and '}'), which are explicitly declared in the grammar.

I see the following things where this information could be reused:

- provide better default scoping (we don't yet provide default scopes at all)
- provide better default fragments (i.e. qualified names)
- provide auto edit facilities (automatic inserting the closing bracket) -- this is what you were thinking of, right?
- folding could use this information
- serialization / formatting could use the information for indentation
Any additions?

On the downside, I think we would heavily overload the term 'scope' when using the information for so many different things (but, hey, this is abstraction ;-)). More important, the grammar language grows and grows, and I get the feeling that we should try to separate things.

Why not defining another language service (e.g. 'IScopingService') which can be implemented as fits, and the default implementation uses '{' '}' as scope delimiters?

I'ld propose something like this:

IScopingService {
   boolean isScopeStart(AbstractElement ele);
   boolean isScopeEnd(AbstractElement ele);
}

What do you think?

Sven


On Jul 23, 2008, at 10:43 PM, michael clay wrote:

hallo,

keine ahnung ob das die richtige bezeichnung ist aber ich nenne sie
einfach mal 'scope delimiter kewords' (SDKS)  z.B.  {} () [] usw.

meine frage: koennen wir fuer diese SDKS einen optionalen hint in die
xtext grammatik mitaufnehmen damit ich diese im contentassist
erkenne und automatisch einfuege sodass sie der anwender nicht mehr
extra eingeben/auswaehlen muss?

danke
michael
_______________________________________________
xtext-dev mailing list
xtext-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/xtext-dev

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

--
Dr. Jan Köhnlein
Senior Software Architekt

Telefon: +49 (0) 431 / 5606-337
Mobile: +49 (0) 163 / 3979 776
Telefax: +49 (0) 431 / 5606-339

http://www.itemis.de
jan.koehnlein@xxxxxxxxx

itemis AG
Schauenburgerstr. 116
24118 Kiel

Rechtlicher Hinweis:

Amtsgericht Dortmund, HRB 20621

Vorstand: Wolfgang Neuhaus, Jens Wagener, Dr. Georg Pietrek

Aufsichtsrat: Prof. Dr. Burkhart Igel (Vors.) Stephan Grollmann, Michael Neuhaus




Back to the top