Newbie's question on a parser rule
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Q_Z
Posted On:   Monday, February 6, 2012 09:12 AM

I encountered below rule and don't know how to interpret it.


expression_list


: i+=expression (',' i+=expression)* -> ^(EXPRESSION_LIST $i+)


;



Specifically, not sure how to interpret i+ here.


Can someone shed some light? Thanks in advance.

Re: Newbie's question on a parser rule

Posted By:   franz  
Posted On:   Monday, June 18, 2012 10:53 AM

Hi,
 
"+=" is a convenient labeling method to build a list, here a list of expressions. Without "+=" you would use somthing like i.add(expression) to generate the list. "$i+" seems to indicate a list but a plain type.
 
Hope i could help.
 
Regards
Franz
About | Sitemap | Contact