anchor.diff:  // *      Syntax for definition of spatial model      *
   // ****************************************************
   model:
  -  locationDef
  -  initVal*
  +  {hint.push(String.format(Messages.s_PARSER_MISSING_LOCATION_DEF));} locationDef {hint.pop();}
  +  {hint.push(String.format(Messages.s_PARSER_MISSING_INITIAL_VALUES));} initVal+ {hint.pop();}
     channel*
   ;
   
  
positive.code: start:;
  
  modelDefinition:
    agentDefinition+
    model
  ;
  
  agentDefinition:
    AGENT scopeName=UPPERCASENAME LBRACE componentDefinition+ RBRACE SEMI -> ^(AGENT $scopeName componentDefinition+)
  ;
  
  componentDefinition:
    UPPERCASENAME DEF component SEMI -> ^(COMPONENT UPPERCASENAME component)
  ;
  
  component:
  
negative.code: ;
  
  locationDef:
    LOCS DEF
    {hint.push(String.format(Messages.s_PARSER_INVALID_LOCATION_DEF_MISSING_LBRACE));} LBRACE {hint.pop();}
    {hint.push(String.format(Messages.s_PARSER_INVALID_LOCATION_DEF_INVALID_LOC));} location (COMMA location)* {hint.pop();}
    {hint.push(String.format(Messages.s_PARSER_INVALID_LOCATION_DEF_MISSING_RBRACE));} RBRACE {hint.pop();}
    {hint.push(String.format(Messages.s_PARSER_INVALID_LOCATION_DEF_MISSING_SEMI));} SEMI {hint.pop();}
    -> ^(LOCATIONS location+)
  ;
  
  agentPopulation:
    id=UPPERCASENAME {hint.push(String.format(Messages.s_PARSER_INVALID_AGENT_POPULATION_LOCATION,$id.text));} AT location {hint.pop();}
    -> ^(AGENTPOP $id location)
  ;
  
  actionCount:
    ACOUNT id=LOWERCASENAME {hint.push(String.format(Messages.s_PARSER_INVALID_ACTION_COUNT_LOCATION,$id.text));} AT location {hint.pop();}
    -> ^(ACOUNT $id location?)
  ;
  
  initVal:
    agentPopulation DEF {hint.push(String.format(Messages.s_PARSER_INVALID_AGENT_POPULATION_DEF));} expression SEMI {hint.pop();} -> ^(INITVAL agentPopulation expression)
  | actionCount DEF {hint.push(String.format(Messages.s_PARSER_INVALID_ACTION_COUNT_DEF));} expression SEMI {hint.pop();} -> ^(INITVAL actionCount expression)
  ;
  
  channel:
    CHANNEL 
    {hint.push(String.format(Messages.s_PARSER_CHANNEL_MISSING_LPAR));} LPAR {hint.pop();}
    {hint.push(String.format(Messages.s_PARSER_CHANNEL_INVALID_SENDER));} sender=agentPopulation {hint.pop();}
    COMMA 
    {hint.push(String.format(Messages.s_PARSER_CHANNEL_INVALID_RECEIVER));} receiver=agentPopulation {hint.pop();}
    COMMA 
    {hint.push(String.format(Messages.s_PARSER_CHANNEL_INVALID_MSG));} msg=UPPERCASENAME {hint.pop();}
    {hint.push(String.format(Messages.s_PARSER_CHANNEL_MISSING_RPAR));} RPAR {hint.pop();} 
    {hint.push(String.format(Messages.s_PARSER_CHANNEL_MISSING_DEF));} DEF {hint.pop();}
    {hint.push(String.format(Messages.s_PARSER_CHANNEL_MISSING_EXPR));} intensity=expression {hint.pop();}
    {hint.push(String.format(Messages.s_PARSER_CHANNEL_MISSING_SEMI));} SEMI {hint.pop();}
    -> ^(CHANNEL $sender $receiver $msg $intensity) 
  ;
  