}
public Behaviour parseBehaviour(final String filePath) {
BehaviourParser parser = new BehaviourParser(new BehaviourParser.IBehaviourFactoryFactory() {
public BehaviourParser.IBehaviourFactory getFactory(int phase) {
return new BehaviourFactory();
}
});
ParsingResult result = parser.parse(new FileSource(filePath));
if (!result.success()) {
return null;
}
BehaviourFactory behaviourFactory = (BehaviourFactory)parser.getFactory();
Behaviour behaviour = behaviourFactory.getBehaviour();
return behaviour;
}