anchor.diff:      ;
   
   primaryAccessType
  -	:   'PUBLIC'
  -	|   'public'
  -	|   'PRIVATE'
  -	|   'private'
  -        |   'PROTECTED'
  -	|   'protected'
  -	;
  +    :   'PUBLIC'
  +    |   'public'
  +    |   'PRIVATE'
  +    |   'private'
  +    |   'PROTECTED'
  +    |   'protected'
  +    ;
   
   extendedAccessType
       :   'PROTECTEDREAD'
  
positive.code:     ;
  
  arrayLengthDeclarator
  	: '[' arrayLengthValue* ']'
  	;
  
  arrayLengthValue
  	: arrayLengthRange (',' arrayLengthRange)*
  	;
  
  arrayLengthRange
  	:  IntegerLiteral ('TO' IntegerLiteral)*
  	;
  
  
  delimiter
  
negative.code:     :   Identifier arrayLengthDeclarator* '=' variableInitializer
      ;
  
  // 7. Function Declaration
  functionDeclaration
      : functionDeclarationHeader parametersList functionDeclarationEnd delimiter
      ;
  
  functionDeclarationHeader
      : ( primaryAccessType | extendedAccessType)? scopeModificator? functionHeaderIdentification 
      ;
  
  functionDeclarationEnd
      : functionDeclarationEndLibrary? functionDeclarationEndRPC? functionDeclarationEndThrows?
      ;
  
  functionDeclarationEndLibrary
      : 'library' Identifier ('alias' 'for' Identifier)?
      ;
  
  functionDeclarationEndRPC
      : 'rpcfunc' 'alias' 'for' Identifier
      ;
  
  // 8. Function Declaration Block
  functionDeclarationBlock
      : functionDeclarationBlockHeader functionDeclaration* functionDeclarationBlockEnd
      ;
  
  functionDeclarationBlockHeader
      : functionBlockType 'prototypes' delimiter
      ;
  
  functionDeclarationBlockBody
      : functionDeclaration
      ;
  
  functionDeclarationBlockEnd
      : 'end' 'prototypes' delimiter
      ;
    
  // 9. Function Implementation
  functionImplementation
      : functionImplementationHeader functionImplementationBody* functionImplementationEnd delimiter
      ;
  	
  functionImplementationHeader
      : primaryAccessType scopeModificator? functionHeaderIdentification parametersList functionDeclarationEndThrows? ';'
      ;
  
  functionHeaderIdentification
      : functionHeaderDefinition Identifier
      ;
  
  functionHeaderDefinition
      : 'function' dataTypeName
      | 'subroutine'
      ;
  
  functionDeclarationEndThrows
      : 'throws' Identifier
      ;
  
  functionImplementationBody
      : statementBlock 
      ;
  
  functionImplementationEnd
      : 'end' 'function'
      | 'end' 'subroutine'
      ;
  
  functionBlockType
      : 'forward'
      | 'type'
      ;
  
  // 10. On Implementation
  onImplementation
      : onImplementationHead onImplementationBody onImplementationEnd
      ;
  
  onImplementationHead
      : 'On' onImplementationIdentifier delimiter
      ;
  
  onImplementationIdentifier
      : Identifier
      | 'open'
      | 'close'
      ;
  
  onImplementationBody
      : statement*?
      ;
  
  onImplementationEnd
      : 'end' 'on' delimiter
      ;
  
  // 11. Event Declaration
  eventDeclaration
      : 'event' eventTypeDeclaration Identifier? parametersList
      ;
  
  eventTypeDeclaration
      : 'type'
      | creatorType
      ;
  	
  creatorType
      : 'create'
      | 'destroy'
      ;
  
  parametersList
      : '(' parametersDeclarators? ')'
      ;
  	
  parametersDeclarators 
      : parameterDeclarator (',' parameterDeclarator)*?
      ;
  
  parameterDeclarator
      : 'readonly'? 'ref'? primitiveType Identifier
      ;
  
  scopeModificator
      : 'global'
      | 'local'
      ;
  
  globalScopeModificator
      : 'global'
      | 'shared'
      ;
  	
  statementBlock
      :   variableDeclaration
  