Click here to Skip to main content
15,894,720 members
Articles / Containers / Virtual Machine

Parsing Expression Grammar Support for C# 3.0 Part 1 - PEG Lib and Parser Generator

Rate me:
Please Sign up or sign in to vote.
4.95/5 (49 votes)
7 Oct 2008CPOL40 min read 204.7K   2.1K   118  
Introduction to the parsing method PEG with library and parser generator
public delegate void EventHandler(object sender, EventArgs e);
public class Button: Control
{
	public event EventHandler Click;
}
public class LoginDialog: Form
{
	Button OkButton;
	Button CancelButton;
	public LoginDialog() {
		OkButton = new Button( );
		OkButton.Click += new EventHandler(OkButtonClick);
		CancelButton = new Button( );
		CancelButton.Click += new EventHandler(CancelButtonClick);
	}
	void OkButtonClick(object sender, EventArgs e) {
		// Handle OkButton.Click event
	}
	void CancelButtonClick(object sender, EventArgs e) {
		// Handle CancelButton.Click event
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Switzerland Switzerland
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions