org.vesalainen.grammar.math.MathExpressionParserFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lpg Show documentation
Show all versions of lpg Show documentation
Java Lookahead Parser Generator. Generator produces LALR(k) parsers. Grammar
rules are entered using annotations. Rule annotation can be attached to reducer
method, which keeps rule and it's action together.
The newest version!
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.vesalainen.grammar.math;
/**
*
* @author tkv
*/
public class MathExpressionParserFactory
{
public static final String MathExpressionParserClass = "org.vesalainen.grammar.impl.MathExpressionParserImpl";
public static MathExpressionParserIntf getInstance()
{
try
{
Class> cls = Class.forName(MathExpressionParserClass);
return (MathExpressionParserIntf) cls.newInstance();
}
catch (ClassNotFoundException | InstantiationException | IllegalAccessException ex)
{
throw new IllegalArgumentException(ex);
}
}
}