use of org.palladiosimulator.pcm.stochasticexpressions.parser.MyPCMStoExLexer in project Palladio-Editors-Sirius by PalladioSimulator.
the class PCMServices method validExpression.
/**
* Parses an stochastic expression to determine whether it is valid.
*
* @param the
* expressionString
* @return the validity
*/
private boolean validExpression(final String expressionString) {
final MyPCMStoExLexer lexer = new MyPCMStoExLexer(new ANTLRStringStream(expressionString));
final MyPCMStoExParser parser = new MyPCMStoExParser(new CommonTokenStream(lexer));
try {
parser.expression();
} catch (final RecognitionException e1) {
return false;
}
if (lexer.hasErrors() || parser.hasErrors()) {
return false;
}
return true;
}
Aggregations