Class Parser

java.lang.Object
com.spertus.jacquard.syntaxgrader.Parser

public class Parser extends Object
A wrapper for JavaParser.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The maximum level of Java currently supported through this class.
    static final int
    The minimum level of Java supported through this class.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a parser for the Java language level specified in Autograder.javaLevel.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.github.javaparser.ast.CompilationUnit
    parse(File file)
    Parses a file.

    Methods inherited from class java.lang.Object

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

    • MIN_JAVA_LEVEL

      public static final int MIN_JAVA_LEVEL
      The minimum level of Java supported through this class.
      See Also:
    • MAX_JAVA_LEVEL

      public static final int MAX_JAVA_LEVEL
      The maximum level of Java currently supported through this class. Preview versions are not supported.
      See Also:
  • Constructor Details

  • Method Details

    • parse

      public com.github.javaparser.ast.CompilationUnit parse(File file) throws SubmissionException
      Parses a file.
      Parameters:
      file - the file
      Returns:
      the parsed representation
      Throws:
      SubmissionException - if the file cannot be found or cannot be parsed