Interpreter.PrologInterpreter.Sexp.Prefix
Class PrefixSexp
java.lang.Object
|
+--Interpreter.Sexp.Sexp
|
+--Interpreter.Sexp.ConsSexp
|
+--Interpreter.PrologInterpreter.Sexp.TermSexp
|
+--Interpreter.PrologInterpreter.Sexp.Prefix.PrefixSexp
- Direct Known Subclasses:
- NotSexp, PrefixExprSexp, QuerySexp
- public class PrefixSexp
- extends TermSexp
Un oggetto PrefixSexp è un termine costituito da un operatore infisso a due argomenti
e dai suoi due argomenti.
Field Summary |
boolean |
dx
Associatività a sinistra dell'operatore. |
Method Summary |
protected java.lang.String |
choose(Sexp op)
Restituisce l'operando "op" in forma di stringa.
|
java.lang.String |
toString()
Restituisce la rappresentazione in forma di stringa dell'PrefixSexp.
|
java.lang.String |
toString(java.lang.String[] sep,
boolean personal)
Restituisce la rappresentazione in forma di stringa. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
dx
public boolean dx
- Associatività a sinistra dell'operatore.
PrefixSexp
public PrefixSexp(Sexp functor,
Sexp args)
- Costruisce una nuova PrefixSexp.
- Parameters:
functor
- funtore della termine.args
- lista degli argomenti del termine.
choose
protected java.lang.String choose(Sexp op)
- Restituisce l'operando "op" in forma di stringa.
Se l'operando ha priorità maggiore o se ha priorità uguale e questo oggetto
non è associativo mette le parentesi.
- Parameters:
op
- operando.
toString
public java.lang.String toString()
- Restituisce la rappresentazione in forma di stringa dell'PrefixSexp.
La rappresentazione è quella prolog.
- Returns:
- la rappresentazione in forma di stringa dell'PrefixSexp.
- 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
Codice realizzato da Francesco Geri & Marco Tamanti