use of de.be4.classicalb.core.parser.node.TStringLiteral in project probparsers by bendisposto.
the class SyntaxExtensionTranslator method caseAMultilineStringExpression.
@Override
public void caseAMultilineStringExpression(AMultilineStringExpression node) {
final TMultilineStringContent content = node.getContent();
final String text = content.getText();
TStringLiteral tStringLiteral = new TStringLiteral(text, content.getLine(), content.getPos());
AStringExpression stringNode = new AStringExpression(tStringLiteral);
stringNode.setStartPos(node.getStartPos());
stringNode.setEndPos(node.getEndPos());
node.replaceBy(stringNode);
}
use of de.be4.classicalb.core.parser.node.TStringLiteral in project probparsers by bendisposto.
the class ASTBuilder method addChooseDefinition.
public static void addChooseDefinition(IDefinitions iDefinitions) {
if (iDefinitions.containsDefinition(CHOOSE)) {
return;
}
/*-
* TO_STRING(S) == "0";
* EXTERNAL_FUNCTION_TO_STRING(X) == (X --> STRING);
*/
AExpressionDefinitionDefinition chooseDef = new AExpressionDefinitionDefinition();
chooseDef.setName(new TIdentifierLiteral(CHOOSE));
chooseDef.setParameters(createIdentifierList("X"));
chooseDef.setRhs(new AStringExpression(new TStringLiteral("a member of X")));
iDefinitions.addDefinition(chooseDef, IDefinitions.Type.Expression);
AExpressionDefinitionDefinition chooseDefType = new AExpressionDefinitionDefinition();
chooseDefType.setName(new TIdentifierLiteral("EXTERNAL_FUNCTION_CHOOSE"));
chooseDefType.setParameters(createIdentifierList("T"));
chooseDefType.setRhs(new ATotalFunctionExpression(new APowSubsetExpression(createIdentifier("T")), createIdentifier("T")));
iDefinitions.addDefinition(chooseDefType, IDefinitions.Type.Expression);
}
Aggregations