Language Engineering as a Toy Language โ the name is Small D. Integrated with the Eclipse Debug UI ๐, it provides a simple interpreter and debugger.
org.xtext.labs.mydsl.interpreter
is fully developed and designed based on parsing results. Itโs not a built-in feature of the Xtend framework.org.xtext.labs.mydsl/src/org/xtext/labs/Mydsl.xtext
. Once parsing is complete and the AST is generated, it becomes the foundation for all language customization and engineering.Small D is a toy language for exploring Language Engineering.
โDโ stands for DSL (Domain-Specific Language). Unlike general-purpose languages like C or Java, DSLs are tailored for specific tasks or domains.
Normally, implementing a new language doesnโt make sense for time- or budget-constrained projects. But sometimes, it's necessary. Unfortunately, simple and practical references are hard to find, and most DSLs are proprietary, making examples rare.
Even finding debugger documentation often leads to low-level gdb or obscure references โ not practical for newcomers. Thatโs why I created a small language with essential IDE features for learning purposes.
I hope it helps you, too. ๐
Features:
2. Debuggable Interpreter & Debugger ๐๐งฑ Xtext documentation is sparse, sometimes outdated, and the community is small โ but it's still better than nothing.
org.xtext.labs.mydsl.product
DSLDeveloper.product
๐ ๏ธ For installers:
5. Java & C# Generator ๐Use Inno Setup โ free and easy ๐ธ
ref
(demonstrates call-by-reference) ๐๐ก Pascal is a well-known language that supports call-by-reference.
Sample code can be found in org.xtext.labs.mydsl.product/src
num
, string
, bool
if ~ else
(no else if
)while
loop onlydef function_name() {}
launch_main
is the entry pointNot supporting Direct function calls in expressions
โ printstr(numtostr(b))
โ
a = numtostr(b) printstr(a)
Grammar supports multiple operations, but interpreter doesn't yet (lazy dev ๐ ) โ You can define operator precedence manually if needed
printstr(varStr)
๐จ๏ธstrjoin(var1, var2)
๐varArr = strsplit(var1, "delimiter")
varStr = numtostr(varNum)
getargs(index)
org.xtext.labs.mydsl.interpreter
as a Runnable JARDSLDeveloper.product
debugDSL.jar
from org.xtext.labs.mydsl.interpreter
D:\DSLDeveloper\debug\debugDSL.jar
(example path)Reference: Robert Wlochโs Blog
1. In the Plug-ins tab change the Launch with select box to plug-ins select below only and uncheck the Target Platform subtree and check the two options below the plug-ins list. In the search field above the plug-ins list enter equinox. and check the equinox.ds plug-in: In the filtered list also check the equinox.util plug-in: Now enter appl in the search field and check the ui.ide.application plug-in:
2. Switch to the Configuration tab and check Clear the configuration area before launching. This ensures that runtime Eclipse doesn't cache plug-in configuration which avoids occational pitfalls.
3. The last change needs to be done in the Common tab. Switch the radio choice to Shared file and enter the Project Explorer path to the product plug-in: /de.rowlo.testgenerator.testdsl.product. This will tell Eclipse to save that run configuration in a launcher file in the specified location:
4. Finally switch back to the Plug-ins tab, clear the search filter and check the checkbox Validate plug-ins automatically prior to launching. Then click several times on Add Required Plug-ins right of the plug-ins list. You can stop clicking when the number of selected plug-ins does not change no more. To check if nothing's missing click on Validate Plug-ins. Eclipse should tell you that no problems were detected. Click on Apply and Close the dialog now.
Xtext
Language Engineering
Eclipse Debugger
Deploying as Product
โ ๏ธ Known issue: Sometimes, Variables view is empty after suspend.
Workaround: switch view or reload it. Details
๐ Many thanks to StackOverflow!
Ports used:
29777
, 29888
If port error occurs:
cmd> netstat -ona | findstr 0.0:29777 TCP 0.0.0.0:29777 0.0.0.0:0 LISTENING 3116 cmd> taskkill /F /PID 3116
๐ PID 3116
will be terminated
ยฉ 2017 kimtth
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4