|
|||||||||
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 java.lang.String |
library
|
protected java.lang.String |
name
|
static int |
NARY_ARITY
|
Constructor Summary | |
---|---|
pPredicateEntry(java.lang.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. |
java.lang.String |
getLibrary()
Get the name of the library associated with this predicate. |
java.lang.String |
getName()
Returns the name of this instance. |
boolean |
isArity(int a)
Tests the arity of this entry. |
boolean |
sameLibrary(java.lang.String lib)
|
void |
setLibrary(java.lang.String lib)
Set the name of the library associated with this predicate. |
java.lang.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 java.lang.String name
protected int arity
protected java.lang.String library
Constructor Detail |
---|
public pPredicateEntry(java.lang.String name, int arity)
Method Detail |
---|
public java.lang.String getName()
iName
getName
in interface iName
String
containing name of this instance.public int getArity()
iNameArity
getArity
in interface iNameArity
int
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(java.lang.String lib)
InvalidLibraryEntryException
in this case).
Predicates default to a null
valued library.
lib
- The name of the library.public java.lang.String getLibrary()
null
.public boolean sameLibrary(java.lang.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 jTerm
s.
iPredicate
representing this predicate and its terms.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |