anchor.diff:         )*)?
         RPAREN                {params = (String[]) paramList.toArray(new String[]{});}
       ;
  -*/
  -
  -private closedPattern[List patternList]
  -    : variablePattern[patternList]
  -    | wildcardPattern[patternList]
  -    | literalPattern[patternList]
  -//TODO    | listPattern[patternList]
  -//    | tuplePattern[patternList]
  -//    | recordPattern[patternList]
  -//    | parenthesizedPattern[patternList]
  -    ;
  -
  -private variablePattern[List patternList]
  -{
  -    String pattern = null;
  -}
  -    : pattern=idName          {patternList.add(pattern);}
  -    ;
  -
  -private wildcardPattern[List patternList]
  -    : nonWordSymbol["_"]    {patternList.add("_");}
  -    ;
  -
  -private literalPattern[List patternList]
  -{
  -    String pattern = null;
  -}
  -    : pattern=literal         {patternList.add(pattern);}
  -    ;
  -
  -/*TODO private listPattern[List patternList]
  -{
  -    
  -}*/
  -
  +
  +/*
  +private formalOpParameters returns[String[] params]
  +{
  +    params = null;
  +    List paramList = new LinkedList();
  +}
  +    : (pattern[paramList]
  +      )*                    {params = (String[]) paramList.toArray(new String[]{});}
  +    ;
   
   private pattern[List patternList]
  -    : annotatedPattern[patternList]
  -    | tightPattern[patternList]
  +    : basePattern[patternList]
  +    | annotatedPattern[patternList]
  +    ;
  +
  +private basePattern[List patternList]
  +    : parenPattern[patternList]
  +    | bracePattern[patternList]
  +    | bracketPattern[patternList]
  +    | plainPattern[patternList]
       ;
   
   private annotatedPattern[List patternList]
  -    : pattern[patternList]
  +{
  +    String ignore = null;
  +}
  +    : basePattern[patternList]
         nonWordSymbol[":"]
         //TODO - fix sort to match grammar: sort
  +      ignore=sort
       ;
         
  -
  +private parenPattern[List patternList]
  +    : LPAREN 
  +      (pattern[patternList]
  +      )*
  +      RPAREN
  +    ;
  +
  +private bracePattern[List patternList]
  +    : LBRACE
  +      (pattern[patternList]
  +      )*
  +      RBRACE
  +    ;
  +
  +private bracketPattern[List patternList]
  +    : LBRACKET
  +      (pattern[patternList]
  +      )*
  +      RBRACKET
  +    ;
  +
  +private plainPattern[List patternList]
  +    : (patternJunk[patternList]
  +      )*
  +    ;
  +
  +private patternJunk[List patternList]
  +    : literal
  +    | expressionKeyword
  +    | idName
  +    | qualifiableRef
  +    | equals
  +    | COMMA
  +    | nonWordSymbol["::"]
  +    | nonWordSymbol["|"]
  +    | nonWordSymbol[":"]
  +    | nonWordSymbol["->"]
  +    | "quotient"
  +    | nonWordSymbol["."]
  +    ;
  +*/
   //---------------------------------------------------------------------------
   private specialSymbol returns[String text]
   {
  
positive.code:       )+
      ;
  
  private formalOpParameters returns[String[] params]
  {
      params = null;
      List paramList = new LinkedList();
  }
      : (closedPattern[paramList]
        )*                    {params = (String[]) paramList.toArray(new String[]{});}
      ;
  /*{
      params = null;
      String param = null;
      List paramList = null;
  
negative.code:  *
   *
   * $Log$
   * Revision 1.16  2003/03/07 23:44:24  weilyn
   * Added most top level terms
   *
   * Revision 1.15  2003/02/20 23:17:41  weilyn
   * Fixed parsing of assertions and options in prove term
   *
  