|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.neu.ccs.parser.AbstractParser.Procedure
Class encapsulating a procedure
and its corresponding String symbol
for use with a parser.
Parser| Field Summary | |
int |
arguments
The number of arguments expected by this procedure. |
String |
name
The name representing this procedure. |
| Constructor Summary | |
AbstractParser.Procedure(String name,
int arguments)
Constructs a procedure with the given identifier and number of expected arguments. |
|
| Method Summary | |
protected void |
checkArgs(Object[] args)
Throws a ParseExpection if either the args are null or the length of args is not equal to arguments. |
protected void |
checkArgsAsNumeric(Object[] args)
Throws a ParseExpection if either the args are null or the length of args is not equal to arguments or the elements in args are not of type XNumber. |
abstract Object |
procedureCall(Object[] args)
Applies this procedure using the provided array of argument values and returns the result. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public String name
public int arguments
| Constructor Detail |
public AbstractParser.Procedure(String name,
int arguments)
arguments - the expected number of arguments| Method Detail |
public abstract Object procedureCall(Object[] args)
throws ParseException
args - the array of argument values
ParseException
protected void checkArgs(Object[] args)
throws ParseException
checkArgsAsNumeric.
args - the array of argument values
ParseExceptioncheckArgsAsNumeric(Object[])
protected void checkArgsAsNumeric(Object[] args)
throws ParseException
args - the array of argument values
ParseExceptioncheckArgs(Object[])
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||