Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Need brutal review / tips
Need brutal review / tips [message #784131] Fri, 27 January 2012 05:01 Go to next message
Eric Springer is currently offline Eric SpringerFriend
Messages: 5
Registered: January 2012
Junior Member
I'm working on a compile-to-js language, the description is here:


github.com/espringe/staticscript/


So far, I've only been working on the grammar, which is here:

github.com/espringe/staticscript/blob/master/staticscript/src/espringe/StaticScript.xtext


And I'm pretty close(ish) to done, but I can't help feel like I'm doing it really, really wrong.

If someone could look at that, and tell me everything that comes to mind, I'd highly appreciate it.


The thing I feel I'm doing especially wrong, is how I do cross links. Like all variable, types and function goes through "DefinedName" so I can cross link against it. The upside is it works, the downside is -- if in a particular place in my Grammar I *know* I need a type -- I am used "DefinedName" which would allow people to enter a variable for instance.

Also from the attached screenshot, you can see my "outline" view is an absolute total mess. What can I do to my grammar to preven this?


Thank you for reading!
Eric

( sorry, can't make stuff a link, till I've made 5 posts)


P.S. Absolutely fantastic work on XText. I can't imagine a tool done better (other than perhaps finding all errors earlier than ANTLR)
  • Attachment: yuck.png
    (Size: 57.81KB, Downloaded 119 times)

[Updated on: Fri, 27 January 2012 05:03]

Report message to a moderator

Re: Need brutal review / tips [message #784570 is a reply to message #784131] Fri, 27 January 2012 18:04 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

Welcome to Xtext!

first of all you do not have to do everything "in the grammar".

you can adapt the cross references with custom scoping / IQualifiedNameProvider
you can adapt the outline as well (the structure as well as the label)

your ScopeProvider is empty. You have no custom IQualifiedNameProvider bound.
Nor did you changes to your LabelProvider and OutlineTreeProvider.

next step would be to read the documentation (and maybe some blogs)
on topics like Scoping to see what you can do.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:How to know if a model really change when using addModelListener
Next Topic:Issue saving Xtext resource from Eclipse plug-ins
Goto Forum:
  


Current Time: Thu Apr 25 04:12:25 GMT 2024

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

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

Back to the top