use of de.bmoth.parser.ast.TypeErrorException in project bmoth by hhu-stups.
the class Parser method getFormulaAsSemanticAst.
public static FormulaNode getFormulaAsSemanticAst(String inputString) throws ParserException {
Parser parser = new Parser();
try {
FormulaContext formulaContext;
formulaContext = parser.parseFormula(inputString);
List<String> warnings = CSTAnalyser.analyseConcreteSyntaxTree(formulaContext);
FormulaNode formulaNode = parser.getFormulaAst(formulaContext);
formulaNode.setWarnings(warnings);
TypeChecker.typecheckFormulaNode(formulaNode);
return formulaNode;
} catch (ParseErrorException | TypeErrorException | ScopeException e) {
throw new ParserException(e);
}
}
use of de.bmoth.parser.ast.TypeErrorException in project bmoth by hhu-stups.
the class Parser method getLTLFormulaAsSemanticAst.
public static LTLFormula getLTLFormulaAsSemanticAst(String inputString) throws ParserException {
Parser parser = new Parser();
try {
LtlStartContext context;
context = parser.parseLTLFormula(inputString);
LTLFormula ltlFormulaAst = parser.getLTLFormulaAst(context);
TypeChecker.typecheckLTLFormulaNode(ltlFormulaAst);
return ltlFormulaAst;
} catch (ParseErrorException | ScopeException | TypeErrorException e) {
throw new ParserException(e);
}
}
use of de.bmoth.parser.ast.TypeErrorException in project bmoth by hhu-stups.
the class Parser method getMachineAsSemanticAst.
public static MachineNode getMachineAsSemanticAst(String inputString) throws ParserException {
Parser parser = new Parser();
try {
StartContext start = parser.parseMachine(inputString);
List<String> warnings = CSTAnalyser.analyseConcreteSyntaxTree(start);
MachineNode machineNode = parser.getMachineAst(start);
machineNode.setWarnings(warnings);
TypeChecker.typecheckMachineNode(machineNode);
return machineNode;
} catch (ParseErrorException | TypeErrorException | ScopeException e) {
throw new ParserException(e);
}
}
Aggregations