anchor.diff:   *
    *
    * $Log$
  + * Revision 1.15  2003/02/20 23:17:41  weilyn
  + * Fixed parsing of assertions and options in prove term
  + *
    * Revision 1.14  2003/02/18 18:10:14  weilyn
    * Added support for imports.
    *
  
positive.code:     String anAssertion = null;
  }
      : "using" 
        (anAssertion=name COMMA
         | anAssertion=name
        )+
      ;
  
  
negative.code:     : begin:"prove"                     {headerEnd = begin;}
        childItem=claimName               {if (childItem != null) children.add(childItem);}
        "in"
        childItem=scTerm[null]            {if (childItem != null) children.add(childItem);}
        //ignore=fullURIPath
        (childItem=proverAssertions)?     {if (childItem != null) children.add(childItem);}
        (childItem=proverOptions)?        {if (childItem != null) children.add(childItem);}
                                          /*{proof = builder.createProof(name);
                                           if (unitIdToken != null) {
                                              begin = unitIdToken;
                                           }
                                           builder.setParent(children, proof);
                                           ParserUtil.setAllBounds(builder, proof, begin, headerEnd, LT(0));
                                           }*/
      ;
  
  //---------------------------------------------------------------------------
  
  private fullURIPath returns[String path]
  {
      path = null;
      String item = null;
  }
      : (   (nonWordSymbol["/"]) => nonWordSymbol["/"] 
                                    item=partialURIPath        {path = "/" + item;}
          | item=partialURIPath                                {path = item;}
        )
        (ref:INNER_UNIT_REF                                    {path += ref.getText();}
        )?
      ;
  
  private partialURIPath returns[String path]
  {
      path = "";
      String item = null;
  }
      : id:IDENTIFIER                                     {path = path + id.getText();} 
        ( (nonWordSymbol["/"]) => nonWordSymbol["/"] 
                                  item=partialURIPath     {path = path + "/" + item;}
        |
        )
      ;
  
  //------------------------------------------------------------------------------
  
  private nameMap
      : LBRACE
        (nameMapItem
         ( COMMA nameMapItem)*
        )?
        RBRACE
      ;
  
  private nameMapItem
      : sortNameMapItem
      | opNameMapItem
      ;
  
  private sortNameMapItem
  {
      String ignore = null;
  }
      : ("sort"
        )?
        ignore=qualifiableSortNames
        nonWordSymbol["+->"]
        ignore=qualifiableSortNames
      ;
  
  private opNameMapItem
      : ("op"
        )?
        annotableQualifiableName
        nonWordSymbol["+->"]
        annotableQualifiableName
      ;
  
  private annotableQualifiableName
  {
      String ignore = null;
  }
      : ignore=qualifiableOpNames
        (nonWordSymbol[":"]
         ignore=sort
        )?
      ;
  
  //------------------------------------------------------------------------------
  
  private scDiagElem
      : scDiagNode
      | scDiagEdge
      ;
  
  private scDiagNode
  {
      String nodeName = null;
      ElementFactory.Item ignore = null;
  }
      : nodeName=name
        nonWordSymbol["+->"]
        ignore=scTerm[null]
      ;
  
  private scDiagEdge
  {
      String name1 = null;
      String name2 = null;
      String name3 = null;
      ElementFactory.Item ignore = null;
  }
      : name1=name
        nonWordSymbol[":"]
        name2=name
        nonWordSymbol["->"]
        name3=name
        nonWordSymbol["+->"]
        ignore=scTerm[null]
      ;
  
  //------------------------------------------------------------------------------
  
  private scSubstituteTermList
  {
      ElementFactory.Item ignore = null;
  }
      : LBRACKET
        ignore=scTerm[null]
        RBRACKET
        (scSubstituteTermList
        )*
      ;
  
  //------------------------------------------------------------------------------
  
  private claimName returns[ElementFactory.Item claimName]
  {
  