Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Need brutal review / tips
Need brutal review / tips [message #784131] Fri, 27 January 2012 00:01 Go to next message
Eclipse UserFriend
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 130 times)

[Updated on: Fri, 27 January 2012 00:03] by Moderator

Re: Need brutal review / tips [message #784570 is a reply to message #784131] Fri, 27 January 2012 13:04 Go to previous message
Eclipse UserFriend
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
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: Sat Jul 12 23:25:41 EDT 2025

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

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

Back to the top