IntegerTerm: IntegerLeaf | StringGetLength | FloatRound | ... | IntegerTermExternal ;
int mult(int a, int b)
IntegerTermExternal: Mult | ... ; Mult: {Mult} "Mult" "(" int1=IntegerTerm "," int2=IntegerTerm ")";
Mult (5, StringGetLength("abc"))
IntFunctionCall: name=ID '(' ')'
The grammar in Xtext is static because ANTLR doesn't support dynamic grammars, so you need a trick. In your grammar, use something like this:
IntFunctionCall: name=ID '(' ')'
You can offer the user a list of possible function names by creating your own ProposalProvider which examines the classpath via reflection.
When you "execute" the DSL, you will have to do the same: When you encounter a "IntFunctionCall" node, find the function via reflection and invoke it.