@Override public void print(final SExpressionType e) throws IOException { e.matchExpression(this.matcher); }
private static Optional<ImmutableLexicalPositionType<Path>> getExpressionLexical(final SExpressionType q) { final Optional<LexicalPositionType<Path>> lex = q.getLexicalInformation(); return lex.map(ImmutableLexicalPosition::newFrom); }
private static Optional<LexicalPosition<Path>> getExpressionLexical(final SExpressionType q) { return q.lexical().map(LexicalPosition::copyOf); }
@Override public void print(final SExpressionType e) throws IOException { e.matchExpression(this.matcher); }
/** * @param e The expression * @param s The exception message * * @return A parser exception * * @see JPRAParseErrorCode#SYNTAX_ERROR */ public static JPRACompilerParseException syntaxError( final SExpressionType e, final String s) { return new JPRACompilerParseException( e.getLexicalInformation().map(ImmutableLexicalPosition::newFrom), JPRAParseErrorCode.SYNTAX_ERROR, s); }
/** * @param e The expression * @param s The exception message * * @return A parser exception * * @see JPRAParseErrorCode#SYNTAX_ERROR */ public static JPRACompilerParseException syntaxError( final SExpressionType e, final String s) { return new JPRACompilerParseException( e.lexical().map(LexicalPosition::copyOf), JPRAParseErrorCode.SYNTAX_ERROR, s); }
private static SExpressionListType requireList(final SExpressionType e) throws JPRACompilerParseException { return e.matchExpression( new SExpressionMatcherType<SExpressionListType, JPRACompilerParseException>() { @Override public SExpressionListType list(final SExpressionListType le) throws JPRACompilerParseException { return le; } @Override public SExpressionListType quotedString( final SExpressionQuotedStringType qe) throws JPRACompilerParseException { throw JPRACompilerParseException.expectedListGotQuotedString(qe); } @Override public SExpressionListType symbol(final SExpressionSymbolType se) throws JPRACompilerParseException { throw JPRACompilerParseException.expectedListGotSymbol(se); } }); }
final SExpressionType s = e_opt.get(); final Optional<LexicalPositionType<Path>> lex_opt = s.getLexicalInformation(); lex = lex_opt.map(ImmutableLexicalPosition::newFrom);
if (e_opt.isPresent()) { final SExpressionType s = e_opt.get(); final Optional<LexicalPositionType<Path>> lex_opt = s.lexical(); lex = lex_opt.map(LexicalPosition::copyOf);
private static SExpressionListType requireList(final SExpressionType e) throws JPRACompilerParseException { return e.matchExpression( new SExpressionMatcherType<SExpressionListType, JPRACompilerParseException>() { @Override public SExpressionListType list(final SExpressionListType le) throws JPRACompilerParseException { return le; } @Override public SExpressionListType quotedString( final SExpressionQuotedStringType qe) throws JPRACompilerParseException { throw JPRACompilerParseException.expectedListGotQuotedString(qe); } @Override public SExpressionListType symbol(final SExpressionSymbolType se) throws JPRACompilerParseException { throw JPRACompilerParseException.expectedListGotSymbol(se); } }); }
final SExpressionType s = opt.get(); lex = s.getLexicalInformation().map(ImmutableLexicalPosition::newFrom); pipe.onExpression(s); } else {
private static SExpressionSymbolType requireSymbol( final SExpressionType e) throws JPRACompilerParseException { return e.matchExpression( new SExpressionMatcherType<SExpressionSymbolType, JPRACompilerParseException>() { @Override public SExpressionSymbolType list(final SExpressionListType le) throws JPRACompilerParseException { throw JPRACompilerParseException.expectedSymbolGotList(le); } @Override public SExpressionSymbolType quotedString( final SExpressionQuotedStringType qe) throws JPRACompilerParseException { throw JPRACompilerParseException.expectedSymbolGotQuotedString(qe); } @Override public SExpressionSymbolType symbol(final SExpressionSymbolType se) throws JPRACompilerParseException { return se; } }); }
private static SExpressionSymbolType requireSymbol( final SExpressionType e) throws JPRACompilerParseException { return e.matchExpression( new SExpressionMatcherType<SExpressionSymbolType, JPRACompilerParseException>() { @Override public SExpressionSymbolType list(final SExpressionListType le) throws JPRACompilerParseException { throw JPRACompilerParseException.expectedSymbolGotList(le); } @Override public SExpressionSymbolType quotedString( final SExpressionQuotedStringType qe) throws JPRACompilerParseException { throw JPRACompilerParseException.expectedSymbolGotQuotedString(qe); } @Override public SExpressionSymbolType symbol(final SExpressionSymbolType se) throws JPRACompilerParseException { return se; } }); }
throws IOException e.matchExpression( new SExpressionMatcherType<Integer, IOException>()
throws IOException e.matchExpression( new SExpressionMatcherType<Integer, IOException>()
final SExpressionType e) return e.matchExpression( new SExpressionMatcherType< Validation<List<JSXValidationErrorType>,
throws JPRACompilerParseException return e.matchExpression( new SExpressionMatcherType<SizeExprType<Unresolved, Untyped>, JPRACompilerParseException>()
anyList(final SExpressionType e) return e.matchExpression( new SExpressionMatcherType< Validation<List<JSXValidationErrorType>,
anyQuotedString(final SExpressionType e) return e.matchExpression( new SExpressionMatcherType< Validation<List<JSXValidationErrorType>,
throws JPRACompilerParseException return e.matchExpression( new SExpressionMatcherType<SizeExprType<Unresolved, Untyped>, JPRACompilerParseException>()