Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8292981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:40:38+00:00 2026-06-08T13:40:38+00:00

I am having some tricky problems with Irony which I do not understand… The

  • 0

I am having some tricky problems with Irony which I do not understand…

The first parsing I do in the runtime of my application succeeds.

string src = "" // this is the file to parse
Grammar g = new CSharpGrammar();
LanguageData language = new LanguageData(g);
Parser parser = new Parser(language);
ParseTree parseTree = parser.Parse(src);
ParseRoot = parseTree.Root;

Then I followed one hint to move the LanguageData variable to the global context. Still everything ok. But now I wanted to call the Irony parser inside of custom functions, parsing multiple files with the c# grammar v3.5 provided by Irony (LINQ queries are not important to me, so that seems sufficient). Same approach:

Parser parser = new Parser(language);
ParseTree parseTree = parser.Parse(file);
ParseRoot = parseTree.Root;

But now the parseroot is and remains “null”. And I have absolutely no idea why. I also checked the parser errors a moment ago, there I recognized an error I cannot comprehend.

"Syntax error, expected: statement, member declaration, namespace"

But my file looks like this:

using System;
using Microsoft.SharePoint.WebControls;

namespace WebParts.Layouts.Ordering
{
    public partial class ConfirmDelete : LayoutsPageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            lblMsg.Text = "Are you sure you want to delete the entry?";

            if (!IsPostBack)
            {
                BtnYes.Attributes.Add("onclick", "OnYes(); return false;");
                BtnNo.Attributes.Add("onclick", "OnNo(); return false;");
            }
        }
    }
}

I hope you can see what’s wrong with my code… I’m getting desperate with this thing…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:40:39+00:00Added an answer on June 8, 2026 at 1:40 pm

    You have to provide a filename as the second argument of parser.Parse:

    static void Main(string[] args)
    {
        Grammar g = new CSharpGrammar();
        LanguageData language = new LanguageData(g);
        Parser parser = new Parser(language);
        ParseTree parseTree = parser.Parse("", "class1.cs");
    
        var r = parseTree.Root;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently having some problems- now = datetime.datetime.now() month = now.strftime(%B) site = wikipedia.getSite('en', 'wikiquote')
Im having some problems getting the Sticky Footer to work on my site. If
it's my first post here :) I'm having some difficulties with dealing with urls
I'm trying to use System.Runtime.InteropServices.ComTypes.IStream from C#, but I'm having some trouble. According to
I am having quite a tricky problem, which i just cannot seem to solve.
I'm building a user panel, and having some problems with data validation. As an
I am having some troubles with understanding the circumstances under which Silverlight downloads a
Im having some problems zipping a directory. The following line will do the trick
I've been having some troubles with parsing JSON that is received with WebSocket (original
I'm having 2 problems. 1 - I have a text area in which I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.