Interpreter.PrologInterpreter.Sexp.Infix
Class InfixSexp

java.lang.Object
  |
  +--Interpreter.Sexp.Sexp
        |
        +--Interpreter.Sexp.ConsSexp
              |
              +--Interpreter.PrologInterpreter.Sexp.TermSexp
                    |
                    +--Interpreter.PrologInterpreter.Sexp.Infix.InfixSexp
Direct Known Subclasses:
AndSexp, ClauseSexp, EqualSexp, InfixExprSexp, IsSexp, NotEqualSexp, OrSexp, RelExprSexp, TermToListSexp, UnifySexp

public class InfixSexp
extends TermSexp

Un oggetto InfixSexp è un termine costituito da un operatore infisso a due argomenti e dai suoi due argomenti.


Field Summary
 boolean dx
          Associatività a destra dell'operatore.
 boolean sx
          Associatività a sinistra dell'operatore.
 
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
InfixSexp(Sexp functor, Sexp args)
          Costruisce una nuova InfixSexp.
 
Method Summary
protected  java.lang.String choose(Sexp op, boolean ass)
          Restituisce l'operando "op" in forma di stringa.
 java.lang.String toString()
          Restituisce la rappresentazione in forma di stringa dell'InfixSexp.
 java.lang.String toString(java.lang.String[] sep, boolean personal)
          Restituisce la rappresentazione in forma di stringa.
 
Methods inherited from class Interpreter.PrologInterpreter.Sexp.TermSexp
accept, argList, argNum, first, functor, getPriority, getVarList, second, toStringInList, 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
 

Field Detail

dx

public boolean dx
Associatività a destra dell'operatore.

sx

public boolean sx
Associatività a sinistra dell'operatore.
Constructor Detail

InfixSexp

public InfixSexp(Sexp functor,
                 Sexp args)
Costruisce una nuova InfixSexp.
Parameters:
functor - funtore della termine.
args - lista degli argomenti del termine.
Method Detail

choose

protected java.lang.String choose(Sexp op,
                                  boolean ass)
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.
ass - associatività.
Returns:
l'operando in forma di stringa.

toString

public java.lang.String toString()
Restituisce la rappresentazione in forma di stringa dell'InfixSexp. La rappresentazione è quella prolog.
Returns:
la rappresentazione in forma di stringa dell'InfixSexp.
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