Author: rafael
Date: 2005-03-25 10:22:30 -0500 (Fri, 25 Mar 2005)
New Revision: 42249
Modified:
trunk/mcs/mbas/ChangeLog
trunk/mcs/mbas/genericparser.cs
Log:
2005-03-25 Rafael Teixeira <[EMAIL PROTECTED]>
* genericparser.cs: another Parse overload to support specifying
encoding when parsing from a file.
Preparing to implement support for a /codepage option similar to mcs
Modified: trunk/mcs/mbas/ChangeLog
===================================================================
--- trunk/mcs/mbas/ChangeLog 2005-03-25 11:37:19 UTC (rev 42248)
+++ trunk/mcs/mbas/ChangeLog 2005-03-25 15:22:30 UTC (rev 42249)
@@ -1,3 +1,7 @@
+2005-03-25 Rafael Teixeira <[EMAIL PROTECTED]>
+ * genericparser.cs: another Parse overload to support specifying
encoding when parsing from a file.
+ Preparing to implement support for a /codepage option similar to mcs
+
2005-03-24 Manjula GHM <[EMAIL PROTECTED]>
* mb-tokenizer.cs: To fix parser error for ExternalSource Directives
@@ -19,8 +23,7 @@
2005-03-24 Manjula GHM <[EMAIL PROTECTED]>
* statement.cs: Fix bug in 'Exit Function'
-
-2005-23-03 Rafael Teixeira <[EMAIL PROTECTED]>
+2005-03-23 Rafael Teixeira <[EMAIL PROTECTED]>
* AssemblyInfo.cs: Some more diligent authors
* ecore.cs, cfold.cs, delegate.cs: remove warnings-causing code
Modified: trunk/mcs/mbas/genericparser.cs
===================================================================
--- trunk/mcs/mbas/genericparser.cs 2005-03-25 11:37:19 UTC (rev 42248)
+++ trunk/mcs/mbas/genericparser.cs 2005-03-25 15:22:30 UTC (rev 42249)
@@ -13,7 +13,8 @@
using System;
using System.Reflection;
using System.Collections;
- using System.IO;
+ using System.IO;
+ using System.Text;
using Mono.MonoBASIC;
/// <summary>
@@ -78,7 +79,6 @@
/// Initializes this parser from a file and parses it
/// </summary>
/// <param name="fileName">Name of the file to be parsed</param>
- /// <param name="context">Context to output the parsed
tree</param>
public int ParseFile(string fileName)
{
// file exceptions must be caught by caller
@@ -94,11 +94,28 @@
}
/// <summary>
+ /// Initializes this parser from a file and parses it
+ /// </summary>
+ /// <param name="fileName">Name of the file to be parsed</param>
+ /// <param name="encoding">Specific encoding to use in
parsing</param>
+ public int ParseFile(string fileName, Encoding encoding)
+ {
+ // file exceptions must be caught by caller
+
+ global_errors = 0;
+ name = fileName;
+ // TODO: Encoding switching as needed
+ // We are here forcing StreamReader to assume an
specific encoding
+ input = new StreamReader(fileName, encoding);
+ //rc = context;
+ return parse();
+ }
+
+ /// <summary>
/// Initializes this parser from a string and parses it
/// </summary>
/// <param name="source">String to be parsed</param>
/// <param name="sourceName">Name of the source to be parsed
(just for error reporting)</param>
- /// <param name="context">Context to output the parsed
tree</param>
public int ParseString(string source, string sourceName)
{
global_errors = 0;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches