All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class prolog.OperatorTable

java.lang.Object
   |
   +----prolog.OperatorTable

public class OperatorTable
extends Object
The table of operator precedences.

See Also:
Operator

Constructor Index

 o OperatorTable()

Method Index

 o ()
 o delete(String, int)
Remove an operator.
 o lookup(String)
 o lookup(String, int)
Finds an operator with this symbol and that type (XFX, ...).
 o put(int, int, String)
Add an operator.
 o put(int, int, String, String)
Add an operator - the functor of the compound term will be name, rather than lexeme.
 o put(int, String, String)
Add an operator.
 o toString()
Lists all operators in this table.

Constructors

 o OperatorTable
 OperatorTable()

Methods

 o
 static void ()
 o put
 public void put(int p,
                 String type,
                 String lexeme) throws ArgumentException
Add an operator.

Parameters:
lexeme - the string representing this operator.
type - one of the associativity specifiers (XFX, ...) as a String.
p - the precedence of this operator.
Throws: ArgumentException
on invalid precedence.
See Also:
Operator, op_3
 o put
 void put(int p,
          int type,
          String lexeme) throws ArgumentException
Add an operator. No translation performed - the name of this operator is the same as it's lexical representation.

Parameters:
lexeme - the string representing this operator.
type - one of the associativity specifiers (XFX, ...).
p - the precedence of this operator.
Throws: ArgumentException
on invalid precedence.
See Also:
Operator
 o put
 void put(int p,
          int type,
          String lexeme,
          String name) throws ArgumentException
Add an operator - the functor of the compound term will be name, rather than lexeme.

Parameters:
lexeme - the string representing this operator.
name - the functor of the compound built to describe this term.
type - one of the associativity specifiers (XFX, ...).
p - the precedence of this operator.
Throws: ArgumentException
on invalid precedence.
See Also:
Operator
 o lookup
 Operator lookup(String lexeme,
                 int type)
Finds an operator with this symbol and that type (XFX, ...).

Parameters:
type - one of the associativity specifiers (XFX, ...).
See Also:
Operator
 o lookup
 Operator lookup(String lexeme)
 o delete
 void delete(String lexeme,
             int type)
Remove an operator.

 o toString
 public String toString()
Lists all operators in this table.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index