Parsing problem in Silverlight-Version

Aug 12, 2010 at 8:04 AM

Hi,

i have a very strange problem. My application is using Irony to parse and interpret a special language. This works fine for the desktop version of my application (which uses Irony.dll). But when I'm trying to parse the exactly same code snippet in my silverlight application (which uses IronySL.dll), the parser core reports one or more errors.

The error messages that appear are all from the same type:

Failed to create AST node for non-terminal [{0}], error: {1}

Only the {0} part varies from message to message.

Example:

Failed to create AST node for non-terminal [logik], error: Fehler beim Versuch von Methode "Irony.Parsing.BnfTerm.CreateAstNode(Irony.Parsing.ParsingContext, Irony.Parsing.ParseTreeNode)", auf Methode "ProdKonf.RuntimeEnv.Interpreter.Ast.StatementListNode..ctor()" zuzugreifen.

This errors are kept in Irony.Parsing.ParseTree.ParserMessages attribute.

I'm hoping that somebody has a hint for me ... I'm using the latest version (51617).

Thanks.

Coordinator
Aug 12, 2010 at 4:37 PM
Can you please translate the error message? I don't understand German (my guess it's German).
Aug 13, 2010 at 7:11 AM

Oh sorry. The error message in english:

Failed to create AST node for non-terminal [logik], error: Attempt by method 'Irony.Parsing.BnfTerm.CreateAstNode(Irony.Parsing.ParsingContext, Irony.Parsing.ParseTreeNode)'
to access method 'ProdKonf.RuntimeEnv.Interpreter.Ast.StatementListNode..ctor()' failed.

or for example an other message that occures (same type):

Failed to create AST node for non-terminal [arg], error: Attempt by method 'Irony.Parsing.BnfTerm.CreateAstNode(Irony.Parsing.ParsingContext, Irony.Parsing.ParseTreeNode)' 
to access method 'ProdKonf.RuntimeEnv.Interpreter.Ast.ArgNode..ctor()' failed.

Coordinator
Aug 13, 2010 at 5:03 PM
Well, looks like Irony's code cannot access the constructor of node types. Check StatementListNode constructor (default, parameterless constructor), make sure it's public, and that the assembly in which the type lives is available (in the same run-time folder). Can you debug it and step-through to the point where it happens?
Aug 16, 2010 at 7:30 AM

Ok, I've localized the problem. Some of my extended AST node classes (as well as StatementListNode) did have the wrong scope ... Now they are public and it works fine!

Thank you very much for your help.