Package be.gaudry.model.file
Class node
java.lang.Object
be.gaudry.model.file.node
Class "node". The symbol table routines in this class all
understand the symbol table format, which is a binary tree.
The methods are: addSymbol, symbolIsUnique, showSymbol.
-
Field Summary
Modifier and TypeFieldDescription(package private) static int
(package private) static int
(package private) String
(package private) int
(package private) int
(package private) static int
(package private) static int
(package private) static int
(package private) static node
(package private) node
(package private) node
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) static node
addSymbol(String pline) - Saves line into the symbol table.(package private) static node
matchsymbol(String pline)
matchsymbol Searches tree for a match to the line.(package private) void
showSymbol Prints the line to stdout.(package private) boolean
symbolIsUnique Arg is a ptr previously returned by addSymbol.
-
Field Details
-
pleft
node pleft -
pright
node pright -
linenum
int linenum -
freshnode
static final int freshnode- See Also:
- Constant Field Values
-
oldonce
static final int oldonce- See Also:
- Constant Field Values
-
newonce
static final int newonce- See Also:
- Constant Field Values
-
bothonce
static final int bothonce- See Also:
- Constant Field Values
-
other
static final int other- See Also:
- Constant Field Values
-
linestate
int linestate -
line
String line -
panchor
-
-
Constructor Details
-
node
node(String pline)Construct a new symbol table node and fill in its fields.- Parameters:
pline
- A line of the text file
-
-
Method Details
-
matchsymbol
matchsymbol Searches tree for a match to the line.- Parameters:
pline
- a line of text If node's linestate == freshnode, then created the node.
-
addSymbol
addSymbol(String pline) - Saves line into the symbol table. Returns a handle to the symtab entry for that unique line. If inoldfile nonzero, then linenum is remembered. -
symbolIsUnique
boolean symbolIsUnique()symbolIsUnique Arg is a ptr previously returned by addSymbol. -------------- Returns true if the line was added to the symbol table exactly once with inoldfile true, and exactly once with inoldfile false. -
showSymbol
void showSymbol()showSymbol Prints the line to stdout.
-