SugarJ doesn't work properly

28 views
Skip to first unread message

Parisa MoosaviNezhad

unread,
Jul 13, 2015, 3:09:58 AM7/13/15
to sug...@googlegroups.com

Hello everybody


I have installed SugarJ plug-in in my eclipse and try to develop a dsl and embed it to java but the parser of sugarj doesn’t work properly. I imported one of the examples which are in Github (Closure) but the project couldn’t be built.


When I open the .sugj file it is parsed and do not stop.




Best regards

Parisa

Sebastian Erdweg

unread,
Jul 14, 2015, 11:07:02 AM7/14/15
to sug...@googlegroups.com
Hi Parisa,

I just confirmed that the closure case study still works with the latest version of SugarJ.

Looking at your screenshot, it seems you try import the closure extension via the wildcard import “org.sugarj.example.*”. There are two problems with this import.
1) SugarJ does not support wildcard imports of language extensions. You need to import the extension explicitly:
import javaclosure.Syntax;
import javaclosure.Transformation;
2) The package “org.sugarj” is protected and cannot be used for user-defined code. You need to put the extension definition in another package that does not start with “org.sugarj”.

Does that help?
Sebastian
> Best regards
>
> Parisa
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "SugarJ" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sugarj+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Parisa Moosavi Nezhad

unread,
Aug 12, 2015, 7:59:01 AM8/12/15
to SugarJ
Hi Sebastian

I have some questions.
In paper "Language Composition Untangle" you mentioned to "Language Composition". Is the same as "DSL embedding", isn't it?

and another question:
Can we say that DSLs are always sugar syntax? I mean we use them to write fewer codes or to make the program clear. Is it correct? if not can you give me an example?

Really appreciate it
Parisa

Sebastian Erdweg

unread,
Aug 14, 2015, 9:07:43 AM8/14/15
to sug...@googlegroups.com
Hi Parisa,

> In paper "Language Composition Untangle" you mentioned to "Language Composition". Is the same as "DSL embedding", isn't it?
DSL embedding is a special form of language composition. In our paper, we call it “self extension” (Section 2.3). Other forms of language composition are “language extension” (Section 2.1) and “language unification” (Section 2.2).

> and another question:
> Can we say that DSLs are always sugar syntax? I mean we use them to write fewer codes or to make the program clear. Is it correct? if not can you give me an example?
Often, DSLs come with specific sugared syntax, but not always. For example, parser combinators can be considered a DSL, but they do not introduce new syntactic forms.

Hope this helps,
Sebastian
Reply all
Reply to author
Forward
0 new messages