/// <summary> /// Build a parse tree from a given source_reader /// </summary> /// /// <remarks> /// return an AST representing the parsed program. /// If the parse fails, null will be returned. /// </remarks> internal AST Parse(StreamReader source_reader, string source_location, int line_number) { ts = new TokenStream (source_reader, null, source_location, line_number); return Parse (); }
/// <summary> /// Build a parse tree from a given source_string /// </summary> /// /// <remarks> /// return an ScriptBlock representing the parsed program /// that corresponds to a source file. /// If the parse fails, null will be returned. /// </remarks> internal ScriptBlock Parse(string source_string, string source_location, int line_number) { ts = new TokenStream (null, source_string, source_location, line_number); try { return Parse (); } catch (IOException) { throw new Exception ("Illegal state exception"); } }