private void updateSymbolTable(File file, Hashtable symbols, Hashtable functions) throws ProgramException {
        BufferedReader reader = null;

        try {
            reader = new BufferedReader(new FileReader(file.getAbsolutePath()));
        } catch (FileNotFoundException fnfe) {
            throw new ProgramException("file " + file.getName() + " does not exist");
        }

        String line;
        String currentFunction = null;
        String label;
        int lineNumber = 0;

		isSlashStar = false;
        try {
            while ((line = unCommentLine(reader.readLine())) != null) {
                lineNumber++;
                if (!line.trim().equals("")) {
                    if (line.startsWith("function ")) {
                        StringTokenizer tokenizer = new StringTokenizer(line);
                        tokenizer.nextToken();
                        currentFunction = tokenizer.nextToken();
                        if (symbols.containsKey(currentFunction))
                            throw new ProgramException("subroutine " + currentFunction +
                                                       " already exists");
                        functions.put(currentFunction, new Short(nextPC));
                        symbols.put(currentFunction, new Short(nextPC));
                    }
                    else if (line.startsWith("label ")) {
                        StringTokenizer tokenizer = new StringTokenizer(line);
                        tokenizer.nextToken();
                        label = currentFunction + "$" + tokenizer.nextToken();
                        symbols.put(label, new Short((short)(nextPC + 1)));
                    }

                    nextPC++;
                }
            }
            reader.close();
        } catch (IOException ioe) {
            throw new ProgramException("Error while reading from file");
        } catch (NoSuchElementException nsee) {
            throw new ProgramException("In line " + lineNumber + ": unexpected end of command");
        }
		if (isSlashStar) {
			throw new ProgramException("Unterminated /* comment at end of file");
		}
    }