Click here to Skip to main content
15,889,176 members
Articles / Programming Languages / C#

Irony - .NET Compiler Construction Kit

Rate me:
Please Sign up or sign in to vote.
4.97/5 (86 votes)
4 Jan 2008MIT19 min read 294.7K   3.2K   201  
Introduction to Irony - a new technology of parser/compiler construction for .NET.
#region License
/* **********************************************************************************
 * Copyright (c) Roman Ivantsov
 * This source code is subject to terms and conditions of the MIT License
 * for Irony. A copy of the license can be found in the License.txt file
 * at the root of this distribution. 
 * By using this source code in any fashion, you are agreeing to be bound by the terms of the 
 * MIT License.
 * You must not remove this notice from this software.
 * **********************************************************************************/
#endregion

using System;
using System.Collections.Generic;
using System.Text;

namespace Irony {
  //Some common classes

  public class StringList : List<string> { }
  public class StringDictionary : Dictionary<string, string> { }

  //string list with no duplicates
  public class KeyList : List<string> {
    //overwrite Add and AddRange to disallow repetitions
    public new void Add(string key) {
      if (!Contains(key))
        base.Add(key);
    }

    public new void AddRange(IEnumerable<string> keys) {
      foreach (string key in keys)
        this.Add(key);
    }
    public override string ToString() {
      return ToString(" ");
    }
    public string ToString(string separator) {
      string[] arr = new string[this.Count];
      this.CopyTo(arr);
      return string.Join(separator, arr);
    }
  }//KeyList class


}

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 MIT License


Written By
Software Developer (Senior) Microsoft
United States United States
25 years of professional experience. .NET/c#, databases, security.
Currently Senior Security Engineer, Cloud Security, Microsoft

Comments and Discussions