%union { public Pointcut PointcutType; public string StringType; public LinkEndPoint LinkEndPointType; public int IntType; } /* TERMINALS */ %token ASPECT EQUAL ARROW COLON PORTSEPARATOR CALLBACKSEPARATOR %token LPAR RPAR COMMA COLON EVENTIDENTIFIER %token ID REGEXP STRING %token INTEGER %type pointcut_entry %type class //target %type event_id method_id right aa: { /* Empty AA */ } | pointcut_list ASPECT ID LPAR var_list RPAR COLON advice_rules { /* Full AA */ } | ASPECT ID LPAR RPAR COLON advice_rules { /* Pointcut-less AA */ } ; pointcut_list: pointcut_list pointcut_entry { /* adding the entry to definition */ } | pointcut_entry { /* adding the entry to definition */ } ; pointcut_entry: ID EQUAL REGEXP { /* lampe = light* */ } | ID EQUAL ID { /* lampe = light1 */ } ; var_list: { /* empty list */ } | var_list1 { /* found list */ } ; var_list1: var_list1 COMMA ID { /* ID defined */ } | ID { /* ID defined */ } ; advice_rules: { /* empty rules */ } | advice_rules ID COLON class properties { /* component creation*/ } | advice_rules event_id ARROW LPAR right RPAR { /* link creation */ } ; class: ID { /* class ID */ } | class PORTSEPARATOR ID { /* composed class name */ } ; properties: { /* empty */ } | LPAR list_of_properties RPAR { /* properties specified */ } ; list_of_properties: property { /* found one property */ } | list_of_properties COMMA property { /* found another property */ } ; property: ID EQUAL INTEGER { /* INT type property definition */ } | ID EQUAL STRING { /* STR type property definition */ } ; event_id: ID PORTSEPARATOR EVENTIDENTIFIER ID parameters { /* event identifier */ } ; parameters: { /* no callback */ } | CALLBACKSEPARATOR list_of_parameters { /* callbacks defined */ } list_of_parameters: list_of_parameters ID { /* found a callback */ } | ID { /* found a callback */ } ; right: method_id { /* target method found */ } ; method_id: ID PORTSEPARATOR ID { /* method identifier */ } ; %%