Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsVariable/String Substitution Grammar with ${var} Style
https://www.eclipse.org/forums/index.php/mv/msg/1082856/1749072/#msg_1749072
(shell script)
i = 1
echo ${i} -- prints 0
or
(FreeMarker)
<#assign i = 0/>
${i} -- would print 0
<#assign j = "jThing${i}"/>
${j} -- would print jThing0
or
(TCL)
foreach i { 0 1 2 3 } {
someString${i}
} -- prints someString0, someString1,someString2, someString3
I would like to provide this grammar/syntax to customers, but I'm unsure where to start. The main use case would be in constructing name IDs and then using them in references later. The for loop construct would be something to address in the future.
Where would I start? I've not been able to find any hits on this topic in Google regarding string or variable substitution or variable referencing so far. And since this isn't a style that many Java programmers use (except in Eclipse String Substitution), it seems most users of Xtext aren't really concerned about it and hence there are very few (none?) articles about it.
Is this something pretty basic to do in a grammar?
]]>Brandon Lewis2016-12-01T15:12:57-00:00Re: Variable/String Substitution Grammar with ${var} Style
https://www.eclipse.org/forums/index.php/mv/msg/1082856/1749079/#msg_1749079
Christian Dietrich2016-12-01T16:00:03-00:00