Class node

java.lang.Object
be.gaudry.model.file.node

class node extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    (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

    Constructors
    Constructor
    Description
    node​(String pline)
    Construct a new symbol table node and fill in its fields.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static node
    addSymbol​(String pline, boolean inoldfile, int linenum)
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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

      static node matchsymbol(String pline)
      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

      static node addSymbol(String pline, boolean inoldfile, int linenum)
      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.