This project has moved and is read-only. For the latest updates, please go here.

Maybe I am missing something...


Hello All,
I am implementing a language in Irony similar (for now) to C#. It was implemented from the C# 4.0 specification. It has issues when parsing method declarations. Specifically, it is failing to reduce to return_type. I have tested changing the return_type in method_header to type_ref and it then recognizes the declaration, but it fails for a void return type (for obvious reasons). I feel I am missing something and could use some other eyes on this. Any help would be greatly appreciated.
I have attached the complete grammar. and the important bits are detailed below.

// NonTerminals
type_ref, return_type, method_header, method_declaration

KeyTerm @void = ToTerm( "void" );
type_ref.Rule = value_type | reference_type | type_parameter;
return_type.Rule = type_ref | @void; method_header.Rule = member_header + return_type + member_name + type_parameter_list.Q() + open_par + formal_parameter_list.Q() + close_par + type_parameter_constraints_clauses.Q();
method_declaration.Rule = method_header + method_body;

file attachments


nickyearwood wrote Feb 18, 2014 at 5:05 PM

I have attached the Object.cs class file I have been testing with.