How to create a ParseError object

SyntaxEditor for WPF Forum

Posted 7 years ago by John Groenland - CTO, mcThings Inc
Version: 17.1.0652
Avatar

I have created a class that inherit from CSharpParser and overwritten the Parse method so I can add compiler errors. See code below:

public class myParser : CSharpParser {
        public myParser (CSharpGrammar grm, string key ) : base(grm) {

        }
        public override IParseData Parse(IParseRequest request) {
            IParseData res = base.Parse(request);
            IDotNetParseData tmp = res as IDotNetParseData;
            System.Collections.Generic.List<IParseError> lst = tmp.Errors as System.Collections.Generic.List<IParseError>;
            // How to add errors 

            return res;
        }

    }

I can add items to the List<IParseError> lst, but how do I create errors?

Comments (1)

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi John,

You can just create an instance of the ActiproSoftware.Text.Parsing.Implementation.ParseError class.  One of the constructor overloads takes in all the main parameters for it.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.