[Mono-list] Re: none

A Rafael D Teixeira rafaelteixeirabr@hotmail.com
Mon, 03 Sep 2001 18:55:36 -0300


This is a multi-part message in MIME format.

------=_NextPart_000_537f_117a_21eb
Content-Type: text/plain; format=flowed

>From: Miguel de Icaza <miguel@ximian.com>

>Well, the problem is that `skeleton.cs' and the interfaces yyDebug and
>yyParse really belong to the parser generator and not really to the
>specifics of the compiler.
>
>We should keep those abstract interfaces as part of Jay, can you
>rework your patch to keep those in skeleton.cs?

Done, but now they are in namespaces INSIDE the parser-defining namespace. 
DonŽt worry, no changes to your code in this regard.

The diff files (with -u now) and the shorter genericparser.cs are attached. 
The diffs are based on snapshot mono-snapshot-31-Aug-01.tar.gz files.

Please change the makefile: just add genericparser.cs to COMMON_SOURCES.

>You are indeed behind a horrible, horrible
>firewall.  What can I do to make your life easier?

As long as you keep descending from Mono.Languages.GenericParser, we can 
work independently, for some time.

MonoBASIC objects will live now on a more sensible namespace: 
Mono.Languages.MonoBASIC.

Can you check out, VERBALLY, driver.cs to me, IŽll try to make it enumerate 
all descendants of GenericParser compiled in the assembly, and, using the 
virtual method 'extensions', map extensions to parsers.

Rafael Teixeira
Brazilian Developer





_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

------=_NextPart_000_537f_117a_21eb
Content-Type: text/plain; name="genericparser.cs"; format=flowed
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="genericparser.cs"

//
// GenericParser.cs: The Base Parser for the Mono compilers
//
// Author: A Rafael D Teixeira (rafaelteixeirabr@hotmail.com)
//
// Licensed under the terms of the GNU GPL
//
// Copyright (C) 2001 A Rafael D Teixeira
//
using System;
using System.Text;

namespace Mono.Languages
{
	using System.Collections;

	/// <summary>
	/// Base class to support multiple Jay generated parsers
	/// </summary>
	public abstract class GenericParser
	{
		static protected int global_errors;

		// Name of the file we are parsing
		public string name;

		// Input stream to parse from.
		public System.IO.Stream input;

		public abstract int parse ();

		public virtual string[] extensions()
		{
			string [] list = { ".cs" };
			return list;
		}

		/// <summary>
		/// Emits error messages and increments a global count of them
		/// </summary>
		/// <param name="code"></param>
		/// <param name="desc"></param>
		static public void error (int code, string desc)
		{
			Console.WriteLine ("Error "+code+": "+ desc);
			global_errors++;
		}

		public GenericParser()
		{
			//
			// DO NOTHING: Derived classes should do their iniatilization here duties
			//
		}

		protected bool yacc_verbose_flag = false;

		public bool yacc_verbose
		{
			set
			{
				yacc_verbose_flag = value;
			}

			get
			{
				return yacc_verbose_flag;
			}
		}
	}
}



------=_NextPart_000_537f_117a_21eb
Content-Type: application/octet-stream; name="skeleton.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="skeleton.diff"

LS0tIGpheS9za2VsZXRvbi5jcwlTYXQgSnVsIDE0IDIwOjMwOjQwIDIwMDEK
KysrIGpheS1SYWZhZWwvc2tlbGV0b24uY3MJTW9uIFNlcCAgMyAxNzo1ODoz
NSAyMDAxCkBAIC0zNDksMyArMzQ5LDQgQEAKIC4gICAgT2JqZWN0IHZhbHVl
ICgpOwogLiAgfQogLiB9CisufSAvLyBjbG9zZSBvdXRlcm1vc3QgbmFtZXNw
YWNlLCB0aGF0IE1VU1QgSEFWRSBCRUVOIG9wZW5lZCBpbiB0aGUgcHJvbG9n
Cg==


------=_NextPart_000_537f_117a_21eb
Content-Type: application/octet-stream; name="cs-parser.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="cs-parser.diff"

LS0tIG1jcy9jcy1wYXJzZXIuamF5CUZyaSBBdWcgMzEgMDA6MzU6MTAgMjAw
MQorKysgbWNzLVJhZmFlbC9jcy1wYXJzZXIuamF5CU1vbiBTZXAgIDMgMTc6
NTg6NDEgMjAwMQpAQCAtMzAsMTMgKzMwLDEyIEBACiBuYW1lc3BhY2UgQ0lS
DQogew0KIAl1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnM7DQorCXVzaW5nIE1v
bm8uTGFuZ3VhZ2VzOw0KIA0KIAkvLy8gPHN1bW1hcnk+DQogCS8vLy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