コード例 #1
0
 protected void nil() throws ParseException {
   if (fInput.getInputSExpression() instanceof Symbol) {
     if (!fInput.getInputSExpression().isNil()) {
       error("NIL or lambda list expected", fInput.getInputSExpression());
     }
   }
 }
コード例 #2
0
  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());
    }
  }
コード例 #3
0
  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
  }
コード例 #4
0
 private void errorWrongOrder() throws ParseException {
   error(
       "Wrong order of & parameters, order is: &optional &rest or &body &key",
       fInput.getInputSExpression());
 }