Interpreter.PrologInterpreter.Sexp.Terms
Class ListSexp

java.lang.Object
  |
  +--Interpreter.Sexp.Sexp
        |
        +--Interpreter.Sexp.ConsSexp
              |
              +--Interpreter.PrologInterpreter.Sexp.TermSexp
                    |
                    +--Interpreter.PrologInterpreter.Sexp.Terms.ListSexp

public class ListSexp
extends TermSexp

Un oggetto ListSexp è una lista Prolog.


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
ListSexp(Sexp args)
          Costruisce una nuova ListSexp.
 
Method Summary
 void accept(SexpVisitor e)
          Accetta un SexpVisitor per la valutazione.
 ArgsSexp toArgsSexp()
          Restituisce gli elemnti della lista Prolog sottoforma di oggetto ArgsSexp.
 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

ListSexp

public ListSexp(Sexp args)
Costruisce una nuova ListSexp.
Parameters:
args - lista degli argomenti del termine lista.
Method Detail

toArgsSexp

public ArgsSexp toArgsSexp()
                    throws InterpreterException
Restituisce gli elemnti della lista Prolog sottoforma di oggetto ArgsSexp.
Returns:
gli elemnti della lista Prolog sottoforma di oggetto ArgsSexp.

toString

public java.lang.String toString()
Restituisce la rappresentazione in forma di stringa.
Returns:
la stringa rappresentativa dell'oggetto: una lista in formato lisp.
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 per la valutazione.
Parameters:
e - oggetto che realizza un Pattern Visitor per le Sexp.
Overrides:
accept in class TermSexp


Codice realizzato da Francesco Geri & Marco Tamanti