anchor.diff:  grammar Shiro;
   
  -//@lexer::members{
  -//public static final int WHITESPACE = 1;
  -//public static final int COMMENTS = 2;
  -//}
  -
  -shiro : useStatement* statement* EOF
  +shiro : includeStmt*
  +        shiroStmt*
  +        EOF
   	  ;
   
  -useStatement: INCLUDE STRING_LITERAL NEWLINE;
  -
  -statement
  +includeStmt: INCLUDE STRING_LITERAL NEWLINE;
  +
  +shiroStmt
       :
  -          nodestmt
  +        anonymousGraphStmt
  +        | nodeDecl
           | graphDecl
  -        | inLineExpr
  -        | stateStmt
  +        | stateDecl
           | NEWLINE
   	;
   
  -stateStmt
  +stateDecl
       :   STATE stateName BEGIN NEWLINE
  -        stateLine*
  +        stateStmt*
           END
       ;
  +
   stateName
       :   IDENT
       ;
   
  -stateLine
  +stateStmt
       :   stateGraphSelection
       |   stateActivation
  +    |   nestedStateActivation
       |   NEWLINE
       ;
   
   stateGraphSelection
  -    :   GRAPH IDENT
  +    :   GRAPH (IDENT | DEFAULT)
  +    ;
  +
  +nestedStateActivation
  +    :   stateActivation BEGIN NEWLINE
  +        (stateActivation
  +        | nestedStateActivation
  +        | NEWLINE)*
  +        END
       ;
   
   stateActivation
  
positive.code:     :   (keys+=IDENT ':' values+=arg)(',' keys+=IDENT ':' values+=arg)*
      ;
  
  argList:	arg(',' arg)*
      	;
  
  arg: (expr | fullyQualifiedType);
  
  activeSelector
  	:	IDENT
  	;
  
  nodeInternal
      :   (portstmt
          | portAssignment
          | OPTION? nodestmt
          | optionalNodeProduction
          | NEWLINE)*
      ;
  
  optionalNodeProduction
      :   OPTION? nodeProduction
      ;
  
  portDecl
  	:	OPTION? portType? portName MFNAME
  	;
  	
  portDeclInit
  	:	OPTION? portType? portName mfCall
  	;
  
  portstmt	
  
negative.code:     : expr NEWLINE
      ;
  
  anonymousGraphStmt
      :   portAssignment
      |   funcDeclInit NEWLINE
      |   funcDecl NEWLINE
      |   anonExpr
      ;
  
  expr : '(' expr ')'						      #parensExpr
  	 |	NOT_OP expr 				          #notExpr
  	 |  MINUS_OP expr      					  #negExpr
  	 |  expr AND_OP expr  		  			  #andExpr
  