Interpreter.PrologInterpreter.Sexp
Class NilListSexp

java.lang.Object
  |
  +--Interpreter.Sexp.Sexp
        |
        +--Interpreter.Sexp.ConsSexp
              |
              +--Interpreter.PrologInterpreter.Sexp.TermSexp
                    |
                    +--Interpreter.PrologInterpreter.Sexp.NoArgsSexp
                          |
                          +--Interpreter.PrologInterpreter.Sexp.NilListSexp

public class NilListSexp
extends NoArgsSexp
implements NotCallable

Un oggetto NilListSexp è la lista vuota [].


Fields inherited from class Interpreter.PrologInterpreter.Sexp.TermSexp
priority, Prolog, PrologTerm, Spaces
 
Fields inherited from class Interpreter.Sexp.ConsSexp
head, tail
 
Fields inherited from class Interpreter.Sexp.Sexp
BEGIN_S, COUPLE_S, END_S, isAList, Lisp, nil, NIL_S, SEP_S, Separators
 
Constructor Summary
NilListSexp()
          Costruisce una nuova NilListSexp.
 
Method Summary
 void accept(SexpVisitor e)
          Accetta un SexpVisitor.
 java.lang.String toString()
          Restituisce la rappresentazione in forma di stringa.
 java.lang.String toString(java.lang.String[] sep, boolean personal)
          Restituisce la rappresentazione in forma di stringa.
 java.lang.String toStringInList(java.lang.String[] sep, boolean personal)
          Restituisce la rappresentazione in forma di stringa.
 
Methods inherited from class Interpreter.PrologInterpreter.Sexp.TermSexp
argList, argNum, first, functor, getPriority, getVarList, second, unify
 
Methods inherited from class Interpreter.Sexp.ConsSexp
append, car, cdr, count, equals, isEq, reverse, setIsAList
 
Methods inherited from class Interpreter.Sexp.Sexp
isAList, reverse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NilListSexp

public NilListSexp()
Costruisce una nuova NilListSexp.
Method Detail

toString

public java.lang.String toString()
Restituisce la rappresentazione in forma di stringa.
Returns:
la stringa rappresentativa dell'oggetto: una lista in formato prolog.
Overrides:
toString in class TermSexp

toString

public java.lang.String toString(java.lang.String[] sep,
                                 boolean personal)
Restituisce la rappresentazione in forma di stringa.
Parameters:
sep - contiene un array di 5 stringhe separatrici (see Separators): nil, couple, sep, beginList, endList.
personal - se true permette di personalizzare la stampa della lista utilizzando le stringhe prese da Separators di ciascuna Sexp, oppure sep se Separators non inizializzato. Nelle chiamate ricorsive a toStringInList() viene passato la lista corrente di separatori. Se false viene utilizzata sep in ogni caso.
Returns:
la stringa rappresentativa dell'oggetto.
Overrides:
toString in class TermSexp
See Also:
Sexp.Separators

toStringInList

public java.lang.String toStringInList(java.lang.String[] sep,
                                       boolean personal)
Restituisce la rappresentazione in forma di stringa. Viene usata all'interno di una lista.
Parameters:
sep - contiene un array di 5 stringhe separatrici (see Separators): nil, couple, sep, beginList, endList.
personal - se true permette di personalizzare la stampa della lista utilizzando le stringhe prese da Separators di ciascuna Sexp, oppure sep se Separators non inizializzato. Nelle chiamate ricorsive a toStringInList() viene passato la lista corrente di separatori. Se false viene utilizzata sep in ogni caso.
Returns:
la stringa rappresentativa dell'oggetto.
Overrides:
toStringInList in class TermSexp
See Also:
Sexp.Separators

accept

public void accept(SexpVisitor e)
            throws InterpreterException
Accetta un SexpVisitor.
Parameters:
e - oggetto che realizza un Pattern Visitor per le Sexp.
Overrides:
accept in class TermSexp


Codice realizzato da Francesco Geri & Marco Tamanti