Esempio n. 1
0
 /// <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 ();
 }
Esempio n. 2
0
 /// <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");
     }
 }