Dashboard > ANTLR 3 > ... > 2. Example > 2.5 Rule Inlining post_increment_expression
  ANTLR 3 Log In | Sign Up   View a printable version of the current page.  
  2.5 Rule Inlining post_increment_expression
Added by Johannes Luber, last edited by Johannes Luber on May 02, 2008  (view change)
Labels: 
(None)

We have to repeat the same steps again as for invocation_expression to get:

post_increment_expression
    :   (array_creation_expression
        |    literal
        |    simple_name
        |    parenthesized_expression
        |    predefined_type DOT IDENTIFIER type_argument_list?
        |    qualified_alias_member DOT IDENTIFIER type_argument_list?
        |    this_access
        |    base_access
        |    object_creation_expression
        |    delegate_creation_expression
        |    anonymous_object_creation_expression
        |    typeof_expression
        |    checked_expression
        |    unchecked_expression
        |    default_value_expression
        |    anonymous_method_expression
        |    sizeof_expression
        )   (DOT IDENTIFIER type_argument_list?
            |    OPEN_PARENS argument_list? CLOSE_PARENS
            |    OPEN_BRACKET (expression_list | expression) CLOSE_BRACKET
            |    OP_DEC
            |    OP_PTR IDENTIFIER
            |    OP_INC
            )+
    ;

The second pass has to check that array_creation_expression may not be followed by OPEN_BRACKET. It has to be also checked that OP_INC is the last matched sequence.

Sections

My siblings (including me):

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.1 Build:#806 May 06, 2007) - Bug/feature request - Contact Administrators