next up previous
Next: Type Pattern Expressions Up: Patterns Previous: Patterns


Name Patterns

In this section we give the rules for specifying names as patterns. The grammar explicitly allows the extra keywords introduced for AspectJ to be a valid simple_name_pattern.


\begin{grammar}
\begin{blue}
\par
<name_pattern> ::= \hspace{1in} \\
<simple_n...
...get' \vert 'throwing'
\alt 'warning' \vert 'withincode'
\end{blue}\end{grammar}

We also require two special name patterns to distinguish between the cases when the pattern terminates with an identifier or the token new. Note that in the next two grammar rules we allow a parenthesized type_pattern_expression when we really want to allow only a classname_pattern_expression. This is required to make the grammar for method_pattern and constructor_pattern LALR(1), and must be checked at weeding time.


\begin{grammar}
\begin{blue}
\par
<classtype_dot_id> ::= \hspace{1in} \\
<simp...
....' 'new'
\alt '(' <type_pattern_expr> ')' '.' 'new'
\par
\end{blue}\end{grammar}



hendren 2004-09-02