Click here to Skip to main content
13,095,529 members (58,890 online)
Click here to Skip to main content
Articles » Languages » C# » General » Downloads

Stats

108.4K views
1.2K downloads
136 bookmarked
Posted 13 Jul 2007

Conscript: An embeddable, compiled scripting language for .NET

, 5 Sep 2008
An API for enhancing any .NET application with a scripting language
using System;
using System.Collections.Generic;
using System.Text;

namespace Conscript.Compiler
{
    /// <summary>
    /// Exception for script parsing errors.
    /// </summary>
    public class ParserException
        : ConscriptException
    {
        #region Private Variables

        private Token m_token;

        #endregion

        #region Public Methods

        /// <summary>
        /// Constructs an exception.
        /// </summary>
        public ParserException()
            : base()
        {
            m_token = null;
        }

        /// <summary>
        /// Constructs an exception with the given message.
        /// </summary>
        /// <param name="strMessage">Exception message.</param>
        public ParserException(String strMessage)
            : base(strMessage)
        {
            m_token = null;
        }

        /// <summary>
        /// Constructs an exception with the given message
        /// and inner exception reference.
        /// </summary>
        /// <param name="strMessage">Exception message.</param>
        /// <param name="exceptionInner">Inner exception reference.</param>
        public ParserException(String strMessage, Exception exceptionInner)
            : base(strMessage, exceptionInner)
        {
            m_token = null;
        }

        /// <summary>
        /// Constructs an exception with the given message and
        /// parsing token.
        /// </summary>
        /// <param name="strMessage">Exception message.</param>
        /// <param name="token">Parsing token related to the
        /// exception.</param>
        public ParserException(String strMessage, Token token)
            : base(strMessage + " Line " + token.SourceLine
                + ", character "+token.SourceCharacter+": "
                + token.SourceText)
        {
            m_token = token;
        }

        #endregion
    }
}

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

Colin Vella
Software Developer (Senior)
Malta Malta
No Biography provided

You may also be interested in...

Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170813.1 | Last Updated 5 Sep 2008
Article Copyright 2007 by Colin Vella
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid