edu.rice.cs.drjava.project
Class ProjectFileParser

java.lang.Object
  extended by edu.rice.cs.drjava.project.ProjectFileParserFacade
      extended by edu.rice.cs.drjava.project.ProjectFileParser

public class ProjectFileParser
extends ProjectFileParserFacade

This parser uses the s-expression parser defined in the util pacakge. The SExp tree given by the parser is interpreted into a ProjectFileIR that is given to the user. This class must also deal with different versions of the project file.

If at some point new information is to be stored in the project file, the following places in the code that need to changed:

  • If the new information pertains to a document, the DocFile class should be augmented to store the new info.
  • The interface for the DocumentInfoGetter should be expanded to allow for the new data to be retrieved.
  • Add a new clause to the else-if ladder in the FilePropertyVisitor.
  • Add the new information to the DocFile form the DocumentInfoGetter in the ProjectFileBuilder's addSourceDocument method.

    If the change is at the top level, you must modify the evaluateExpression method in this parser and add the corresponding methods to the ProjectFileIR, ProjectFileIRImpl, and ProjectFileBuilder


    Field Summary
    static ProjectFileParser ONLY
              Singleton instance of ProjectFileParser
     
    Fields inherited from class edu.rice.cs.drjava.project.ProjectFileParserFacade
    _projectFile, _xmlProjectFile
     
    Method Summary
     ProjectFileIR parse(File projFile)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    ONLY

    public static final ProjectFileParser ONLY
    Singleton instance of ProjectFileParser

    Method Detail

    parse

    public ProjectFileIR parse(File projFile)
                        throws IOException,
                               FileNotFoundException,
                               MalformedProjectFileException
    Overrides:
    parse in class ProjectFileParserFacade
    Parameters:
    projFile - the file to parse
    Returns:
    the project file IR
    Throws:
    IOException
    FileNotFoundException
    MalformedProjectFileException