ParserFacade (Jython API documentation)
Date: 2022-09-10

org.python.core

## Class ParserFacade

- java.lang.Object
- - org.python.core.ParserFacade

-     public class ParserFacade
      extends java.lang.Object

  Facade for the classes in the org.python.antlr package.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static PyException` | `fixParseError(org.python.core.ParserFacade.ExpectedEncodingBufferedReader reader, java.lang.Throwable t, java.lang.String filename)`
    `static org.python.antlr.base.mod` | `parse(java.io.InputStream stream, CompileMode kind, java.lang.String filename, CompilerFlags cflags)`
    `static org.python.antlr.base.mod` | `parse(java.io.Reader reader, CompileMode kind, java.lang.String filename, CompilerFlags cflags)`
    `static org.python.antlr.base.mod` | `parse(java.lang.String string, CompileMode kind, java.lang.String filename, CompilerFlags cflags)`
    `static org.python.antlr.base.mod` | `parseExpressionOrModule(java.io.Reader reader, java.lang.String filename, CompilerFlags cflags)` Parse Python source as either an expression (if possible) or module.
    `static org.python.antlr.base.mod` | `partialParse(java.lang.String string, CompileMode kind, java.lang.String filename, CompilerFlags cflags, boolean stdprompt)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### fixParseError

          public static PyException fixParseError(org.python.core.ParserFacade.ExpectedEncodingBufferedReader reader,
                                                  java.lang.Throwable t,
                                                  java.lang.String filename)

    - #### parseExpressionOrModule

          public static org.python.antlr.base.mod parseExpressionOrModule(java.io.Reader reader,
                                                                          java.lang.String filename,
                                                                          CompilerFlags cflags)

      Parse Python source as either an expression (if possible) or module. Designed for use by a JSR 223 implementation: "the Scripting API does not distinguish between scripts which return values and those which do not, nor do they make the corresponding distinction between evaluating or executing objects." (SCR.4.2.1)

    - #### parse

          public static org.python.antlr.base.mod parse(java.io.Reader reader,
                                                        CompileMode kind,
                                                        java.lang.String filename,
                                                        CompilerFlags cflags)

    - #### parse

          public static org.python.antlr.base.mod parse(java.io.InputStream stream,
                                                        CompileMode kind,
                                                        java.lang.String filename,
                                                        CompilerFlags cflags)

    - #### parse

          public static org.python.antlr.base.mod parse(java.lang.String string,
                                                        CompileMode kind,
                                                        java.lang.String filename,
                                                        CompilerFlags cflags)

    - #### partialParse

          public static org.python.antlr.base.mod partialParse(java.lang.String string,
                                                               CompileMode kind,
                                                               java.lang.String filename,
                                                               CompilerFlags cflags,
                                                               boolean stdprompt)

Jython homepage