Is this what you mean?

module_body :
  (~(K_MODULE | K_ENDMODULE) | (K_MODULE module_body K_ENDMODULE))+;

module_declaration :
  key=K_MODULE lifetime? var=identifier module_body post=K_ENDMODULE (COLON
pident=identifier)?;

In the code below, the rule module_declaration will match only the outermost
module 'outside'.

module outside;

  module inside1;
  endmodule : inside1

  module inside2;
  endmodule

endmodule




On Thu, Apr 28, 2011 at 1:03 PM, Udo Weik <[email protected]> wrote:

> Hello,
>
> I'm just looking for common approaches for "Balanced Matching" with ANTLR,
> e. g. the typical problem for extracting methods/functions/procedures
> in source files. Any hints are highly appreciated.
>
>
> Many thanks and greetings
> Udo
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to