Search in sources :

Example 1 with DebugExprParser

use of com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.antlr.DebugExprParser in project graal by oracle.

the class LLVMLanguage method parse.

@Override
protected ExecutableNode parse(InlineParsingRequest request) {
    Object globalScope = getScope(getContext());
    final DebugExprParser d = new DebugExprParser(request, globalScope);
    try {
        return new DebugExprExecutableNode(d.parse());
    } catch (DebugExprException | LLVMParserException e) {
        // error found during parsing
        String errorMessage = e.getMessage();
        return new ExecutableNode(this) {

            @Override
            public Object execute(VirtualFrame frame) {
                return errorMessage;
            }
        };
    }
}
Also used : VirtualFrame(com.oracle.truffle.api.frame.VirtualFrame) DebugExprParser(com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.antlr.DebugExprParser) DebugExprException(com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.DebugExprException) DebugExprExecutableNode(com.oracle.truffle.llvm.runtime.debug.debugexpr.nodes.DebugExprExecutableNode) ExecutableNode(com.oracle.truffle.api.nodes.ExecutableNode) DebugExprExecutableNode(com.oracle.truffle.llvm.runtime.debug.debugexpr.nodes.DebugExprExecutableNode) LLVMParserException(com.oracle.truffle.llvm.runtime.except.LLVMParserException)

Aggregations

VirtualFrame (com.oracle.truffle.api.frame.VirtualFrame)1 ExecutableNode (com.oracle.truffle.api.nodes.ExecutableNode)1 DebugExprExecutableNode (com.oracle.truffle.llvm.runtime.debug.debugexpr.nodes.DebugExprExecutableNode)1 DebugExprException (com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.DebugExprException)1 DebugExprParser (com.oracle.truffle.llvm.runtime.debug.debugexpr.parser.antlr.DebugExprParser)1 LLVMParserException (com.oracle.truffle.llvm.runtime.except.LLVMParserException)1