All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class PrologParse.Term

java.lang.Object
   |
   +----PrologParse.Term

public class Term
extends Object
A class that represents a Term in prolog. A Term is represented by a type int, a string that represents the name/text of the term, and a Vector of subterms.

See Also:
Clause

Variable Index

 o CUT
 o FUNC
 o LIST
 o NUM
 o OP
 o VAR

Constructor Index

 o Term(String, int)
Constructor for constants or variables.
 o Term(String, int, Vector, int)
Most General constructor.
 o Term(String, Vector)
Constructor for functions (atoms).
 o Term(Vector)
Constructs a Term by parsing some tokens.

Method Index

 o functionArity()
 o isList()
 o isVariable()
 o name()
 o subterms()
 o symbol()
 o toString()

Variables

 o FUNC
 public static final int FUNC
 o VAR
 public static final int VAR
 o NUM
 public static final int NUM
 o OP
 public static final int OP
 o LIST
 public static final int LIST
 o CUT
 public static final int CUT

Constructors

 o Term
 public Term(String name,
             int type,
             Vector subterms,
             int precedence)
Most General constructor.

Parameters:
name - The text part of the Term.
type - The type of the Term (variable, function symbol, etc).
subterms - The subterms of the Term.
 o Term
 public Term(String name,
             int type)
Constructor for constants or variables. Constructs a Term with no subterms of the specified type.

Parameters:
name - The text part of the Term.
type - The type of the Term (variable, function symbol, etc).
 o Term
 public Term(String name,
             Vector Subterms)
Constructor for functions (atoms). Constructs a Term with specified subterms of type Term.FUNC.

Parameters:
name - The text part of the Term.
subterms - The subterms of the Term.
 o Term
 public Term(Vector ts)
Constructs a Term by parsing some tokens.

Parameters:
ts - A Vector of Tokens, as produced by a PrologTokenizer.
See Also:
PrologTokenizer, Token

Methods

 o functionArity
 public final int functionArity()
 o subterms
 public final Vector subterms()
 o isVariable
 public final boolean isVariable()
 o isList
 public final boolean isList()
 o name
 public final String name()
 o symbol
 public final String symbol()
 o toString
 public final String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index