Click here to Skip to main content
12,510,594 members (46,184 online)
Click here to Skip to main content

Stats

122.9K views
5.7K downloads
113 bookmarked
Posted

An Implementation of Regular Expression Parser in C#

, 24 Jun 2009 CPOL
An article on how one can implement regular expression parser
LexAnal3_regexpr2nfa.pdf
LexAnal4_nfa2dfa.pdf
LexAnal5_minimaldfa.pdf
RegExDemo
Driver
MatchInfoDS.xsc
MatchInfoDS.xss
Properties
RegExImpl.suo
RegularExpression
FsaDS.xsc
FsaDS.xss
Properties
RegExSource
RegularExpression
FsaDS.xsc
FsaDS.xss
Properties
RegularExpression.dll
Driver.exe
RegularExpression
Properties
Driver
MatchInfoDS.xsc
MatchInfoDS.xss
Properties
using System;
using System.Collections.Generic;
using System.Text;

namespace RegularExpression
{
  /// <summary>
  /// see NfaDiagram.txt file.
  /// this class represent a box in that diagram.
  /// this class helps constructing the NFA from the regular expression
  /// </summary>
  class NfaExpression
  {
    public NfaExpression()
    {
      m_stateStart = new State();
      m_stateFinal = new State();

    }
    public NfaExpression(State stateFrom, State stateTo)
    {
      m_stateStart = stateFrom;
      m_stateFinal = stateTo;

    }

    State m_stateStart = null;
    State m_stateFinal = null;

    public State StartState()
    {
      return m_stateStart;
    }

    public State FinalState()
    {
      return m_stateFinal;
    }


  }
}

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)

Share

About the Author

Mizan Rahman
Denmark Denmark
No Biography provided

You may also be interested in...

Pro
Pro
| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160929.1 | Last Updated 24 Jun 2009
Article Copyright 2008 by Mizan Rahman
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid