2. Parsing and Tokenizing

IronPython

2. Parsing and Tokenizing

Parser CreateParser(CompilerContext context, PythonOptions options)
Creates a new parser using the given compiler context and options.
PythonAst ParseFile(bool makeModule)
PythonAst ParseFile(bool makeModule, bool returnValue)
PythonAst ParseInteractiveCode(out ScriptCodeParseResult properties)

Parse one or more lines of interactive input

Returns null if input is not yet valid but could be with more lines

PythonAst ParseSingleStatement()
PythonAst ParseTopExpression()
static int GetNextAutoIndentSize(string text, int autoIndentTabWidth)
Given the interactive text input for a compound statement, calculate what the indentation level of the next line should be
ErrorSink ErrorSink { get; set; }
ParserSink ParserSink { get; set; }
public int ErrorCode { get; }
void Reset(SourceUnit sourceUnit, ModuleOptions languageFeatures)
void Reset()
void Dispose()