1
0
mirror of https://github.com/twiglet/cs2j.git synced 2025-01-18 13:15:17 +01:00

transform events in interface declarations

This commit is contained in:
Kevin Glynn 2011-03-09 08:40:30 +01:00
parent 32d01889f2
commit 61c7200264
3 changed files with 4 additions and 3 deletions

View File

@ -1213,7 +1213,8 @@ interface_method_declaration [CommonTree atts, CommonTree mods, CommonTree type]
identifier type_parameter_constraints_clauses? generic_argument_list? formal_parameter_list? magicThrowsException);
interface_event_declaration [CommonTree atts, CommonTree mods]:
//attributes? 'new'?
'event' type identifier ';' ;
e='event' type identifier ';' -> ^(EVENT[$e.token, "EVENT"] { dupTree($atts) } { dupTree($mods) } type identifier)
;
interface_indexer_declaration [CommonTree atts, CommonTree mods, CommonTree type]:
// attributes? 'new'? type
'this' '[' formal_parameter_list ']' '{' indexer_accessor_declarations[atts,mods,type,$formal_parameter_list.tree] '}' ;

View File

@ -1826,7 +1826,7 @@ scope SymTab;
@init {
$SymTab::symtab = new Dictionary<string,TypeRepTemplate>();
}:
^(EVENT attributes? modifiers? event_declaration)
^(EVENT attributes? modifiers? type identifier)
| ^(METHOD attributes? modifiers? type identifier type_parameter_constraints_clauses? type_parameter_list? formal_parameter_list? exception*)
;

View File

@ -1010,7 +1010,7 @@ interface_method_declaration [string returnType]:
;
interface_event_declaration:
//attributes? 'new'?
'event' type identifier { ((ClassRepTemplate)$NSContext::currentTypeRep).Events.Add(new FieldRepTemplate($type.thetext, $identifier.text)); } ';'
'event' type identifier { ((InterfaceRepTemplate)$NSContext::currentTypeRep).Events.Add(new FieldRepTemplate($type.thetext, $identifier.text)); } ';'
{ Debug("Processing interface event declaration: " + $identifier.text); }
;
interface_indexer_declaration [string returnType]: