// simulate "Hello ${user}!"
GStringExpression compositeStringExpr = new GStringExpression("hello ${user}!");
compositeStringExpr.addString(new ConstantExpression("Hello "));
compositeStringExpr.addValue(new VariableExpression("user"));
compositeStringExpr.addString(new ConstantExpression("!"));
BlockStatement block = new BlockStatement();
block.addStatement(
new ExpressionStatement(
new DeclarationExpression(
new VariableExpression("user"),
Token.newSymbol("=", -1, -1),
new ConstantExpression("World"))));
block.addStatement(
new ExpressionStatement(
new DeclarationExpression(new VariableExpression("str"), Token.newSymbol("=", -1, -1), compositeStringExpr)));
block.addStatement(
new ExpressionStatement(
new MethodCallExpression(VariableExpression.THIS_EXPRESSION, "println", new VariableExpression("str"))));
block.addStatement(
new ExpressionStatement(
new DeclarationExpression(
new VariableExpression("text"),
Token.newSymbol("=", -1, -1),
new MethodCallExpression(new VariableExpression("str"), "toString", MethodCallExpression.NO_ARGUMENTS))));
block.addStatement(
new AssertStatement(
new BooleanExpression(
new BinaryExpression(
new VariableExpression("text"),
Token.newSymbol("==", -1, -1),