|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectubc.cs.JLog.Parser.pPredicateEntry
public abstract class pPredicateEntry
Abstract base class for entries in the pPredicateRegistry. Each
predicate entry subclass represents a type of prolog predicate at the
level needed for the parser (they are parse time representations).
Predicate entries contain information about the corresponding predicate, such
as name and arity.
Predicate entries generate the corresponding real Prolog predicate
objects.
| Field Summary | |
|---|---|
protected int |
arity
|
protected String |
library
|
protected String |
name
|
static int |
NARY_ARITY
|
| Constructor Summary | |
|---|---|
pPredicateEntry(String name,
int arity)
|
|
| Method Summary | |
|---|---|
iPredicate |
createPredicate()
Public interface for generating the real prolog term objects. |
abstract iPredicate |
createPredicate(jCompoundTerm cterm)
The internal method for creating the iPredicate representation of this
predicate representation. |
iPredicate |
createPredicate(ubc.cs.JLog.Parser.pToken pt,
jCompoundTerm cterm)
Public interface for generating the real prolog term objects. |
int |
getArity()
Returns the arity of this instance. |
String |
getLibrary()
Get the name of the library associated with this predicate. |
String |
getName()
Returns the name of this instance. |
boolean |
isArity(int a)
Tests the arity of this entry. |
boolean |
sameLibrary(String lib)
|
void |
setLibrary(String lib)
Set the name of the library associated with this predicate. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NARY_ARITY
protected String name
protected int arity
protected String library
| Constructor Detail |
|---|
public pPredicateEntry(String name,
int arity)
| Method Detail |
|---|
public String getName()
iName
getName in interface iNameString containing name of this instance.public int getArity()
iNameArity
getArity in interface iNameArityint whose value is the arity of this instance.public boolean isArity(int a)
a - The arity to test this entry for.
boolean which is true if entry can be of this arity.public void setLibrary(String lib)
InvalidLibraryEntryException in this case).
Predicates default to a null valued library.
lib - The name of the library.public String getLibrary()
null.public boolean sameLibrary(String lib)
public iPredicate createPredicate(ubc.cs.JLog.Parser.pToken pt,
jCompoundTerm cterm)
createPredicate to perform actual construction of term.
pt - The parsing token representing the operator. Used for generating
information about the location of the operator in the input stream.cterm - A terms belonging to this predicate.
iPredicat representing this predicate and its terms.public iPredicate createPredicate()
createPredicate to perform actual construction of term.
iPredicat representing this predicate with given arity,
with unamed variables for terms.public abstract iPredicate createPredicate(jCompoundTerm cterm)
iPredicate representation of this
predicate representation. Subclasses must override. The terms are provided, already created.
The caller is responsible to ensure that arity and cterm.size match.
cterm - The collection of jTerms.
iPredicate representing this predicate and its terms.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||