Search in sources :

Example 1 with ASTMolecularTypePattern

use of org.vcell.model.bngl.ASTMolecularTypePattern in project vcell by virtualcell.

the class RbmUtils method parseMolecularType.

public static MolecularType parseMolecularType(String inputString) throws ParseException {
    try {
        BNGLParser parser = new BNGLParser(new StringReader(inputString));
        ASTMolecularTypePattern astMolecularPattern = parser.MolecularTypePattern();
        BnglObjectConstructionVisitor constructionVisitor = new BnglObjectConstructionVisitor();
        MolecularType molecularType = (MolecularType) astMolecularPattern.jjtAccept(constructionVisitor, null);
        return molecularType;
    } catch (Throwable ex) {
        ex.printStackTrace();
        throw new ParseException(ex.getMessage());
    }
}
Also used : ParticleMolecularType(cbit.vcell.math.ParticleMolecularType) BNGLParser(org.vcell.model.bngl.BNGLParser) ASTMolecularTypePattern(org.vcell.model.bngl.ASTMolecularTypePattern) StringReader(java.io.StringReader) ParseException(org.vcell.model.bngl.ParseException)

Aggregations

ParticleMolecularType (cbit.vcell.math.ParticleMolecularType)1 StringReader (java.io.StringReader)1 ASTMolecularTypePattern (org.vcell.model.bngl.ASTMolecularTypePattern)1 BNGLParser (org.vcell.model.bngl.BNGLParser)1 ParseException (org.vcell.model.bngl.ParseException)1