All Packages Class Hierarchy This Package Previous Next Index
Class pointer.Pointer
java.lang.Object
|
+----pointer.Pointer
- public abstract class Pointer
- extends Object
- implements Parsable
A Pointer is an object that contains just a single public variable, val.
Since that variable can be changed, it acts like a pointer to the
variable in languages such as C.
This code is (c) 1996 Leemon Baird
<leemon@cs.cmu.edu>,
http://www.cs.cmu.edu/~baird
The source and object code may be redistributed freely.
If the code is modified, please state so in the comments.
- Version:
- 1.2, 23 May 97
- Author:
- Leemon Baird
-
Pointer()
-
-
BNF(int)
-
-
clone()
- Create a new object of the same type with the same value
-
copyInto(Pointer)
- Copy the value of this object into another of the same type
-
equalVal(Pointer)
- Does this pointer and the other have the same value?
Different types , such as (int)3 and (long)3
are defined to have different values.
-
getParameters(int)
- Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.
-
initialize(int)
- Initialize, either partially or completely.
-
parse(Parser, int)
- Parse the input file to get the parameters for this object.
-
toDouble()
- If a pointer to a numeric type, convert the .val field to a double,
else just return 0.
-
unparse(Unparser, int)
- Output a description of this object that can be parsed with parse().
Pointer
public Pointer()
clone
public abstract Object clone()
- Create a new object of the same type with the same value
- Overrides:
- clone in class Object
copyInto
public abstract void copyInto(Pointer obj)
- Copy the value of this object into another of the same type
toDouble
public abstract double toDouble()
- If a pointer to a numeric type, convert the .val field to a double,
else just return 0.
equalVal
public abstract boolean equalVal(Pointer obj)
- Does this pointer and the other have the same value?
Different types , such as (int)3 and (long)3
are defined to have different values.
getParameters
public Object[][] getParameters(int lang)
- Return a parameter array if BNF(), parse(), and unparse() are to be automated, null otherwise.
- See Also:
- getParameters
BNF
public String BNF(int lang)
unparse
public void unparse(Unparser u,
int lang)
- Output a description of this object that can be parsed with parse().
parse
public Object parse(Parser p,
int lang) throws ParserException
- Parse the input file to get the parameters for this object.
- Throws: ParserException
- parser didn't find the required token
initialize
public void initialize(int level)
- Initialize, either partially or completely.
- See Also:
- initialize
All Packages Class Hierarchy This Package Previous Next Index