anchor.diff:  start:;
   
   modelDefinition:
  -  agentDefinition+
  -  model
  +  {hint.push(Messages.s_PARSER_AGENT_DEFINITION_REQUIRED);} agentDefinition+ {hint.pop();}
  +  {hint.push(Messages.s_PARSER_MODEL_DEFINITION_REQUIRED);} model {hint.pop();}
   ;
   
   agentDefinition:
  -  AGENT scopeName=UPPERCASENAME LBRACE componentDefinition+ RBRACE SEMI -> ^(AGENT $scopeName componentDefinition+)
  +  {hint.push(String.format(Messages.s_PARSER_INVALID_AGENT_SCOPE,$scopeName.text));} AGENT scopeName=UPPERCASENAME {hint.pop();}
  +  {hint.push(String.format(Messages.s_PARSER_INVALID_AGENT_MISSING_LBRACE,$scopeName.text));} LBRACE {hint.pop();}
  +  componentDefinition+ 
  +  {hint.push(String.format(Messages.s_PARSER_INVALID_AGENT_MISSING_RBRACE,$scopeName.text));} RBRACE {hint.pop();}
  +  {hint.push(String.format(Messages.s_PARSER_INVALID_AGENT_MISSING_SEMI,$scopeName.text));} SEMI {hint.pop();}
  +  -> ^(AGENT $scopeName componentDefinition+)
   ;
   
   componentDefinition:
  -  UPPERCASENAME DEF component SEMI -> ^(COMPONENT UPPERCASENAME component)
  +  id=UPPERCASENAME DEF {hint.push(String.format(Messages.s_PARSER_INVALID_AGENT_STATE_DEFINITION,$id.text));} s=component {hint.pop();}
  +  {hint.push(String.format(Messages.s_PARSER_INVALID_AGENT_STATE_MISSING_SEMI,$id.text));} SEMI {hint.pop();}
  +  -> ^(COMPONENT $id $s)
   ;
   
   component:
  
positive.code: {
  package uk.ac.imperial.doc.masspa.syntax;
  
  import uk.ac.imperial.doc.masspa.util.MASSPALogging;
  import uk.ac.imperial.doc.pctmc.syntax.ErrorReporter;  
  import uk.ac.imperial.doc.pctmc.syntax.CustomRecognitionException;
  import uk.ac.imperial.doc.pctmc.syntax.ParsingData;
    
  import java.util.LinkedList;
  import java.util.Set;
  import java.util.HashSet;
  
negative.code: ;
  
  choice:
    prefix (PLUS {hint.push(String.format(Messages.s_PARSER_CHOICE_INVALID_PREFIX));} prefix {hint.pop();})*
    -> prefix+
  ;
  
  prefix:
    {hint.push(String.format(Messages.s_PARSER_INVALID_TAU_PREFIX_DEFINITION));} LPAR r=expression RPAR DOT s=primaryComponent {hint.pop();} -> ^(PREFIX TAU $r $s)
  | {hint.push(String.format(Messages.s_PARSER_INVALID_PREFIX_DEFINITION));} LPAR action=LOWERCASENAME COMMA r=expression RPAR DOT s=primaryComponent {hint.pop();} -> ^(PREFIX $action $r $s)
  | SENDMSG {hint.push(String.format(Messages.s_PARSER_INVALID_TAU_SEND_PREFIX_DEFINITION));} LPAR r=expression COMMA msg=UPPERCASENAME COMMA nofmsg=expression RPAR DOT s=primaryComponent {hint.pop();} -> ^(SEND TAU $r $msg $nofmsg $s)
  | SENDMSG {hint.push(String.format(Messages.s_PARSER_INVALID_SEND_PREFIX_DEFINITION));} LPAR action=LOWERCASENAME COMMA r=expression COMMA msg=UPPERCASENAME COMMA nofmsg=expression RPAR DOT s=primaryComponent {hint.pop();} -> ^(SEND $action $r $msg $nofmsg $s)
  | RECVMSG {hint.push(String.format(Messages.s_PARSER_INVALID_TAU_RECV_PREFIX_DEFINITION));} LPAR msg=UPPERCASENAME COMMA msgaccprob=expression RPAR DOT s=primaryComponent {hint.pop();} -> ^(RECV TAU $msg $msgaccprob $s) 
  | RECVMSG {hint.push(String.format(Messages.s_PARSER_INVALID_RECV_PREFIX_DEFINITION));}  LPAR action=LOWERCASENAME COMMA msg=UPPERCASENAME COMMA msgaccprob=expression RPAR DOT s=primaryComponent {hint.pop();} -> ^(RECV $action $msg $msgaccprob $s) 
  | {hint.push(String.format(Messages.s_PARSER_INVALID_PRIMARY_COMPONENT));} primaryComponent {hint.pop();}
  ;
  
  primaryComponent:
  