code.loader.parser
Class XMLParser

java.lang.Object
  extended by code.loader.parser.XMLParser
All Implemented Interfaces:
ModuleParser

public class XMLParser
extends java.lang.Object
implements ModuleParser

This is an old XML parser. It is now (7/28/04) broken and obsolete. Change constructor here to raise an exception if an attempt is made to load XML file.

Since:
February 5, 2003
Author:
Xu Shen

Field Summary
private  java.util.Vector allSymbols
           
private  org.w3c.dom.Document document
           
private  java.util.Vector imports
           
private  java.io.BufferedReader in
           
private  java.util.Date modifiedDate
           
private  java.lang.String moduleName
           
private  int timestamp
           
 
Constructor Summary
XMLParser()
           
 
Method Summary
 java.util.Vector getAllSymbols()
          Gets the allSymbols attribute of the ModuleParser object
 java.util.Vector getImported()
          Gets the imported attribute of the ModuleParser object
 java.lang.String getSource()
           
 int getTimestamp()
          Gets the module's timestamp
 void initParser(java.io.BufferedReader in)
          Stub that should be filled in at later date.
 boolean isCompiled()
          Gets the compiled attribute of the ModuleParser object
 java.lang.String moduleName()
          Gets the moduleNmae attribute of the ModuleParser object.
 void parse(java.io.BufferedReader in)
          Parse the source from the BufferedReader
private  void parseConstructors()
           
private  void parseDocument()
           
private  void parseImports()
           
private  void parseLastModDate()
           
private  void parseModuleName()
           
private  TypeExpression parseNonFunctionTypeExpression(org.w3c.dom.Element nonFunctionTypeExpression)
           
private  void parseOperations()
           
private  TypeExpression parseSignature(org.w3c.dom.Element signatureElement)
          Description of the Method
private  void parseSymbols()
           
private  TypeExpression parseTypeExpression(org.w3c.dom.Element typeExpressionElement)
           
private  void parseTypes()
           
private  void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

document

private org.w3c.dom.Document document

moduleName

private java.lang.String moduleName

imports

private java.util.Vector imports

allSymbols

private java.util.Vector allSymbols

modifiedDate

private java.util.Date modifiedDate

timestamp

private int timestamp

in

private java.io.BufferedReader in
Constructor Detail

XMLParser

public XMLParser()
Method Detail

parse

public void parse(java.io.BufferedReader in)
Description copied from interface: ModuleParser
Parse the source from the BufferedReader

Specified by:
parse in interface ModuleParser
Parameters:
in - input to the parser

reset

private void reset()

getImported

public java.util.Vector getImported()
Description copied from interface: ModuleParser
Gets the imported attribute of the ModuleParser object

Specified by:
getImported in interface ModuleParser
Returns:
The imported value

getAllSymbols

public java.util.Vector getAllSymbols()
Description copied from interface: ModuleParser
Gets the allSymbols attribute of the ModuleParser object

Specified by:
getAllSymbols in interface ModuleParser
Returns:
The allSymbols value

getTimestamp

public int getTimestamp()
Description copied from interface: ModuleParser
Gets the module's timestamp

Specified by:
getTimestamp in interface ModuleParser
Returns:
The moduleName

isCompiled

public boolean isCompiled()
Description copied from interface: ModuleParser
Gets the compiled attribute of the ModuleParser object

Specified by:
isCompiled in interface ModuleParser
Returns:
The compiled value

getSource

public java.lang.String getSource()

moduleName

public java.lang.String moduleName()
Description copied from interface: ModuleParser
Gets the moduleNmae attribute of the ModuleParser object.

Specified by:
moduleName in interface ModuleParser
Returns:
The moduleName

parseDocument

private void parseDocument()

parseModuleName

private void parseModuleName()
                      throws java.lang.Exception
Throws:
java.lang.Exception

parseLastModDate

private void parseLastModDate()

parseImports

private void parseImports()

parseSymbols

private void parseSymbols()
                   throws java.lang.Exception
Throws:
java.lang.Exception

parseTypes

private void parseTypes()
                 throws java.lang.Exception
Throws:
java.lang.Exception

parseConstructors

private void parseConstructors()
                        throws java.lang.Exception
Throws:
java.lang.Exception

parseOperations

private void parseOperations()
                      throws java.lang.Exception
Throws:
java.lang.Exception

parseSignature

private TypeExpression parseSignature(org.w3c.dom.Element signatureElement)
                               throws java.lang.Exception
Description of the Method

Parameters:
signatureElement - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.lang.Exception - Description of the Exception

parseTypeExpression

private TypeExpression parseTypeExpression(org.w3c.dom.Element typeExpressionElement)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

parseNonFunctionTypeExpression

private TypeExpression parseNonFunctionTypeExpression(org.w3c.dom.Element nonFunctionTypeExpression)
                                               throws java.lang.Exception
Throws:
java.lang.Exception

initParser

public void initParser(java.io.BufferedReader in)
Stub that should be filled in at later date.

Specified by:
initParser in interface ModuleParser
Parameters:
in - Reader that is prepared to read in module file's contents.