protected void nil() throws ParseException { if (fInput.getInputSExpression() instanceof Symbol) { if (!fInput.getInputSExpression().isNil()) { error("NIL or lambda list expected", fInput.getInputSExpression()); } } }
protected void keywordParam() throws ParseException { if (!fInput.hasNext()) return; if (fInput.next().getTyp() == TSExpression.SYMBOL) { Symbol symbol = (Symbol) fInput.current(); if (symbol.getSymbolName().equalsIgnoreCase(TOKEN_KEY)) { while (true) { if (!fInput.hasNext()) { break; } SExpression next = fInput.next(); if (isSpecialSymbol(next)) { fInput.pushBack(); break; } addKey(varInit(next)); } allowOtherKeys(); } else { fInput.pushBack(); } } else { error("Unknown symbol in key list: &key expected", fInput.getInputSExpression()); } }
private Symbol readRestOrBodySymbol(final String bodyRest) throws ParseException { if (!fInput.hasNext()) { error(bodyRest + " symbol expected", fInput.getInputSExpression()); } SExpression symbol = fInput.next(); if (symbol.getTyp() == TSExpression.SYMBOL && !isSpecialSymbol(symbol)) { // echtes symbol return (Symbol) symbol; } error(bodyRest + " symbol expected", symbol); return null; // wird nie erreicht }
private void errorWrongOrder() throws ParseException { error( "Wrong order of & parameters, order is: &optional &rest or &body &key", fInput.getInputSExpression()); }