Package jminusminus

Class JavaCCParser

java.lang.Object
jminusminus.JavaCCParser
All Implemented Interfaces:
JavaCCParserConstants

class JavaCCParser extends Object implements JavaCCParserConstants
Parser generated by JavaCC. It parses a j-- compilation unit (program file), taking tokens from the scanner (also generated by JavaCC), and produces an abstract syntax tree (AST) for it.
  • Field Details

  • Constructor Details

    • JavaCCParser

      public JavaCCParser(InputStream stream)
      Constructor with InputStream.
    • JavaCCParser

      public JavaCCParser(InputStream stream, String encoding)
      Constructor with InputStream and supplied encoding
    • JavaCCParser

      public JavaCCParser(Reader stream)
      Constructor.
    • JavaCCParser

      public JavaCCParser(JavaCCParserTokenManager tm)
      Constructor with generated Token Manager.
  • Method Details

    • fileName

      public void fileName(String fileName)
      Sets the name of the file being parsed.
      Parameters:
      fileName - name of the file being parsed.
    • errorHasOccurred

      public boolean errorHasOccurred()
      Returns true if a parser error has occurred up to now, and false otherwise.
      Returns:
      true if a parser error has occurred up to now, and false otherwise.
    • compilationUnit

      public final JCompilationUnit compilationUnit() throws ParseException
      Throws:
      ParseException
    • ReInit

      public void ReInit(InputStream stream)
      Reinitialise.
    • ReInit

      public void ReInit(InputStream stream, String encoding)
      Reinitialise.
    • ReInit

      public void ReInit(Reader stream)
      Reinitialise.
    • ReInit

      public void ReInit(JavaCCParserTokenManager tm)
      Reinitialise.
    • getNextToken

      public final Token getNextToken()
      Get the next Token.
    • getToken

      public final Token getToken(int index)
      Get the specific Token.
    • generateParseException

      public ParseException generateParseException()
      Generate ParseException.
    • trace_enabled

      public final boolean trace_enabled()
      Trace enabled.
    • enable_tracing

      public final void enable_tracing()
      Enable tracing.
    • disable_tracing

      public final void disable_tracing()
      Disable tracing.