use of de.prob.core.sablecc.node.Start in project probparsers by bendisposto.
the class AnswerTest method testGetANumber.
// yes('.'(=('CurID',root),[]))
@Test
public void testGetANumber() throws ResultParserException {
final String testString = "yes('.'(=('CurId',root),[]))";
final Start rootNode = ProBResultParser.parse(testString);
assertNotNull(PARSETREE_WAS_NULL, rootNode);
}
use of de.prob.core.sablecc.node.Start in project probparsers by bendisposto.
the class AnswerTest method testYes.
// executeOperationNr(1).
// yes([])
@Test
public void testYes() throws ResultParserException {
final String testString = "yes([])";
final Start rootNode = ProBResultParser.parse(testString);
assertNotNull(PARSETREE_WAS_NULL, rootNode);
}
use of de.prob.core.sablecc.node.Start in project prob2 by bendisposto.
the class CommandProcessor method sendCommand.
public IPrologResult sendCommand(final AbstractCommand command) {
String query;
if (command instanceof IRawCommand) {
query = ((IRawCommand) command).getCommand();
if (!query.endsWith(".")) {
query += ".";
}
} else {
PrologTermStringOutput pto = new PrologTermStringOutput();
command.writeCommand(pto);
pto.printAtom("true");
query = pto.fullstop().toString();
}
if (logger.isDebugEnabled()) {
logger.debug(StringUtils.chomp(StringUtils.abbreviate(query, 200)));
}
String result = cli.send(query);
final Start ast = parseResult(result);
IPrologResult extractResult = extractResult(ast);
if (logger.isDebugEnabled()) {
logger.debug(StringUtils.chomp(StringUtils.abbreviate(extractResult.toString(), 200)));
}
return extractResult;
}
Aggregations