Note that there are some explanatory texts on larger screens.

plurals
  1. POC# Irony Parser - Won't parse file despite everything seems correct
    primarykey
    data
    text
    <p>I am having some tricky problems with Irony which I do not understand...</p> <p>The first parsing I do in the runtime of my application succeeds.</p> <pre><code>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; </code></pre> <p>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:</p> <pre><code>Parser parser = new Parser(language); ParseTree parseTree = parser.Parse(file); ParseRoot = parseTree.Root; </code></pre> <p>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.</p> <pre><code>"Syntax error, expected: statement, member declaration, namespace" </code></pre> <p>But my file looks like this:</p> <pre><code>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;"); } } } } </code></pre> <p>I hope you can see what's wrong with my code... I'm getting desperate with this thing...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload