|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Interpreter.Sexp.Sexp | +--Interpreter.Sexp.ConsSexp | +--Interpreter.PrologInterpreter.Sexp.TermSexp
Un oggetto TermSexp è un termine prolog, dove termine è utilizzato nella sua accezione più generale. In prolog tutto è termine. È costituito da una coppia di Sexp.
Field Summary | |
protected int |
priority
Priorità dell'operatore. |
static java.lang.String[] |
Prolog
Costante che si può utilizzare con Sexp.as(String[] separators). |
static java.lang.String[] |
PrologTerm
Costante che si può utilizzare con Sexp.as(String[] separators). |
static java.lang.String[] |
Spaces
Costante che si può utilizzare con Sexp.as(String[] separators). |
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 | |
TermSexp(Sexp functor,
Sexp args)
Costruisce una nuova TermSexp. |
Method Summary | |
void |
accept(SexpVisitor e)
Accetta un SexpVisitor. |
Sexp |
argList()
Restituisce la lista degli argomenti del termine. |
int |
argNum()
Restituisce il numero di argomenti del termine. |
Sexp |
first()
Restituisce il primo termine nella lista degli argomenti. |
Sexp |
functor()
Restituisce il funtore del termine. |
int |
getPriority()
Restituisce la priorità del'operatore. |
Sexp |
getVarList()
Restituisce la lista delle variabili del termine. |
Sexp |
second()
Restituisce il secondo termine nella lista degli argomenti. |
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. |
Sexp |
unify(Sexp term,
SexpUnifier unifier)
Unifica questo termine con term tramite l'unificatore unifier. |
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 |
Field Detail |
public static final java.lang.String[] Spaces
Sexp.Separators
public static final java.lang.String[] Prolog
Sexp.Separators
public static final java.lang.String[] PrologTerm
Sexp.Separators
protected int priority
Constructor Detail |
public TermSexp(Sexp functor, Sexp args)
functor
- funtore della termine.args
- lista degli argomenti del termine.Method Detail |
public Sexp functor()
public Sexp argList()
public Sexp first() throws InterpreterException
public Sexp second() throws InterpreterException
public int argNum()
public Sexp unify(Sexp term, SexpUnifier unifier) throws InterpreterException
term
- il termine con cui deve unificare.unifier
- l'unificatore;public int getPriority()
public Sexp getVarList() throws InterpreterException
public java.lang.String toString()
public java.lang.String toString(java.lang.String[] sep, boolean personal)
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.Sexp.Separators
public java.lang.String toStringInList(java.lang.String[] sep, boolean personal)
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.Sexp.Separators
public void accept(SexpVisitor e) throws InterpreterException
e
- oggetto che realizza un Pattern Visitor per le Sexp.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |