All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openprovenance.prov.notation.PROV_NParser Maven / Gradle / Ivy

There is a newer version: 2.2.1
Show newest version
// $ANTLR 3.5.2 org/openprovenance/prov/notation/PROV_N.g 2024-07-11 05:55:54

package org.openprovenance.prov.notation;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

import org.antlr.runtime.tree.*;


/*******************************************************************************
 * Copyright (c) 2011-2012 Luc Moreau
 *******************************************************************************/
@SuppressWarnings("all")
public class PROV_NParser extends Parser {
	public static final String[] tokenNames = new String[] {
		"", "", "", "", "ACTIVITY", "AGENT", "ALTERNATE", 
		"AOBO", "ATTRIBUTE", "ATTRIBUTES", "BUNDLE", "BUNDLES", "CLOSE_CURLY_BRACE", 
		"CLOSE_SQUARE_BRACE", "CMEM", "COMMENT", "CTX", "DBIF", "DBRF", "DEFAULTNAMESPACE", 
		"DIGIT", "DMEM", "DOCUMENT", "DOT", "DateTime", "ECHAR", "END", "ENTITY", 
		"EOL", "EQUAL", "ES", "EXPRESSIONS", "EXT", "FALSE", "GREATER", "HEX", 
		"ID", "INFL", "INT", "INT_LITERAL", "IRI", "IRI_REF", "KES", "KEYS", "LANGTAG", 
		"LESS", "MEM", "MINUS", "NAMESPACE", "NAMESPACES", "OPEN_CURLY_BRACE", 
		"OPEN_SQUARE_BRACE", "PERCENT", "PN_CHARS", "PN_CHARS_BASE", "PN_CHARS_ESC", 
		"PN_CHARS_OTHERS", "PN_CHARS_U", "PN_LOCAL", "PN_PREFIX", "PREFIX", "PREFX", 
		"PRIMARYSOURCE", "QNAM", "QUALIFIED_NAME", "SEMICOLON", "SPECIALIZATION", 
		"START", "STRING", "STRING_LITERAL", "STRING_LITERAL_LONG2", "STRING_LONG", 
		"TIME", "TRUE", "TYPEDLITERAL", "TimeZoneOffset", "UNKNOWN", "USED", "VALUES", 
		"WAT", "WAW", "WDF", "WEB", "WGB", "WIB", "WINVB", "WQF", "WRO", "WS", 
		"WSB", "'%%'", "'('", "')'", "','", "'\\''", "'actedOnBehalfOf'", "'activity'", 
		"'agent'", "'alternateOf'", "'bundle'", "'default'", "'document'", "'endBundle'", 
		"'endDocument'", "'entity'", "'hadMember'", "'hadPrimarySource'", "'mentionOf'", 
		"'prefix'", "'prov:derivedByInsertionFrom('", "'prov:derivedByRemovalFrom('", 
		"'prov:hadDictionaryMember('", "'specializationOf'", "'used'", "'wasAssociatedWith'", 
		"'wasAttributedTo'", "'wasDerivedFrom'", "'wasEndedBy'", "'wasGeneratedBy'", 
		"'wasInfluencedBy'", "'wasInformedBy'", "'wasInvalidatedBy'", "'wasQuotedFrom'", 
		"'wasRevisionOf'", "'wasStartedBy'"
	};
	public static final int EOF=-1;
	public static final int T__90=90;
	public static final int T__91=91;
	public static final int T__92=92;
	public static final int T__93=93;
	public static final int T__94=94;
	public static final int T__95=95;
	public static final int T__96=96;
	public static final int T__97=97;
	public static final int T__98=98;
	public static final int T__99=99;
	public static final int T__100=100;
	public static final int T__101=101;
	public static final int T__102=102;
	public static final int T__103=103;
	public static final int T__104=104;
	public static final int T__105=105;
	public static final int T__106=106;
	public static final int T__107=107;
	public static final int T__108=108;
	public static final int T__109=109;
	public static final int T__110=110;
	public static final int T__111=111;
	public static final int T__112=112;
	public static final int T__113=113;
	public static final int T__114=114;
	public static final int T__115=115;
	public static final int T__116=116;
	public static final int T__117=117;
	public static final int T__118=118;
	public static final int T__119=119;
	public static final int T__120=120;
	public static final int T__121=121;
	public static final int T__122=122;
	public static final int T__123=123;
	public static final int T__124=124;
	public static final int ACTIVITY=4;
	public static final int AGENT=5;
	public static final int ALTERNATE=6;
	public static final int AOBO=7;
	public static final int ATTRIBUTE=8;
	public static final int ATTRIBUTES=9;
	public static final int BUNDLE=10;
	public static final int BUNDLES=11;
	public static final int CLOSE_CURLY_BRACE=12;
	public static final int CLOSE_SQUARE_BRACE=13;
	public static final int CMEM=14;
	public static final int COMMENT=15;
	public static final int CTX=16;
	public static final int DBIF=17;
	public static final int DBRF=18;
	public static final int DEFAULTNAMESPACE=19;
	public static final int DIGIT=20;
	public static final int DMEM=21;
	public static final int DOCUMENT=22;
	public static final int DOT=23;
	public static final int DateTime=24;
	public static final int ECHAR=25;
	public static final int END=26;
	public static final int ENTITY=27;
	public static final int EOL=28;
	public static final int EQUAL=29;
	public static final int ES=30;
	public static final int EXPRESSIONS=31;
	public static final int EXT=32;
	public static final int FALSE=33;
	public static final int GREATER=34;
	public static final int HEX=35;
	public static final int ID=36;
	public static final int INFL=37;
	public static final int INT=38;
	public static final int INT_LITERAL=39;
	public static final int IRI=40;
	public static final int IRI_REF=41;
	public static final int KES=42;
	public static final int KEYS=43;
	public static final int LANGTAG=44;
	public static final int LESS=45;
	public static final int MEM=46;
	public static final int MINUS=47;
	public static final int NAMESPACE=48;
	public static final int NAMESPACES=49;
	public static final int OPEN_CURLY_BRACE=50;
	public static final int OPEN_SQUARE_BRACE=51;
	public static final int PERCENT=52;
	public static final int PN_CHARS=53;
	public static final int PN_CHARS_BASE=54;
	public static final int PN_CHARS_ESC=55;
	public static final int PN_CHARS_OTHERS=56;
	public static final int PN_CHARS_U=57;
	public static final int PN_LOCAL=58;
	public static final int PN_PREFIX=59;
	public static final int PREFIX=60;
	public static final int PREFX=61;
	public static final int PRIMARYSOURCE=62;
	public static final int QNAM=63;
	public static final int QUALIFIED_NAME=64;
	public static final int SEMICOLON=65;
	public static final int SPECIALIZATION=66;
	public static final int START=67;
	public static final int STRING=68;
	public static final int STRING_LITERAL=69;
	public static final int STRING_LITERAL_LONG2=70;
	public static final int STRING_LONG=71;
	public static final int TIME=72;
	public static final int TRUE=73;
	public static final int TYPEDLITERAL=74;
	public static final int TimeZoneOffset=75;
	public static final int UNKNOWN=76;
	public static final int USED=77;
	public static final int VALUES=78;
	public static final int WAT=79;
	public static final int WAW=80;
	public static final int WDF=81;
	public static final int WEB=82;
	public static final int WGB=83;
	public static final int WIB=84;
	public static final int WINVB=85;
	public static final int WQF=86;
	public static final int WRO=87;
	public static final int WS=88;
	public static final int WSB=89;

	// delegates
	public Parser[] getDelegates() {
		return new Parser[] {};
	}

	// delegators


	public PROV_NParser(TokenStream input) {
		this(input, new RecognizerSharedState());
	}
	public PROV_NParser(TokenStream input, RecognizerSharedState state) {
		super(input, state);
	}

	protected TreeAdaptor adaptor = new CommonTreeAdaptor();

	public void setTreeAdaptor(TreeAdaptor adaptor) {
		this.adaptor = adaptor;
	}
	public TreeAdaptor getTreeAdaptor() {
		return adaptor;
	}
	@Override public String[] getTokenNames() { return PROV_NParser.tokenNames; }
	@Override public String getGrammarFileName() { return "org/openprovenance/prov/notation/PROV_N.g"; }



	            
	  @Override
	  public void displayRecognitionError(String [] tokenNames,
	                                      RecognitionException e) {
	      String hdr = getErrorHeader(e);
	      String msg = getErrorMessage(e, tokenNames);
	      org.openprovenance.prov.notation.Utility.warn(hdr + " " + msg);
	  }
	            
	 public static boolean qnameDisabled=false; 

	public static class document_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "document"
	// org/openprovenance/prov/notation/PROV_N.g:73:1: document : 'document' ( namespaceDeclarations )? ( expression )* ( bundle ( bundle )* )? 'endDocument' -> {$namespaceDeclarations.tree==null}? ^( DOCUMENT ^( NAMESPACES ) ^( EXPRESSIONS ( expression )* ) ^( BUNDLES ( bundle )* ) ) -> ^( DOCUMENT ( namespaceDeclarations )? ^( EXPRESSIONS ( expression )* ) ^( BUNDLES ( bundle )* ) ) ;
	public final PROV_NParser.document_return document() throws RecognitionException {
		PROV_NParser.document_return retval = new PROV_NParser.document_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal1=null;
		Token string_literal6=null;
		ParserRuleReturnScope namespaceDeclarations2 =null;
		ParserRuleReturnScope expression3 =null;
		ParserRuleReturnScope bundle4 =null;
		ParserRuleReturnScope bundle5 =null;

		Object string_literal1_tree=null;
		Object string_literal6_tree=null;
		RewriteRuleTokenStream stream_101=new RewriteRuleTokenStream(adaptor,"token 101");
		RewriteRuleTokenStream stream_103=new RewriteRuleTokenStream(adaptor,"token 103");
		RewriteRuleSubtreeStream stream_expression=new RewriteRuleSubtreeStream(adaptor,"rule expression");
		RewriteRuleSubtreeStream stream_namespaceDeclarations=new RewriteRuleSubtreeStream(adaptor,"rule namespaceDeclarations");
		RewriteRuleSubtreeStream stream_bundle=new RewriteRuleSubtreeStream(adaptor,"rule bundle");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:74:2: ( 'document' ( namespaceDeclarations )? ( expression )* ( bundle ( bundle )* )? 'endDocument' -> {$namespaceDeclarations.tree==null}? ^( DOCUMENT ^( NAMESPACES ) ^( EXPRESSIONS ( expression )* ) ^( BUNDLES ( bundle )* ) ) -> ^( DOCUMENT ( namespaceDeclarations )? ^( EXPRESSIONS ( expression )* ) ^( BUNDLES ( bundle )* ) ) )
			// org/openprovenance/prov/notation/PROV_N.g:74:5: 'document' ( namespaceDeclarations )? ( expression )* ( bundle ( bundle )* )? 'endDocument'
			{
			string_literal1=(Token)match(input,101,FOLLOW_101_in_document348);  
			stream_101.add(string_literal1);

			// org/openprovenance/prov/notation/PROV_N.g:75:9: ( namespaceDeclarations )?
			int alt1=2;
			int LA1_0 = input.LA(1);
			if ( (LA1_0==100||LA1_0==108) ) {
				alt1=1;
			}
			switch (alt1) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:75:10: namespaceDeclarations
					{
					pushFollow(FOLLOW_namespaceDeclarations_in_document360);
					namespaceDeclarations2=namespaceDeclarations();
					state._fsp--;

					stream_namespaceDeclarations.add(namespaceDeclarations2.getTree());
					}
					break;

			}

			// org/openprovenance/prov/notation/PROV_N.g:76:3: ( expression )*
			loop2:
			while (true) {
				int alt2=2;
				int LA2_0 = input.LA(1);
				if ( (LA2_0==QUALIFIED_NAME||(LA2_0 >= 95 && LA2_0 <= 98)||(LA2_0 >= 104 && LA2_0 <= 107)||(LA2_0 >= 109 && LA2_0 <= 124)) ) {
					alt2=1;
				}

				switch (alt2) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:76:4: expression
					{
					pushFollow(FOLLOW_expression_in_document367);
					expression3=expression();
					state._fsp--;

					stream_expression.add(expression3.getTree());
					}
					break;

				default :
					break loop2;
				}
			}

			// org/openprovenance/prov/notation/PROV_N.g:77:9: ( bundle ( bundle )* )?
			int alt4=2;
			int LA4_0 = input.LA(1);
			if ( (LA4_0==99) ) {
				alt4=1;
			}
			switch (alt4) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:77:10: bundle ( bundle )*
					{
					pushFollow(FOLLOW_bundle_in_document381);
					bundle4=bundle();
					state._fsp--;

					stream_bundle.add(bundle4.getTree());
					// org/openprovenance/prov/notation/PROV_N.g:77:17: ( bundle )*
					loop3:
					while (true) {
						int alt3=2;
						int LA3_0 = input.LA(1);
						if ( (LA3_0==99) ) {
							alt3=1;
						}

						switch (alt3) {
						case 1 :
							// org/openprovenance/prov/notation/PROV_N.g:77:18: bundle
							{
							pushFollow(FOLLOW_bundle_in_document384);
							bundle5=bundle();
							state._fsp--;

							stream_bundle.add(bundle5.getTree());
							}
							break;

						default :
							break loop3;
						}
					}

					}
					break;

			}

			string_literal6=(Token)match(input,103,FOLLOW_103_in_document392);  
			stream_103.add(string_literal6);

			// AST REWRITE
			// elements: bundle, expression, bundle, expression, namespaceDeclarations
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 79:7: -> {$namespaceDeclarations.tree==null}? ^( DOCUMENT ^( NAMESPACES ) ^( EXPRESSIONS ( expression )* ) ^( BUNDLES ( bundle )* ) )
			if ((namespaceDeclarations2!=null?((Object)namespaceDeclarations2.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:79:47: ^( DOCUMENT ^( NAMESPACES ) ^( EXPRESSIONS ( expression )* ) ^( BUNDLES ( bundle )* ) )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(DOCUMENT, "DOCUMENT"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:79:58: ^( NAMESPACES )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(NAMESPACES, "NAMESPACES"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:79:72: ^( EXPRESSIONS ( expression )* )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(EXPRESSIONS, "EXPRESSIONS"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:79:86: ( expression )*
				while ( stream_expression.hasNext() ) {
					adaptor.addChild(root_2, stream_expression.nextTree());
				}
				stream_expression.reset();

				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:79:99: ^( BUNDLES ( bundle )* )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(BUNDLES, "BUNDLES"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:79:109: ( bundle )*
				while ( stream_bundle.hasNext() ) {
					adaptor.addChild(root_2, stream_bundle.nextTree());
				}
				stream_bundle.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_0, root_1);
				}

			}

			else // 80:7: -> ^( DOCUMENT ( namespaceDeclarations )? ^( EXPRESSIONS ( expression )* ) ^( BUNDLES ( bundle )* ) )
			{
				// org/openprovenance/prov/notation/PROV_N.g:80:10: ^( DOCUMENT ( namespaceDeclarations )? ^( EXPRESSIONS ( expression )* ) ^( BUNDLES ( bundle )* ) )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(DOCUMENT, "DOCUMENT"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:80:21: ( namespaceDeclarations )?
				if ( stream_namespaceDeclarations.hasNext() ) {
					adaptor.addChild(root_1, stream_namespaceDeclarations.nextTree());
				}
				stream_namespaceDeclarations.reset();

				// org/openprovenance/prov/notation/PROV_N.g:80:44: ^( EXPRESSIONS ( expression )* )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(EXPRESSIONS, "EXPRESSIONS"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:80:58: ( expression )*
				while ( stream_expression.hasNext() ) {
					adaptor.addChild(root_2, stream_expression.nextTree());
				}
				stream_expression.reset();

				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:80:71: ^( BUNDLES ( bundle )* )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(BUNDLES, "BUNDLES"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:80:81: ( bundle )*
				while ( stream_bundle.hasNext() ) {
					adaptor.addChild(root_2, stream_bundle.nextTree());
				}
				stream_bundle.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "document"


	public static class bundle_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "bundle"
	// org/openprovenance/prov/notation/PROV_N.g:83:1: bundle : 'bundle' identifier ( namespaceDeclarations )? ( expression )* 'endBundle' -> {$namespaceDeclarations.tree==null}? ^( BUNDLE identifier ^( NAMESPACES ) ^( EXPRESSIONS ( expression )* ) ) -> ^( BUNDLE identifier ( namespaceDeclarations )? ^( EXPRESSIONS ( expression )* ) ) ;
	public final PROV_NParser.bundle_return bundle() throws RecognitionException {
		PROV_NParser.bundle_return retval = new PROV_NParser.bundle_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal7=null;
		Token string_literal11=null;
		ParserRuleReturnScope identifier8 =null;
		ParserRuleReturnScope namespaceDeclarations9 =null;
		ParserRuleReturnScope expression10 =null;

		Object string_literal7_tree=null;
		Object string_literal11_tree=null;
		RewriteRuleTokenStream stream_99=new RewriteRuleTokenStream(adaptor,"token 99");
		RewriteRuleTokenStream stream_102=new RewriteRuleTokenStream(adaptor,"token 102");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_expression=new RewriteRuleSubtreeStream(adaptor,"rule expression");
		RewriteRuleSubtreeStream stream_namespaceDeclarations=new RewriteRuleSubtreeStream(adaptor,"rule namespaceDeclarations");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:84:3: ( 'bundle' identifier ( namespaceDeclarations )? ( expression )* 'endBundle' -> {$namespaceDeclarations.tree==null}? ^( BUNDLE identifier ^( NAMESPACES ) ^( EXPRESSIONS ( expression )* ) ) -> ^( BUNDLE identifier ( namespaceDeclarations )? ^( EXPRESSIONS ( expression )* ) ) )
			// org/openprovenance/prov/notation/PROV_N.g:84:5: 'bundle' identifier ( namespaceDeclarations )? ( expression )* 'endBundle'
			{
			string_literal7=(Token)match(input,99,FOLLOW_99_in_bundle468);  
			stream_99.add(string_literal7);

			pushFollow(FOLLOW_identifier_in_bundle470);
			identifier8=identifier();
			state._fsp--;

			stream_identifier.add(identifier8.getTree());
			// org/openprovenance/prov/notation/PROV_N.g:85:9: ( namespaceDeclarations )?
			int alt5=2;
			int LA5_0 = input.LA(1);
			if ( (LA5_0==100||LA5_0==108) ) {
				alt5=1;
			}
			switch (alt5) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:85:10: namespaceDeclarations
					{
					pushFollow(FOLLOW_namespaceDeclarations_in_bundle481);
					namespaceDeclarations9=namespaceDeclarations();
					state._fsp--;

					stream_namespaceDeclarations.add(namespaceDeclarations9.getTree());
					}
					break;

			}

			// org/openprovenance/prov/notation/PROV_N.g:86:3: ( expression )*
			loop6:
			while (true) {
				int alt6=2;
				int LA6_0 = input.LA(1);
				if ( (LA6_0==QUALIFIED_NAME||(LA6_0 >= 95 && LA6_0 <= 98)||(LA6_0 >= 104 && LA6_0 <= 107)||(LA6_0 >= 109 && LA6_0 <= 124)) ) {
					alt6=1;
				}

				switch (alt6) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:86:4: expression
					{
					pushFollow(FOLLOW_expression_in_bundle488);
					expression10=expression();
					state._fsp--;

					stream_expression.add(expression10.getTree());
					}
					break;

				default :
					break loop6;
				}
			}

			string_literal11=(Token)match(input,102,FOLLOW_102_in_bundle494);  
			stream_102.add(string_literal11);

			// AST REWRITE
			// elements: identifier, expression, identifier, namespaceDeclarations, expression
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 88:7: -> {$namespaceDeclarations.tree==null}? ^( BUNDLE identifier ^( NAMESPACES ) ^( EXPRESSIONS ( expression )* ) )
			if ((namespaceDeclarations9!=null?((Object)namespaceDeclarations9.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:88:47: ^( BUNDLE identifier ^( NAMESPACES ) ^( EXPRESSIONS ( expression )* ) )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(BUNDLE, "BUNDLE"), root_1);
				adaptor.addChild(root_1, stream_identifier.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:88:67: ^( NAMESPACES )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(NAMESPACES, "NAMESPACES"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:88:81: ^( EXPRESSIONS ( expression )* )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(EXPRESSIONS, "EXPRESSIONS"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:88:95: ( expression )*
				while ( stream_expression.hasNext() ) {
					adaptor.addChild(root_2, stream_expression.nextTree());
				}
				stream_expression.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_0, root_1);
				}

			}

			else // 89:7: -> ^( BUNDLE identifier ( namespaceDeclarations )? ^( EXPRESSIONS ( expression )* ) )
			{
				// org/openprovenance/prov/notation/PROV_N.g:89:10: ^( BUNDLE identifier ( namespaceDeclarations )? ^( EXPRESSIONS ( expression )* ) )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(BUNDLE, "BUNDLE"), root_1);
				adaptor.addChild(root_1, stream_identifier.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:89:30: ( namespaceDeclarations )?
				if ( stream_namespaceDeclarations.hasNext() ) {
					adaptor.addChild(root_1, stream_namespaceDeclarations.nextTree());
				}
				stream_namespaceDeclarations.reset();

				// org/openprovenance/prov/notation/PROV_N.g:89:53: ^( EXPRESSIONS ( expression )* )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(EXPRESSIONS, "EXPRESSIONS"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:89:67: ( expression )*
				while ( stream_expression.hasNext() ) {
					adaptor.addChild(root_2, stream_expression.nextTree());
				}
				stream_expression.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "bundle"


	public static class namespaceDeclarations_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "namespaceDeclarations"
	// org/openprovenance/prov/notation/PROV_N.g:93:1: namespaceDeclarations : ( defaultNamespaceDeclaration | namespaceDeclaration ) ( namespaceDeclaration )* -> ^( NAMESPACES ( defaultNamespaceDeclaration )? ( namespaceDeclaration )* ) ;
	public final PROV_NParser.namespaceDeclarations_return namespaceDeclarations() throws RecognitionException {
		PROV_NParser.namespaceDeclarations_return retval = new PROV_NParser.namespaceDeclarations_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		ParserRuleReturnScope defaultNamespaceDeclaration12 =null;
		ParserRuleReturnScope namespaceDeclaration13 =null;
		ParserRuleReturnScope namespaceDeclaration14 =null;

		RewriteRuleSubtreeStream stream_namespaceDeclaration=new RewriteRuleSubtreeStream(adaptor,"rule namespaceDeclaration");
		RewriteRuleSubtreeStream stream_defaultNamespaceDeclaration=new RewriteRuleSubtreeStream(adaptor,"rule defaultNamespaceDeclaration");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:93:23: ( ( defaultNamespaceDeclaration | namespaceDeclaration ) ( namespaceDeclaration )* -> ^( NAMESPACES ( defaultNamespaceDeclaration )? ( namespaceDeclaration )* ) )
			// org/openprovenance/prov/notation/PROV_N.g:94:9: ( defaultNamespaceDeclaration | namespaceDeclaration ) ( namespaceDeclaration )*
			{
			// org/openprovenance/prov/notation/PROV_N.g:94:9: ( defaultNamespaceDeclaration | namespaceDeclaration )
			int alt7=2;
			int LA7_0 = input.LA(1);
			if ( (LA7_0==100) ) {
				alt7=1;
			}
			else if ( (LA7_0==108) ) {
				alt7=2;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 7, 0, input);
				throw nvae;
			}

			switch (alt7) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:94:10: defaultNamespaceDeclaration
					{
					pushFollow(FOLLOW_defaultNamespaceDeclaration_in_namespaceDeclarations565);
					defaultNamespaceDeclaration12=defaultNamespaceDeclaration();
					state._fsp--;

					stream_defaultNamespaceDeclaration.add(defaultNamespaceDeclaration12.getTree());
					}
					break;
				case 2 :
					// org/openprovenance/prov/notation/PROV_N.g:94:40: namespaceDeclaration
					{
					pushFollow(FOLLOW_namespaceDeclaration_in_namespaceDeclarations569);
					namespaceDeclaration13=namespaceDeclaration();
					state._fsp--;

					stream_namespaceDeclaration.add(namespaceDeclaration13.getTree());
					}
					break;

			}

			// org/openprovenance/prov/notation/PROV_N.g:94:62: ( namespaceDeclaration )*
			loop8:
			while (true) {
				int alt8=2;
				int LA8_0 = input.LA(1);
				if ( (LA8_0==108) ) {
					alt8=1;
				}

				switch (alt8) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:94:62: namespaceDeclaration
					{
					pushFollow(FOLLOW_namespaceDeclaration_in_namespaceDeclarations572);
					namespaceDeclaration14=namespaceDeclaration();
					state._fsp--;

					stream_namespaceDeclaration.add(namespaceDeclaration14.getTree());
					}
					break;

				default :
					break loop8;
				}
			}

			// AST REWRITE
			// elements: namespaceDeclaration, defaultNamespaceDeclaration
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 95:9: -> ^( NAMESPACES ( defaultNamespaceDeclaration )? ( namespaceDeclaration )* )
			{
				// org/openprovenance/prov/notation/PROV_N.g:95:12: ^( NAMESPACES ( defaultNamespaceDeclaration )? ( namespaceDeclaration )* )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(NAMESPACES, "NAMESPACES"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:95:25: ( defaultNamespaceDeclaration )?
				if ( stream_defaultNamespaceDeclaration.hasNext() ) {
					adaptor.addChild(root_1, stream_defaultNamespaceDeclaration.nextTree());
				}
				stream_defaultNamespaceDeclaration.reset();

				// org/openprovenance/prov/notation/PROV_N.g:95:54: ( namespaceDeclaration )*
				while ( stream_namespaceDeclaration.hasNext() ) {
					adaptor.addChild(root_1, stream_namespaceDeclaration.nextTree());
				}
				stream_namespaceDeclaration.reset();

				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "namespaceDeclarations"


	public static class namespaceDeclaration_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "namespaceDeclaration"
	// org/openprovenance/prov/notation/PROV_N.g:112:1: namespaceDeclaration : 'prefix' PREFX namespace -> ^( NAMESPACE ^( PREFIX PREFX ) namespace ) ;
	public final PROV_NParser.namespaceDeclaration_return namespaceDeclaration() throws RecognitionException {
		PROV_NParser.namespaceDeclaration_return retval = new PROV_NParser.namespaceDeclaration_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal15=null;
		Token PREFX16=null;
		ParserRuleReturnScope namespace17 =null;

		Object string_literal15_tree=null;
		Object PREFX16_tree=null;
		RewriteRuleTokenStream stream_PREFX=new RewriteRuleTokenStream(adaptor,"token PREFX");
		RewriteRuleTokenStream stream_108=new RewriteRuleTokenStream(adaptor,"token 108");
		RewriteRuleSubtreeStream stream_namespace=new RewriteRuleSubtreeStream(adaptor,"rule namespace");

		 qnameDisabled = true; 
		try {
			// org/openprovenance/prov/notation/PROV_N.g:114:35: ( 'prefix' PREFX namespace -> ^( NAMESPACE ^( PREFIX PREFX ) namespace ) )
			// org/openprovenance/prov/notation/PROV_N.g:115:9: 'prefix' PREFX namespace
			{
			string_literal15=(Token)match(input,108,FOLLOW_108_in_namespaceDeclaration629);  
			stream_108.add(string_literal15);

			PREFX16=(Token)match(input,PREFX,FOLLOW_PREFX_in_namespaceDeclaration631);  
			stream_PREFX.add(PREFX16);

			pushFollow(FOLLOW_namespace_in_namespaceDeclaration633);
			namespace17=namespace();
			state._fsp--;

			stream_namespace.add(namespace17.getTree());
			// AST REWRITE
			// elements: namespace, PREFX
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 116:9: -> ^( NAMESPACE ^( PREFIX PREFX ) namespace )
			{
				// org/openprovenance/prov/notation/PROV_N.g:116:12: ^( NAMESPACE ^( PREFIX PREFX ) namespace )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(NAMESPACE, "NAMESPACE"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:116:24: ^( PREFIX PREFX )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(PREFIX, "PREFIX"), root_2);
				adaptor.addChild(root_2, stream_PREFX.nextNode());
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_namespace.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

			 qnameDisabled = false; 
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "namespaceDeclaration"


	public static class namespace_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "namespace"
	// org/openprovenance/prov/notation/PROV_N.g:118:1: namespace : IRI_REF ;
	public final PROV_NParser.namespace_return namespace() throws RecognitionException {
		PROV_NParser.namespace_return retval = new PROV_NParser.namespace_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token IRI_REF18=null;

		Object IRI_REF18_tree=null;

		try {
			// org/openprovenance/prov/notation/PROV_N.g:118:11: ( IRI_REF )
			// org/openprovenance/prov/notation/PROV_N.g:119:9: IRI_REF
			{
			root_0 = (Object)adaptor.nil();


			IRI_REF18=(Token)match(input,IRI_REF,FOLLOW_IRI_REF_in_namespace675); 
			IRI_REF18_tree = (Object)adaptor.create(IRI_REF18);
			adaptor.addChild(root_0, IRI_REF18_tree);

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "namespace"


	public static class defaultNamespaceDeclaration_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "defaultNamespaceDeclaration"
	// org/openprovenance/prov/notation/PROV_N.g:122:1: defaultNamespaceDeclaration : 'default' IRI_REF -> ^( DEFAULTNAMESPACE IRI_REF ) ;
	public final PROV_NParser.defaultNamespaceDeclaration_return defaultNamespaceDeclaration() throws RecognitionException {
		PROV_NParser.defaultNamespaceDeclaration_return retval = new PROV_NParser.defaultNamespaceDeclaration_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal19=null;
		Token IRI_REF20=null;

		Object string_literal19_tree=null;
		Object IRI_REF20_tree=null;
		RewriteRuleTokenStream stream_IRI_REF=new RewriteRuleTokenStream(adaptor,"token IRI_REF");
		RewriteRuleTokenStream stream_100=new RewriteRuleTokenStream(adaptor,"token 100");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:122:29: ( 'default' IRI_REF -> ^( DEFAULTNAMESPACE IRI_REF ) )
			// org/openprovenance/prov/notation/PROV_N.g:123:9: 'default' IRI_REF
			{
			string_literal19=(Token)match(input,100,FOLLOW_100_in_defaultNamespaceDeclaration696);  
			stream_100.add(string_literal19);

			IRI_REF20=(Token)match(input,IRI_REF,FOLLOW_IRI_REF_in_defaultNamespaceDeclaration698);  
			stream_IRI_REF.add(IRI_REF20);

			// AST REWRITE
			// elements: IRI_REF
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 124:9: -> ^( DEFAULTNAMESPACE IRI_REF )
			{
				// org/openprovenance/prov/notation/PROV_N.g:124:13: ^( DEFAULTNAMESPACE IRI_REF )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(DEFAULTNAMESPACE, "DEFAULTNAMESPACE"), root_1);
				adaptor.addChild(root_1, stream_IRI_REF.nextNode());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "defaultNamespaceDeclaration"


	public static class expression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "expression"
	// org/openprovenance/prov/notation/PROV_N.g:127:1: expression : ( entityExpression | activityExpression | generationExpression | usageExpression | startExpression | endExpression | invalidationExpression | communicationExpression | agentExpression | associationExpression | attributionExpression | responsibilityExpression | derivationExpression | influenceExpression | hadPrimarySourceExpression | quotationExpression | revisionExpression | alternateExpression | specializationExpression | insertionExpression | removalExpression | collectionMembershipExpression | dictionaryMembershipExpression | mentionExpression | extensibilityExpression ) ;
	public final PROV_NParser.expression_return expression() throws RecognitionException {
		PROV_NParser.expression_return retval = new PROV_NParser.expression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		ParserRuleReturnScope entityExpression21 =null;
		ParserRuleReturnScope activityExpression22 =null;
		ParserRuleReturnScope generationExpression23 =null;
		ParserRuleReturnScope usageExpression24 =null;
		ParserRuleReturnScope startExpression25 =null;
		ParserRuleReturnScope endExpression26 =null;
		ParserRuleReturnScope invalidationExpression27 =null;
		ParserRuleReturnScope communicationExpression28 =null;
		ParserRuleReturnScope agentExpression29 =null;
		ParserRuleReturnScope associationExpression30 =null;
		ParserRuleReturnScope attributionExpression31 =null;
		ParserRuleReturnScope responsibilityExpression32 =null;
		ParserRuleReturnScope derivationExpression33 =null;
		ParserRuleReturnScope influenceExpression34 =null;
		ParserRuleReturnScope hadPrimarySourceExpression35 =null;
		ParserRuleReturnScope quotationExpression36 =null;
		ParserRuleReturnScope revisionExpression37 =null;
		ParserRuleReturnScope alternateExpression38 =null;
		ParserRuleReturnScope specializationExpression39 =null;
		ParserRuleReturnScope insertionExpression40 =null;
		ParserRuleReturnScope removalExpression41 =null;
		ParserRuleReturnScope collectionMembershipExpression42 =null;
		ParserRuleReturnScope dictionaryMembershipExpression43 =null;
		ParserRuleReturnScope mentionExpression44 =null;
		ParserRuleReturnScope extensibilityExpression45 =null;


		 qnameDisabled = false; 
		try {
			// org/openprovenance/prov/notation/PROV_N.g:128:34: ( ( entityExpression | activityExpression | generationExpression | usageExpression | startExpression | endExpression | invalidationExpression | communicationExpression | agentExpression | associationExpression | attributionExpression | responsibilityExpression | derivationExpression | influenceExpression | hadPrimarySourceExpression | quotationExpression | revisionExpression | alternateExpression | specializationExpression | insertionExpression | removalExpression | collectionMembershipExpression | dictionaryMembershipExpression | mentionExpression | extensibilityExpression ) )
			// org/openprovenance/prov/notation/PROV_N.g:129:9: ( entityExpression | activityExpression | generationExpression | usageExpression | startExpression | endExpression | invalidationExpression | communicationExpression | agentExpression | associationExpression | attributionExpression | responsibilityExpression | derivationExpression | influenceExpression | hadPrimarySourceExpression | quotationExpression | revisionExpression | alternateExpression | specializationExpression | insertionExpression | removalExpression | collectionMembershipExpression | dictionaryMembershipExpression | mentionExpression | extensibilityExpression )
			{
			root_0 = (Object)adaptor.nil();


			// org/openprovenance/prov/notation/PROV_N.g:129:9: ( entityExpression | activityExpression | generationExpression | usageExpression | startExpression | endExpression | invalidationExpression | communicationExpression | agentExpression | associationExpression | attributionExpression | responsibilityExpression | derivationExpression | influenceExpression | hadPrimarySourceExpression | quotationExpression | revisionExpression | alternateExpression | specializationExpression | insertionExpression | removalExpression | collectionMembershipExpression | dictionaryMembershipExpression | mentionExpression | extensibilityExpression )
			int alt9=25;
			switch ( input.LA(1) ) {
			case 104:
				{
				alt9=1;
				}
				break;
			case 96:
				{
				alt9=2;
				}
				break;
			case 118:
				{
				alt9=3;
				}
				break;
			case 113:
				{
				alt9=4;
				}
				break;
			case 124:
				{
				alt9=5;
				}
				break;
			case 117:
				{
				alt9=6;
				}
				break;
			case 121:
				{
				alt9=7;
				}
				break;
			case 120:
				{
				alt9=8;
				}
				break;
			case 97:
				{
				alt9=9;
				}
				break;
			case 114:
				{
				alt9=10;
				}
				break;
			case 115:
				{
				alt9=11;
				}
				break;
			case 95:
				{
				alt9=12;
				}
				break;
			case 116:
				{
				alt9=13;
				}
				break;
			case 119:
				{
				alt9=14;
				}
				break;
			case 106:
				{
				alt9=15;
				}
				break;
			case 122:
				{
				alt9=16;
				}
				break;
			case 123:
				{
				alt9=17;
				}
				break;
			case 98:
				{
				alt9=18;
				}
				break;
			case 112:
				{
				alt9=19;
				}
				break;
			case 109:
				{
				alt9=20;
				}
				break;
			case 110:
				{
				alt9=21;
				}
				break;
			case 105:
				{
				alt9=22;
				}
				break;
			case 111:
				{
				alt9=23;
				}
				break;
			case 107:
				{
				alt9=24;
				}
				break;
			case QUALIFIED_NAME:
				{
				alt9=25;
				}
				break;
			default:
				NoViableAltException nvae =
					new NoViableAltException("", 9, 0, input);
				throw nvae;
			}
			switch (alt9) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:131:12: entityExpression
					{
					pushFollow(FOLLOW_entityExpression_in_expression759);
					entityExpression21=entityExpression();
					state._fsp--;

					adaptor.addChild(root_0, entityExpression21.getTree());

					}
					break;
				case 2 :
					// org/openprovenance/prov/notation/PROV_N.g:131:31: activityExpression
					{
					pushFollow(FOLLOW_activityExpression_in_expression763);
					activityExpression22=activityExpression();
					state._fsp--;

					adaptor.addChild(root_0, activityExpression22.getTree());

					}
					break;
				case 3 :
					// org/openprovenance/prov/notation/PROV_N.g:131:52: generationExpression
					{
					pushFollow(FOLLOW_generationExpression_in_expression767);
					generationExpression23=generationExpression();
					state._fsp--;

					adaptor.addChild(root_0, generationExpression23.getTree());

					}
					break;
				case 4 :
					// org/openprovenance/prov/notation/PROV_N.g:131:76: usageExpression
					{
					pushFollow(FOLLOW_usageExpression_in_expression772);
					usageExpression24=usageExpression();
					state._fsp--;

					adaptor.addChild(root_0, usageExpression24.getTree());

					}
					break;
				case 5 :
					// org/openprovenance/prov/notation/PROV_N.g:132:12: startExpression
					{
					pushFollow(FOLLOW_startExpression_in_expression785);
					startExpression25=startExpression();
					state._fsp--;

					adaptor.addChild(root_0, startExpression25.getTree());

					}
					break;
				case 6 :
					// org/openprovenance/prov/notation/PROV_N.g:132:30: endExpression
					{
					pushFollow(FOLLOW_endExpression_in_expression789);
					endExpression26=endExpression();
					state._fsp--;

					adaptor.addChild(root_0, endExpression26.getTree());

					}
					break;
				case 7 :
					// org/openprovenance/prov/notation/PROV_N.g:132:46: invalidationExpression
					{
					pushFollow(FOLLOW_invalidationExpression_in_expression793);
					invalidationExpression27=invalidationExpression();
					state._fsp--;

					adaptor.addChild(root_0, invalidationExpression27.getTree());

					}
					break;
				case 8 :
					// org/openprovenance/prov/notation/PROV_N.g:132:71: communicationExpression
					{
					pushFollow(FOLLOW_communicationExpression_in_expression797);
					communicationExpression28=communicationExpression();
					state._fsp--;

					adaptor.addChild(root_0, communicationExpression28.getTree());

					}
					break;
				case 9 :
					// org/openprovenance/prov/notation/PROV_N.g:136:11: agentExpression
					{
					pushFollow(FOLLOW_agentExpression_in_expression833);
					agentExpression29=agentExpression();
					state._fsp--;

					adaptor.addChild(root_0, agentExpression29.getTree());

					}
					break;
				case 10 :
					// org/openprovenance/prov/notation/PROV_N.g:136:30: associationExpression
					{
					pushFollow(FOLLOW_associationExpression_in_expression838);
					associationExpression30=associationExpression();
					state._fsp--;

					adaptor.addChild(root_0, associationExpression30.getTree());

					}
					break;
				case 11 :
					// org/openprovenance/prov/notation/PROV_N.g:136:54: attributionExpression
					{
					pushFollow(FOLLOW_attributionExpression_in_expression842);
					attributionExpression31=attributionExpression();
					state._fsp--;

					adaptor.addChild(root_0, attributionExpression31.getTree());

					}
					break;
				case 12 :
					// org/openprovenance/prov/notation/PROV_N.g:136:78: responsibilityExpression
					{
					pushFollow(FOLLOW_responsibilityExpression_in_expression846);
					responsibilityExpression32=responsibilityExpression();
					state._fsp--;

					adaptor.addChild(root_0, responsibilityExpression32.getTree());

					}
					break;
				case 13 :
					// org/openprovenance/prov/notation/PROV_N.g:140:11: derivationExpression
					{
					pushFollow(FOLLOW_derivationExpression_in_expression874);
					derivationExpression33=derivationExpression();
					state._fsp--;

					adaptor.addChild(root_0, derivationExpression33.getTree());

					}
					break;
				case 14 :
					// org/openprovenance/prov/notation/PROV_N.g:140:34: influenceExpression
					{
					pushFollow(FOLLOW_influenceExpression_in_expression878);
					influenceExpression34=influenceExpression();
					state._fsp--;

					adaptor.addChild(root_0, influenceExpression34.getTree());

					}
					break;
				case 15 :
					// org/openprovenance/prov/notation/PROV_N.g:140:56: hadPrimarySourceExpression
					{
					pushFollow(FOLLOW_hadPrimarySourceExpression_in_expression882);
					hadPrimarySourceExpression35=hadPrimarySourceExpression();
					state._fsp--;

					adaptor.addChild(root_0, hadPrimarySourceExpression35.getTree());

					}
					break;
				case 16 :
					// org/openprovenance/prov/notation/PROV_N.g:140:85: quotationExpression
					{
					pushFollow(FOLLOW_quotationExpression_in_expression886);
					quotationExpression36=quotationExpression();
					state._fsp--;

					adaptor.addChild(root_0, quotationExpression36.getTree());

					}
					break;
				case 17 :
					// org/openprovenance/prov/notation/PROV_N.g:140:107: revisionExpression
					{
					pushFollow(FOLLOW_revisionExpression_in_expression890);
					revisionExpression37=revisionExpression();
					state._fsp--;

					adaptor.addChild(root_0, revisionExpression37.getTree());

					}
					break;
				case 18 :
					// org/openprovenance/prov/notation/PROV_N.g:144:11: alternateExpression
					{
					pushFollow(FOLLOW_alternateExpression_in_expression918);
					alternateExpression38=alternateExpression();
					state._fsp--;

					adaptor.addChild(root_0, alternateExpression38.getTree());

					}
					break;
				case 19 :
					// org/openprovenance/prov/notation/PROV_N.g:144:33: specializationExpression
					{
					pushFollow(FOLLOW_specializationExpression_in_expression922);
					specializationExpression39=specializationExpression();
					state._fsp--;

					adaptor.addChild(root_0, specializationExpression39.getTree());

					}
					break;
				case 20 :
					// org/openprovenance/prov/notation/PROV_N.g:148:11: insertionExpression
					{
					pushFollow(FOLLOW_insertionExpression_in_expression950);
					insertionExpression40=insertionExpression();
					state._fsp--;

					adaptor.addChild(root_0, insertionExpression40.getTree());

					}
					break;
				case 21 :
					// org/openprovenance/prov/notation/PROV_N.g:148:33: removalExpression
					{
					pushFollow(FOLLOW_removalExpression_in_expression954);
					removalExpression41=removalExpression();
					state._fsp--;

					adaptor.addChild(root_0, removalExpression41.getTree());

					}
					break;
				case 22 :
					// org/openprovenance/prov/notation/PROV_N.g:148:53: collectionMembershipExpression
					{
					pushFollow(FOLLOW_collectionMembershipExpression_in_expression958);
					collectionMembershipExpression42=collectionMembershipExpression();
					state._fsp--;

					adaptor.addChild(root_0, collectionMembershipExpression42.getTree());

					}
					break;
				case 23 :
					// org/openprovenance/prov/notation/PROV_N.g:148:87: dictionaryMembershipExpression
					{
					pushFollow(FOLLOW_dictionaryMembershipExpression_in_expression963);
					dictionaryMembershipExpression43=dictionaryMembershipExpression();
					state._fsp--;

					adaptor.addChild(root_0, dictionaryMembershipExpression43.getTree());

					}
					break;
				case 24 :
					// org/openprovenance/prov/notation/PROV_N.g:152:12: mentionExpression
					{
					pushFollow(FOLLOW_mentionExpression_in_expression993);
					mentionExpression44=mentionExpression();
					state._fsp--;

					adaptor.addChild(root_0, mentionExpression44.getTree());

					}
					break;
				case 25 :
					// org/openprovenance/prov/notation/PROV_N.g:155:12: extensibilityExpression
					{
					pushFollow(FOLLOW_extensibilityExpression_in_expression1021);
					extensibilityExpression45=extensibilityExpression();
					state._fsp--;

					adaptor.addChild(root_0, extensibilityExpression45.getTree());

					}
					break;

			}

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "expression"


	public static class entityExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "entityExpression"
	// org/openprovenance/prov/notation/PROV_N.g:164:1: entityExpression : 'entity' '(' identifier optionalAttributeValuePairs ')' -> ^( ENTITY identifier optionalAttributeValuePairs ) ;
	public final PROV_NParser.entityExpression_return entityExpression() throws RecognitionException {
		PROV_NParser.entityExpression_return retval = new PROV_NParser.entityExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal46=null;
		Token char_literal47=null;
		Token char_literal50=null;
		ParserRuleReturnScope identifier48 =null;
		ParserRuleReturnScope optionalAttributeValuePairs49 =null;

		Object string_literal46_tree=null;
		Object char_literal47_tree=null;
		Object char_literal50_tree=null;
		RewriteRuleTokenStream stream_104=new RewriteRuleTokenStream(adaptor,"token 104");
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:165:2: ( 'entity' '(' identifier optionalAttributeValuePairs ')' -> ^( ENTITY identifier optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:165:4: 'entity' '(' identifier optionalAttributeValuePairs ')'
			{
			string_literal46=(Token)match(input,104,FOLLOW_104_in_entityExpression1045);  
			stream_104.add(string_literal46);

			char_literal47=(Token)match(input,91,FOLLOW_91_in_entityExpression1047);  
			stream_91.add(char_literal47);

			pushFollow(FOLLOW_identifier_in_entityExpression1049);
			identifier48=identifier();
			state._fsp--;

			stream_identifier.add(identifier48.getTree());
			pushFollow(FOLLOW_optionalAttributeValuePairs_in_entityExpression1051);
			optionalAttributeValuePairs49=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs49.getTree());
			char_literal50=(Token)match(input,92,FOLLOW_92_in_entityExpression1053);  
			stream_92.add(char_literal50);

			// AST REWRITE
			// elements: optionalAttributeValuePairs, identifier
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 166:9: -> ^( ENTITY identifier optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:166:12: ^( ENTITY identifier optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(ENTITY, "ENTITY"), root_1);
				adaptor.addChild(root_1, stream_identifier.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "entityExpression"


	public static class activityExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "activityExpression"
	// org/openprovenance/prov/notation/PROV_N.g:170:1: activityExpression : 'activity' '(' identifier ( ',' (s= time | '-' ) ',' (e= time | '-' ) )? optionalAttributeValuePairs ')' -> ^( ACTIVITY identifier ^( START ( $s)? ) ^( END ( $e)? ) optionalAttributeValuePairs ) ;
	public final PROV_NParser.activityExpression_return activityExpression() throws RecognitionException {
		PROV_NParser.activityExpression_return retval = new PROV_NParser.activityExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal51=null;
		Token char_literal52=null;
		Token char_literal54=null;
		Token char_literal55=null;
		Token char_literal56=null;
		Token char_literal57=null;
		Token char_literal59=null;
		ParserRuleReturnScope s =null;
		ParserRuleReturnScope e =null;
		ParserRuleReturnScope identifier53 =null;
		ParserRuleReturnScope optionalAttributeValuePairs58 =null;

		Object string_literal51_tree=null;
		Object char_literal52_tree=null;
		Object char_literal54_tree=null;
		Object char_literal55_tree=null;
		Object char_literal56_tree=null;
		Object char_literal57_tree=null;
		Object char_literal59_tree=null;
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleTokenStream stream_96=new RewriteRuleTokenStream(adaptor,"token 96");
		RewriteRuleTokenStream stream_MINUS=new RewriteRuleTokenStream(adaptor,"token MINUS");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_time=new RewriteRuleSubtreeStream(adaptor,"rule time");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:171:2: ( 'activity' '(' identifier ( ',' (s= time | '-' ) ',' (e= time | '-' ) )? optionalAttributeValuePairs ')' -> ^( ACTIVITY identifier ^( START ( $s)? ) ^( END ( $e)? ) optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:171:4: 'activity' '(' identifier ( ',' (s= time | '-' ) ',' (e= time | '-' ) )? optionalAttributeValuePairs ')'
			{
			string_literal51=(Token)match(input,96,FOLLOW_96_in_activityExpression1083);  
			stream_96.add(string_literal51);

			char_literal52=(Token)match(input,91,FOLLOW_91_in_activityExpression1085);  
			stream_91.add(char_literal52);

			pushFollow(FOLLOW_identifier_in_activityExpression1087);
			identifier53=identifier();
			state._fsp--;

			stream_identifier.add(identifier53.getTree());
			// org/openprovenance/prov/notation/PROV_N.g:171:30: ( ',' (s= time | '-' ) ',' (e= time | '-' ) )?
			int alt12=2;
			int LA12_0 = input.LA(1);
			if ( (LA12_0==93) ) {
				int LA12_1 = input.LA(2);
				if ( (LA12_1==DateTime||LA12_1==MINUS) ) {
					alt12=1;
				}
			}
			switch (alt12) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:171:31: ',' (s= time | '-' ) ',' (e= time | '-' )
					{
					char_literal54=(Token)match(input,93,FOLLOW_93_in_activityExpression1090);  
					stream_93.add(char_literal54);

					// org/openprovenance/prov/notation/PROV_N.g:171:35: (s= time | '-' )
					int alt10=2;
					int LA10_0 = input.LA(1);
					if ( (LA10_0==DateTime) ) {
						alt10=1;
					}
					else if ( (LA10_0==MINUS) ) {
						alt10=2;
					}

					else {
						NoViableAltException nvae =
							new NoViableAltException("", 10, 0, input);
						throw nvae;
					}

					switch (alt10) {
						case 1 :
							// org/openprovenance/prov/notation/PROV_N.g:171:36: s= time
							{
							pushFollow(FOLLOW_time_in_activityExpression1095);
							s=time();
							state._fsp--;

							stream_time.add(s.getTree());
							}
							break;
						case 2 :
							// org/openprovenance/prov/notation/PROV_N.g:171:45: '-'
							{
							char_literal55=(Token)match(input,MINUS,FOLLOW_MINUS_in_activityExpression1099);  
							stream_MINUS.add(char_literal55);

							}
							break;

					}

					char_literal56=(Token)match(input,93,FOLLOW_93_in_activityExpression1103);  
					stream_93.add(char_literal56);

					// org/openprovenance/prov/notation/PROV_N.g:171:55: (e= time | '-' )
					int alt11=2;
					int LA11_0 = input.LA(1);
					if ( (LA11_0==DateTime) ) {
						alt11=1;
					}
					else if ( (LA11_0==MINUS) ) {
						alt11=2;
					}

					else {
						NoViableAltException nvae =
							new NoViableAltException("", 11, 0, input);
						throw nvae;
					}

					switch (alt11) {
						case 1 :
							// org/openprovenance/prov/notation/PROV_N.g:171:56: e= time
							{
							pushFollow(FOLLOW_time_in_activityExpression1108);
							e=time();
							state._fsp--;

							stream_time.add(e.getTree());
							}
							break;
						case 2 :
							// org/openprovenance/prov/notation/PROV_N.g:171:65: '-'
							{
							char_literal57=(Token)match(input,MINUS,FOLLOW_MINUS_in_activityExpression1112);  
							stream_MINUS.add(char_literal57);

							}
							break;

					}

					}
					break;

			}

			pushFollow(FOLLOW_optionalAttributeValuePairs_in_activityExpression1117);
			optionalAttributeValuePairs58=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs58.getTree());
			char_literal59=(Token)match(input,92,FOLLOW_92_in_activityExpression1119);  
			stream_92.add(char_literal59);

			// AST REWRITE
			// elements: optionalAttributeValuePairs, identifier, s, e
			// token labels: 
			// rule labels: s, e, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_s=new RewriteRuleSubtreeStream(adaptor,"rule s",s!=null?s.getTree():null);
			RewriteRuleSubtreeStream stream_e=new RewriteRuleSubtreeStream(adaptor,"rule e",e!=null?e.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 174:9: -> ^( ACTIVITY identifier ^( START ( $s)? ) ^( END ( $e)? ) optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:174:12: ^( ACTIVITY identifier ^( START ( $s)? ) ^( END ( $e)? ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(ACTIVITY, "ACTIVITY"), root_1);
				adaptor.addChild(root_1, stream_identifier.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:174:34: ^( START ( $s)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(START, "START"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:174:43: ( $s)?
				if ( stream_s.hasNext() ) {
					adaptor.addChild(root_2, stream_s.nextTree());
				}
				stream_s.reset();

				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:174:47: ^( END ( $e)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(END, "END"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:174:54: ( $e)?
				if ( stream_e.hasNext() ) {
					adaptor.addChild(root_2, stream_e.nextTree());
				}
				stream_e.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "activityExpression"


	public static class generationExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "generationExpression"
	// org/openprovenance/prov/notation/PROV_N.g:177:1: generationExpression : 'wasGeneratedBy' '(' id0= optionalIdentifier id2= identifier ( ',' id1= identifierOrMarker ',' (tt= time | '-' ) )? optionalAttributeValuePairs ')' -> {$id1.tree==null }? ^( WGB ^( ID ( $id0)? ) $id2 ^( ID ) ^( TIME ) optionalAttributeValuePairs ) -> {$id1.tree!=null && $tt.tree==null}? ^( WGB ^( ID ( $id0)? ) $id2 $id1 ^( TIME ) optionalAttributeValuePairs ) -> ^( WGB ^( ID ( $id0)? ) $id2 $id1 $tt optionalAttributeValuePairs ) ;
	public final PROV_NParser.generationExpression_return generationExpression() throws RecognitionException {
		PROV_NParser.generationExpression_return retval = new PROV_NParser.generationExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal60=null;
		Token char_literal61=null;
		Token char_literal62=null;
		Token char_literal63=null;
		Token char_literal64=null;
		Token char_literal66=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope id2 =null;
		ParserRuleReturnScope id1 =null;
		ParserRuleReturnScope tt =null;
		ParserRuleReturnScope optionalAttributeValuePairs65 =null;

		Object string_literal60_tree=null;
		Object char_literal61_tree=null;
		Object char_literal62_tree=null;
		Object char_literal63_tree=null;
		Object char_literal64_tree=null;
		Object char_literal66_tree=null;
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_118=new RewriteRuleTokenStream(adaptor,"token 118");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleTokenStream stream_MINUS=new RewriteRuleTokenStream(adaptor,"token MINUS");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_identifierOrMarker=new RewriteRuleSubtreeStream(adaptor,"rule identifierOrMarker");
		RewriteRuleSubtreeStream stream_time=new RewriteRuleSubtreeStream(adaptor,"rule time");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:178:2: ( 'wasGeneratedBy' '(' id0= optionalIdentifier id2= identifier ( ',' id1= identifierOrMarker ',' (tt= time | '-' ) )? optionalAttributeValuePairs ')' -> {$id1.tree==null }? ^( WGB ^( ID ( $id0)? ) $id2 ^( ID ) ^( TIME ) optionalAttributeValuePairs ) -> {$id1.tree!=null && $tt.tree==null}? ^( WGB ^( ID ( $id0)? ) $id2 $id1 ^( TIME ) optionalAttributeValuePairs ) -> ^( WGB ^( ID ( $id0)? ) $id2 $id1 $tt optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:178:4: 'wasGeneratedBy' '(' id0= optionalIdentifier id2= identifier ( ',' id1= identifierOrMarker ',' (tt= time | '-' ) )? optionalAttributeValuePairs ')'
			{
			string_literal60=(Token)match(input,118,FOLLOW_118_in_generationExpression1167);  
			stream_118.add(string_literal60);

			char_literal61=(Token)match(input,91,FOLLOW_91_in_generationExpression1169);  
			stream_91.add(char_literal61);

			pushFollow(FOLLOW_optionalIdentifier_in_generationExpression1173);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_identifier_in_generationExpression1177);
			id2=identifier();
			state._fsp--;

			stream_identifier.add(id2.getTree());
			// org/openprovenance/prov/notation/PROV_N.g:178:63: ( ',' id1= identifierOrMarker ',' (tt= time | '-' ) )?
			int alt14=2;
			int LA14_0 = input.LA(1);
			if ( (LA14_0==93) ) {
				int LA14_1 = input.LA(2);
				if ( (LA14_1==MINUS||LA14_1==QUALIFIED_NAME) ) {
					alt14=1;
				}
			}
			switch (alt14) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:178:64: ',' id1= identifierOrMarker ',' (tt= time | '-' )
					{
					char_literal62=(Token)match(input,93,FOLLOW_93_in_generationExpression1180);  
					stream_93.add(char_literal62);

					pushFollow(FOLLOW_identifierOrMarker_in_generationExpression1184);
					id1=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(id1.getTree());
					char_literal63=(Token)match(input,93,FOLLOW_93_in_generationExpression1186);  
					stream_93.add(char_literal63);

					// org/openprovenance/prov/notation/PROV_N.g:178:95: (tt= time | '-' )
					int alt13=2;
					int LA13_0 = input.LA(1);
					if ( (LA13_0==DateTime) ) {
						alt13=1;
					}
					else if ( (LA13_0==MINUS) ) {
						alt13=2;
					}

					else {
						NoViableAltException nvae =
							new NoViableAltException("", 13, 0, input);
						throw nvae;
					}

					switch (alt13) {
						case 1 :
							// org/openprovenance/prov/notation/PROV_N.g:178:97: tt= time
							{
							pushFollow(FOLLOW_time_in_generationExpression1192);
							tt=time();
							state._fsp--;

							stream_time.add(tt.getTree());
							}
							break;
						case 2 :
							// org/openprovenance/prov/notation/PROV_N.g:178:107: '-'
							{
							char_literal64=(Token)match(input,MINUS,FOLLOW_MINUS_in_generationExpression1196);  
							stream_MINUS.add(char_literal64);

							}
							break;

					}

					}
					break;

			}

			pushFollow(FOLLOW_optionalAttributeValuePairs_in_generationExpression1202);
			optionalAttributeValuePairs65=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs65.getTree());
			char_literal66=(Token)match(input,92,FOLLOW_92_in_generationExpression1204);  
			stream_92.add(char_literal66);

			// AST REWRITE
			// elements: id1, id2, id0, optionalAttributeValuePairs, id0, tt, id0, optionalAttributeValuePairs, id2, optionalAttributeValuePairs, id1, id2
			// token labels: 
			// rule labels: tt, id0, id2, id1, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_tt=new RewriteRuleSubtreeStream(adaptor,"rule tt",tt!=null?tt.getTree():null);
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_id2=new RewriteRuleSubtreeStream(adaptor,"rule id2",id2!=null?id2.getTree():null);
			RewriteRuleSubtreeStream stream_id1=new RewriteRuleSubtreeStream(adaptor,"rule id1",id1!=null?id1.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 179:7: -> {$id1.tree==null }? ^( WGB ^( ID ( $id0)? ) $id2 ^( ID ) ^( TIME ) optionalAttributeValuePairs )
			if ((id1!=null?((Object)id1.getTree()):null)==null ) {
				// org/openprovenance/prov/notation/PROV_N.g:180:10: ^( WGB ^( ID ( $id0)? ) $id2 ^( ID ) ^( TIME ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WGB, "WGB"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:180:16: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:180:22: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:180:33: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:180:40: ^( TIME )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(TIME, "TIME"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 181:7: -> {$id1.tree!=null && $tt.tree==null}? ^( WGB ^( ID ( $id0)? ) $id2 $id1 ^( TIME ) optionalAttributeValuePairs )
			if ((id1!=null?((Object)id1.getTree()):null)!=null && (tt!=null?((Object)tt.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:182:10: ^( WGB ^( ID ( $id0)? ) $id2 $id1 ^( TIME ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WGB, "WGB"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:182:16: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:182:22: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:182:38: ^( TIME )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(TIME, "TIME"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 183:7: -> ^( WGB ^( ID ( $id0)? ) $id2 $id1 $tt optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:183:10: ^( WGB ^( ID ( $id0)? ) $id2 $id1 $tt optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WGB, "WGB"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:183:16: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:183:22: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				adaptor.addChild(root_1, stream_tt.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "generationExpression"


	public static class optionalIdentifier_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "optionalIdentifier"
	// org/openprovenance/prov/notation/PROV_N.g:188:1: optionalIdentifier : ( (id0= identifier | '-' ) SEMICOLON )? -> ( identifier )? ;
	public final PROV_NParser.optionalIdentifier_return optionalIdentifier() throws RecognitionException {
		PROV_NParser.optionalIdentifier_return retval = new PROV_NParser.optionalIdentifier_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token char_literal67=null;
		Token SEMICOLON68=null;
		ParserRuleReturnScope id0 =null;

		Object char_literal67_tree=null;
		Object SEMICOLON68_tree=null;
		RewriteRuleTokenStream stream_SEMICOLON=new RewriteRuleTokenStream(adaptor,"token SEMICOLON");
		RewriteRuleTokenStream stream_MINUS=new RewriteRuleTokenStream(adaptor,"token MINUS");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:189:5: ( ( (id0= identifier | '-' ) SEMICOLON )? -> ( identifier )? )
			// org/openprovenance/prov/notation/PROV_N.g:189:7: ( (id0= identifier | '-' ) SEMICOLON )?
			{
			// org/openprovenance/prov/notation/PROV_N.g:189:7: ( (id0= identifier | '-' ) SEMICOLON )?
			int alt16=2;
			int LA16_0 = input.LA(1);
			if ( (LA16_0==QUALIFIED_NAME) ) {
				int LA16_1 = input.LA(2);
				if ( (LA16_1==SEMICOLON) ) {
					alt16=1;
				}
			}
			else if ( (LA16_0==MINUS) ) {
				int LA16_2 = input.LA(2);
				if ( (LA16_2==SEMICOLON) ) {
					alt16=1;
				}
			}
			switch (alt16) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:189:8: (id0= identifier | '-' ) SEMICOLON
					{
					// org/openprovenance/prov/notation/PROV_N.g:189:8: (id0= identifier | '-' )
					int alt15=2;
					int LA15_0 = input.LA(1);
					if ( (LA15_0==QUALIFIED_NAME) ) {
						alt15=1;
					}
					else if ( (LA15_0==MINUS) ) {
						alt15=2;
					}

					else {
						NoViableAltException nvae =
							new NoViableAltException("", 15, 0, input);
						throw nvae;
					}

					switch (alt15) {
						case 1 :
							// org/openprovenance/prov/notation/PROV_N.g:189:9: id0= identifier
							{
							pushFollow(FOLLOW_identifier_in_optionalIdentifier1346);
							id0=identifier();
							state._fsp--;

							stream_identifier.add(id0.getTree());
							}
							break;
						case 2 :
							// org/openprovenance/prov/notation/PROV_N.g:189:26: '-'
							{
							char_literal67=(Token)match(input,MINUS,FOLLOW_MINUS_in_optionalIdentifier1350);  
							stream_MINUS.add(char_literal67);

							}
							break;

					}

					SEMICOLON68=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_optionalIdentifier1353);  
					stream_SEMICOLON.add(SEMICOLON68);

					}
					break;

			}

			// AST REWRITE
			// elements: identifier
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 190:6: -> ( identifier )?
			{
				// org/openprovenance/prov/notation/PROV_N.g:190:9: ( identifier )?
				if ( stream_identifier.hasNext() ) {
					adaptor.addChild(root_0, stream_identifier.nextTree());
				}
				stream_identifier.reset();

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "optionalIdentifier"


	public static class identifierOrMarker_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "identifierOrMarker"
	// org/openprovenance/prov/notation/PROV_N.g:193:1: identifierOrMarker : ( identifier -> identifier | '-' -> ^( ID ) ) ;
	public final PROV_NParser.identifierOrMarker_return identifierOrMarker() throws RecognitionException {
		PROV_NParser.identifierOrMarker_return retval = new PROV_NParser.identifierOrMarker_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token char_literal70=null;
		ParserRuleReturnScope identifier69 =null;

		Object char_literal70_tree=null;
		RewriteRuleTokenStream stream_MINUS=new RewriteRuleTokenStream(adaptor,"token MINUS");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:194:5: ( ( identifier -> identifier | '-' -> ^( ID ) ) )
			// org/openprovenance/prov/notation/PROV_N.g:195:9: ( identifier -> identifier | '-' -> ^( ID ) )
			{
			// org/openprovenance/prov/notation/PROV_N.g:195:9: ( identifier -> identifier | '-' -> ^( ID ) )
			int alt17=2;
			int LA17_0 = input.LA(1);
			if ( (LA17_0==QUALIFIED_NAME) ) {
				alt17=1;
			}
			else if ( (LA17_0==MINUS) ) {
				alt17=2;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 17, 0, input);
				throw nvae;
			}

			switch (alt17) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:195:10: identifier
					{
					pushFollow(FOLLOW_identifier_in_identifierOrMarker1391);
					identifier69=identifier();
					state._fsp--;

					stream_identifier.add(identifier69.getTree());
					// AST REWRITE
					// elements: identifier
					// token labels: 
					// rule labels: retval
					// token list labels: 
					// rule list labels: 
					// wildcard labels: 
					retval.tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

					root_0 = (Object)adaptor.nil();
					// 195:22: -> identifier
					{
						adaptor.addChild(root_0, stream_identifier.nextTree());
					}


					retval.tree = root_0;

					}
					break;
				case 2 :
					// org/openprovenance/prov/notation/PROV_N.g:195:38: '-'
					{
					char_literal70=(Token)match(input,MINUS,FOLLOW_MINUS_in_identifierOrMarker1400);  
					stream_MINUS.add(char_literal70);

					// AST REWRITE
					// elements: 
					// token labels: 
					// rule labels: retval
					// token list labels: 
					// rule list labels: 
					// wildcard labels: 
					retval.tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

					root_0 = (Object)adaptor.nil();
					// 195:42: -> ^( ID )
					{
						// org/openprovenance/prov/notation/PROV_N.g:195:45: ^( ID )
						{
						Object root_1 = (Object)adaptor.nil();
						root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_1);
						adaptor.addChild(root_0, root_1);
						}

					}


					retval.tree = root_0;

					}
					break;

			}

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "identifierOrMarker"


	public static class usageExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "usageExpression"
	// org/openprovenance/prov/notation/PROV_N.g:198:1: usageExpression : 'used' '(' id0= optionalIdentifier id2= identifier ( ',' id1= identifierOrMarker ',' (tt= time | '-' ) )? optionalAttributeValuePairs ')' -> {$id1.tree==null }? ^( USED ^( ID ( $id0)? ) $id2 ^( ID ) ^( TIME ) optionalAttributeValuePairs ) -> {$id1.tree!=null && $tt.tree==null}? ^( USED ^( ID ( $id0)? ) $id2 $id1 ^( TIME ) optionalAttributeValuePairs ) -> ^( USED ^( ID ( $id0)? ) $id2 $id1 time optionalAttributeValuePairs ) ;
	public final PROV_NParser.usageExpression_return usageExpression() throws RecognitionException {
		PROV_NParser.usageExpression_return retval = new PROV_NParser.usageExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal71=null;
		Token char_literal72=null;
		Token char_literal73=null;
		Token char_literal74=null;
		Token char_literal75=null;
		Token char_literal77=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope id2 =null;
		ParserRuleReturnScope id1 =null;
		ParserRuleReturnScope tt =null;
		ParserRuleReturnScope optionalAttributeValuePairs76 =null;

		Object string_literal71_tree=null;
		Object char_literal72_tree=null;
		Object char_literal73_tree=null;
		Object char_literal74_tree=null;
		Object char_literal75_tree=null;
		Object char_literal77_tree=null;
		RewriteRuleTokenStream stream_113=new RewriteRuleTokenStream(adaptor,"token 113");
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleTokenStream stream_MINUS=new RewriteRuleTokenStream(adaptor,"token MINUS");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_identifierOrMarker=new RewriteRuleSubtreeStream(adaptor,"rule identifierOrMarker");
		RewriteRuleSubtreeStream stream_time=new RewriteRuleSubtreeStream(adaptor,"rule time");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:199:2: ( 'used' '(' id0= optionalIdentifier id2= identifier ( ',' id1= identifierOrMarker ',' (tt= time | '-' ) )? optionalAttributeValuePairs ')' -> {$id1.tree==null }? ^( USED ^( ID ( $id0)? ) $id2 ^( ID ) ^( TIME ) optionalAttributeValuePairs ) -> {$id1.tree!=null && $tt.tree==null}? ^( USED ^( ID ( $id0)? ) $id2 $id1 ^( TIME ) optionalAttributeValuePairs ) -> ^( USED ^( ID ( $id0)? ) $id2 $id1 time optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:199:4: 'used' '(' id0= optionalIdentifier id2= identifier ( ',' id1= identifierOrMarker ',' (tt= time | '-' ) )? optionalAttributeValuePairs ')'
			{
			string_literal71=(Token)match(input,113,FOLLOW_113_in_usageExpression1421);  
			stream_113.add(string_literal71);

			char_literal72=(Token)match(input,91,FOLLOW_91_in_usageExpression1423);  
			stream_91.add(char_literal72);

			pushFollow(FOLLOW_optionalIdentifier_in_usageExpression1427);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_identifier_in_usageExpression1432);
			id2=identifier();
			state._fsp--;

			stream_identifier.add(id2.getTree());
			// org/openprovenance/prov/notation/PROV_N.g:199:54: ( ',' id1= identifierOrMarker ',' (tt= time | '-' ) )?
			int alt19=2;
			int LA19_0 = input.LA(1);
			if ( (LA19_0==93) ) {
				int LA19_1 = input.LA(2);
				if ( (LA19_1==MINUS||LA19_1==QUALIFIED_NAME) ) {
					alt19=1;
				}
			}
			switch (alt19) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:199:55: ',' id1= identifierOrMarker ',' (tt= time | '-' )
					{
					char_literal73=(Token)match(input,93,FOLLOW_93_in_usageExpression1435);  
					stream_93.add(char_literal73);

					pushFollow(FOLLOW_identifierOrMarker_in_usageExpression1439);
					id1=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(id1.getTree());
					char_literal74=(Token)match(input,93,FOLLOW_93_in_usageExpression1441);  
					stream_93.add(char_literal74);

					// org/openprovenance/prov/notation/PROV_N.g:199:86: (tt= time | '-' )
					int alt18=2;
					int LA18_0 = input.LA(1);
					if ( (LA18_0==DateTime) ) {
						alt18=1;
					}
					else if ( (LA18_0==MINUS) ) {
						alt18=2;
					}

					else {
						NoViableAltException nvae =
							new NoViableAltException("", 18, 0, input);
						throw nvae;
					}

					switch (alt18) {
						case 1 :
							// org/openprovenance/prov/notation/PROV_N.g:199:88: tt= time
							{
							pushFollow(FOLLOW_time_in_usageExpression1447);
							tt=time();
							state._fsp--;

							stream_time.add(tt.getTree());
							}
							break;
						case 2 :
							// org/openprovenance/prov/notation/PROV_N.g:199:98: '-'
							{
							char_literal75=(Token)match(input,MINUS,FOLLOW_MINUS_in_usageExpression1451);  
							stream_MINUS.add(char_literal75);

							}
							break;

					}

					}
					break;

			}

			pushFollow(FOLLOW_optionalAttributeValuePairs_in_usageExpression1457);
			optionalAttributeValuePairs76=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs76.getTree());
			char_literal77=(Token)match(input,92,FOLLOW_92_in_usageExpression1459);  
			stream_92.add(char_literal77);

			// AST REWRITE
			// elements: id2, id1, optionalAttributeValuePairs, id2, id0, optionalAttributeValuePairs, optionalAttributeValuePairs, id1, id0, id0, id2, time
			// token labels: 
			// rule labels: id0, id2, id1, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_id2=new RewriteRuleSubtreeStream(adaptor,"rule id2",id2!=null?id2.getTree():null);
			RewriteRuleSubtreeStream stream_id1=new RewriteRuleSubtreeStream(adaptor,"rule id1",id1!=null?id1.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 200:7: -> {$id1.tree==null }? ^( USED ^( ID ( $id0)? ) $id2 ^( ID ) ^( TIME ) optionalAttributeValuePairs )
			if ((id1!=null?((Object)id1.getTree()):null)==null ) {
				// org/openprovenance/prov/notation/PROV_N.g:201:10: ^( USED ^( ID ( $id0)? ) $id2 ^( ID ) ^( TIME ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(USED, "USED"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:201:17: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:201:23: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:201:35: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:201:41: ^( TIME )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(TIME, "TIME"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 202:7: -> {$id1.tree!=null && $tt.tree==null}? ^( USED ^( ID ( $id0)? ) $id2 $id1 ^( TIME ) optionalAttributeValuePairs )
			if ((id1!=null?((Object)id1.getTree()):null)!=null && (tt!=null?((Object)tt.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:203:10: ^( USED ^( ID ( $id0)? ) $id2 $id1 ^( TIME ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(USED, "USED"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:203:17: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:203:23: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:203:40: ^( TIME )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(TIME, "TIME"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 204:7: -> ^( USED ^( ID ( $id0)? ) $id2 $id1 time optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:204:10: ^( USED ^( ID ( $id0)? ) $id2 $id1 time optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(USED, "USED"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:204:17: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:204:23: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				adaptor.addChild(root_1, stream_time.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "usageExpression"


	public static class startExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "startExpression"
	// org/openprovenance/prov/notation/PROV_N.g:206:1: startExpression : 'wasStartedBy' '(' id0= optionalIdentifier id2= identifier ( ',' id1= identifierOrMarker ',' id3= identifierOrMarker ',' (tt= time | '-' ) )? optionalAttributeValuePairs ')' -> {$id1.tree==null}? ^( WSB ^( ID ( $id0)? ) $id2 ^( ID ) ^( ID ) ^( TIME ) optionalAttributeValuePairs ) -> {$id1.tree!=null && $tt.tree==null}? ^( WSB ^( ID ( $id0)? ) $id2 $id1 $id3 ^( TIME ) optionalAttributeValuePairs ) -> ^( WSB ^( ID ( $id0)? ) $id2 $id1 $id3 time optionalAttributeValuePairs ) ;
	public final PROV_NParser.startExpression_return startExpression() throws RecognitionException {
		PROV_NParser.startExpression_return retval = new PROV_NParser.startExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal78=null;
		Token char_literal79=null;
		Token char_literal80=null;
		Token char_literal81=null;
		Token char_literal82=null;
		Token char_literal83=null;
		Token char_literal85=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope id2 =null;
		ParserRuleReturnScope id1 =null;
		ParserRuleReturnScope id3 =null;
		ParserRuleReturnScope tt =null;
		ParserRuleReturnScope optionalAttributeValuePairs84 =null;

		Object string_literal78_tree=null;
		Object char_literal79_tree=null;
		Object char_literal80_tree=null;
		Object char_literal81_tree=null;
		Object char_literal82_tree=null;
		Object char_literal83_tree=null;
		Object char_literal85_tree=null;
		RewriteRuleTokenStream stream_124=new RewriteRuleTokenStream(adaptor,"token 124");
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleTokenStream stream_MINUS=new RewriteRuleTokenStream(adaptor,"token MINUS");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_identifierOrMarker=new RewriteRuleSubtreeStream(adaptor,"rule identifierOrMarker");
		RewriteRuleSubtreeStream stream_time=new RewriteRuleSubtreeStream(adaptor,"rule time");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:207:2: ( 'wasStartedBy' '(' id0= optionalIdentifier id2= identifier ( ',' id1= identifierOrMarker ',' id3= identifierOrMarker ',' (tt= time | '-' ) )? optionalAttributeValuePairs ')' -> {$id1.tree==null}? ^( WSB ^( ID ( $id0)? ) $id2 ^( ID ) ^( ID ) ^( TIME ) optionalAttributeValuePairs ) -> {$id1.tree!=null && $tt.tree==null}? ^( WSB ^( ID ( $id0)? ) $id2 $id1 $id3 ^( TIME ) optionalAttributeValuePairs ) -> ^( WSB ^( ID ( $id0)? ) $id2 $id1 $id3 time optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:207:4: 'wasStartedBy' '(' id0= optionalIdentifier id2= identifier ( ',' id1= identifierOrMarker ',' id3= identifierOrMarker ',' (tt= time | '-' ) )? optionalAttributeValuePairs ')'
			{
			string_literal78=(Token)match(input,124,FOLLOW_124_in_startExpression1591);  
			stream_124.add(string_literal78);

			char_literal79=(Token)match(input,91,FOLLOW_91_in_startExpression1593);  
			stream_91.add(char_literal79);

			pushFollow(FOLLOW_optionalIdentifier_in_startExpression1597);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_identifier_in_startExpression1601);
			id2=identifier();
			state._fsp--;

			stream_identifier.add(id2.getTree());
			// org/openprovenance/prov/notation/PROV_N.g:207:61: ( ',' id1= identifierOrMarker ',' id3= identifierOrMarker ',' (tt= time | '-' ) )?
			int alt21=2;
			int LA21_0 = input.LA(1);
			if ( (LA21_0==93) ) {
				int LA21_1 = input.LA(2);
				if ( (LA21_1==MINUS||LA21_1==QUALIFIED_NAME) ) {
					alt21=1;
				}
			}
			switch (alt21) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:207:62: ',' id1= identifierOrMarker ',' id3= identifierOrMarker ',' (tt= time | '-' )
					{
					char_literal80=(Token)match(input,93,FOLLOW_93_in_startExpression1604);  
					stream_93.add(char_literal80);

					pushFollow(FOLLOW_identifierOrMarker_in_startExpression1608);
					id1=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(id1.getTree());
					char_literal81=(Token)match(input,93,FOLLOW_93_in_startExpression1610);  
					stream_93.add(char_literal81);

					pushFollow(FOLLOW_identifierOrMarker_in_startExpression1614);
					id3=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(id3.getTree());
					char_literal82=(Token)match(input,93,FOLLOW_93_in_startExpression1616);  
					stream_93.add(char_literal82);

					// org/openprovenance/prov/notation/PROV_N.g:207:120: (tt= time | '-' )
					int alt20=2;
					int LA20_0 = input.LA(1);
					if ( (LA20_0==DateTime) ) {
						alt20=1;
					}
					else if ( (LA20_0==MINUS) ) {
						alt20=2;
					}

					else {
						NoViableAltException nvae =
							new NoViableAltException("", 20, 0, input);
						throw nvae;
					}

					switch (alt20) {
						case 1 :
							// org/openprovenance/prov/notation/PROV_N.g:207:122: tt= time
							{
							pushFollow(FOLLOW_time_in_startExpression1622);
							tt=time();
							state._fsp--;

							stream_time.add(tt.getTree());
							}
							break;
						case 2 :
							// org/openprovenance/prov/notation/PROV_N.g:207:132: '-'
							{
							char_literal83=(Token)match(input,MINUS,FOLLOW_MINUS_in_startExpression1626);  
							stream_MINUS.add(char_literal83);

							}
							break;

					}

					}
					break;

			}

			pushFollow(FOLLOW_optionalAttributeValuePairs_in_startExpression1632);
			optionalAttributeValuePairs84=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs84.getTree());
			char_literal85=(Token)match(input,92,FOLLOW_92_in_startExpression1634);  
			stream_92.add(char_literal85);

			// AST REWRITE
			// elements: id0, optionalAttributeValuePairs, id0, id2, id2, id2, id3, time, optionalAttributeValuePairs, optionalAttributeValuePairs, id1, id0, id1, id3
			// token labels: 
			// rule labels: id0, id2, id1, id3, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_id2=new RewriteRuleSubtreeStream(adaptor,"rule id2",id2!=null?id2.getTree():null);
			RewriteRuleSubtreeStream stream_id1=new RewriteRuleSubtreeStream(adaptor,"rule id1",id1!=null?id1.getTree():null);
			RewriteRuleSubtreeStream stream_id3=new RewriteRuleSubtreeStream(adaptor,"rule id3",id3!=null?id3.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 208:7: -> {$id1.tree==null}? ^( WSB ^( ID ( $id0)? ) $id2 ^( ID ) ^( ID ) ^( TIME ) optionalAttributeValuePairs )
			if ((id1!=null?((Object)id1.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:209:10: ^( WSB ^( ID ( $id0)? ) $id2 ^( ID ) ^( ID ) ^( TIME ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WSB, "WSB"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:209:16: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:209:22: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:209:33: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:209:39: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:209:45: ^( TIME )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(TIME, "TIME"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 210:7: -> {$id1.tree!=null && $tt.tree==null}? ^( WSB ^( ID ( $id0)? ) $id2 $id1 $id3 ^( TIME ) optionalAttributeValuePairs )
			if ((id1!=null?((Object)id1.getTree()):null)!=null && (tt!=null?((Object)tt.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:211:10: ^( WSB ^( ID ( $id0)? ) $id2 $id1 $id3 ^( TIME ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WSB, "WSB"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:211:16: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:211:22: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				adaptor.addChild(root_1, stream_id3.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:211:43: ^( TIME )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(TIME, "TIME"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 212:7: -> ^( WSB ^( ID ( $id0)? ) $id2 $id1 $id3 time optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:212:10: ^( WSB ^( ID ( $id0)? ) $id2 $id1 $id3 time optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WSB, "WSB"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:212:16: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:212:22: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				adaptor.addChild(root_1, stream_id3.nextTree());
				adaptor.addChild(root_1, stream_time.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "startExpression"


	public static class endExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "endExpression"
	// org/openprovenance/prov/notation/PROV_N.g:215:1: endExpression : 'wasEndedBy' '(' id0= optionalIdentifier id2= identifier ( ',' id1= identifierOrMarker ',' id3= identifierOrMarker ',' (tt= time | '-' ) )? optionalAttributeValuePairs ')' -> {$id1.tree==null}? ^( WEB ^( ID ( $id0)? ) $id2 ^( ID ) ^( ID ) ^( TIME ) optionalAttributeValuePairs ) -> {$id1.tree!=null && $tt.tree==null}? ^( WEB ^( ID ( $id0)? ) $id2 $id1 $id3 ^( TIME ) optionalAttributeValuePairs ) -> ^( WEB ^( ID ( $id0)? ) $id2 $id1 $id3 time optionalAttributeValuePairs ) ;
	public final PROV_NParser.endExpression_return endExpression() throws RecognitionException {
		PROV_NParser.endExpression_return retval = new PROV_NParser.endExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal86=null;
		Token char_literal87=null;
		Token char_literal88=null;
		Token char_literal89=null;
		Token char_literal90=null;
		Token char_literal91=null;
		Token char_literal93=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope id2 =null;
		ParserRuleReturnScope id1 =null;
		ParserRuleReturnScope id3 =null;
		ParserRuleReturnScope tt =null;
		ParserRuleReturnScope optionalAttributeValuePairs92 =null;

		Object string_literal86_tree=null;
		Object char_literal87_tree=null;
		Object char_literal88_tree=null;
		Object char_literal89_tree=null;
		Object char_literal90_tree=null;
		Object char_literal91_tree=null;
		Object char_literal93_tree=null;
		RewriteRuleTokenStream stream_117=new RewriteRuleTokenStream(adaptor,"token 117");
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleTokenStream stream_MINUS=new RewriteRuleTokenStream(adaptor,"token MINUS");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_identifierOrMarker=new RewriteRuleSubtreeStream(adaptor,"rule identifierOrMarker");
		RewriteRuleSubtreeStream stream_time=new RewriteRuleSubtreeStream(adaptor,"rule time");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:216:2: ( 'wasEndedBy' '(' id0= optionalIdentifier id2= identifier ( ',' id1= identifierOrMarker ',' id3= identifierOrMarker ',' (tt= time | '-' ) )? optionalAttributeValuePairs ')' -> {$id1.tree==null}? ^( WEB ^( ID ( $id0)? ) $id2 ^( ID ) ^( ID ) ^( TIME ) optionalAttributeValuePairs ) -> {$id1.tree!=null && $tt.tree==null}? ^( WEB ^( ID ( $id0)? ) $id2 $id1 $id3 ^( TIME ) optionalAttributeValuePairs ) -> ^( WEB ^( ID ( $id0)? ) $id2 $id1 $id3 time optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:216:4: 'wasEndedBy' '(' id0= optionalIdentifier id2= identifier ( ',' id1= identifierOrMarker ',' id3= identifierOrMarker ',' (tt= time | '-' ) )? optionalAttributeValuePairs ')'
			{
			string_literal86=(Token)match(input,117,FOLLOW_117_in_endExpression1777);  
			stream_117.add(string_literal86);

			char_literal87=(Token)match(input,91,FOLLOW_91_in_endExpression1779);  
			stream_91.add(char_literal87);

			pushFollow(FOLLOW_optionalIdentifier_in_endExpression1783);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_identifier_in_endExpression1787);
			id2=identifier();
			state._fsp--;

			stream_identifier.add(id2.getTree());
			// org/openprovenance/prov/notation/PROV_N.g:216:59: ( ',' id1= identifierOrMarker ',' id3= identifierOrMarker ',' (tt= time | '-' ) )?
			int alt23=2;
			int LA23_0 = input.LA(1);
			if ( (LA23_0==93) ) {
				int LA23_1 = input.LA(2);
				if ( (LA23_1==MINUS||LA23_1==QUALIFIED_NAME) ) {
					alt23=1;
				}
			}
			switch (alt23) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:216:60: ',' id1= identifierOrMarker ',' id3= identifierOrMarker ',' (tt= time | '-' )
					{
					char_literal88=(Token)match(input,93,FOLLOW_93_in_endExpression1790);  
					stream_93.add(char_literal88);

					pushFollow(FOLLOW_identifierOrMarker_in_endExpression1794);
					id1=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(id1.getTree());
					char_literal89=(Token)match(input,93,FOLLOW_93_in_endExpression1796);  
					stream_93.add(char_literal89);

					pushFollow(FOLLOW_identifierOrMarker_in_endExpression1800);
					id3=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(id3.getTree());
					char_literal90=(Token)match(input,93,FOLLOW_93_in_endExpression1802);  
					stream_93.add(char_literal90);

					// org/openprovenance/prov/notation/PROV_N.g:216:118: (tt= time | '-' )
					int alt22=2;
					int LA22_0 = input.LA(1);
					if ( (LA22_0==DateTime) ) {
						alt22=1;
					}
					else if ( (LA22_0==MINUS) ) {
						alt22=2;
					}

					else {
						NoViableAltException nvae =
							new NoViableAltException("", 22, 0, input);
						throw nvae;
					}

					switch (alt22) {
						case 1 :
							// org/openprovenance/prov/notation/PROV_N.g:216:120: tt= time
							{
							pushFollow(FOLLOW_time_in_endExpression1808);
							tt=time();
							state._fsp--;

							stream_time.add(tt.getTree());
							}
							break;
						case 2 :
							// org/openprovenance/prov/notation/PROV_N.g:216:130: '-'
							{
							char_literal91=(Token)match(input,MINUS,FOLLOW_MINUS_in_endExpression1812);  
							stream_MINUS.add(char_literal91);

							}
							break;

					}

					}
					break;

			}

			pushFollow(FOLLOW_optionalAttributeValuePairs_in_endExpression1818);
			optionalAttributeValuePairs92=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs92.getTree());
			char_literal93=(Token)match(input,92,FOLLOW_92_in_endExpression1820);  
			stream_92.add(char_literal93);

			// AST REWRITE
			// elements: id0, optionalAttributeValuePairs, id3, optionalAttributeValuePairs, id1, id0, time, id2, id2, id0, optionalAttributeValuePairs, id1, id2, id3
			// token labels: 
			// rule labels: id0, id2, id1, id3, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_id2=new RewriteRuleSubtreeStream(adaptor,"rule id2",id2!=null?id2.getTree():null);
			RewriteRuleSubtreeStream stream_id1=new RewriteRuleSubtreeStream(adaptor,"rule id1",id1!=null?id1.getTree():null);
			RewriteRuleSubtreeStream stream_id3=new RewriteRuleSubtreeStream(adaptor,"rule id3",id3!=null?id3.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 217:7: -> {$id1.tree==null}? ^( WEB ^( ID ( $id0)? ) $id2 ^( ID ) ^( ID ) ^( TIME ) optionalAttributeValuePairs )
			if ((id1!=null?((Object)id1.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:218:9: ^( WEB ^( ID ( $id0)? ) $id2 ^( ID ) ^( ID ) ^( TIME ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WEB, "WEB"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:218:15: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:218:21: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:218:32: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:218:38: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:218:44: ^( TIME )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(TIME, "TIME"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 219:7: -> {$id1.tree!=null && $tt.tree==null}? ^( WEB ^( ID ( $id0)? ) $id2 $id1 $id3 ^( TIME ) optionalAttributeValuePairs )
			if ((id1!=null?((Object)id1.getTree()):null)!=null && (tt!=null?((Object)tt.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:220:9: ^( WEB ^( ID ( $id0)? ) $id2 $id1 $id3 ^( TIME ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WEB, "WEB"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:220:15: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:220:21: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				adaptor.addChild(root_1, stream_id3.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:220:42: ^( TIME )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(TIME, "TIME"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 221:7: -> ^( WEB ^( ID ( $id0)? ) $id2 $id1 $id3 time optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:221:10: ^( WEB ^( ID ( $id0)? ) $id2 $id1 $id3 time optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WEB, "WEB"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:221:16: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:221:22: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				adaptor.addChild(root_1, stream_id3.nextTree());
				adaptor.addChild(root_1, stream_time.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "endExpression"


	public static class invalidationExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "invalidationExpression"
	// org/openprovenance/prov/notation/PROV_N.g:226:1: invalidationExpression : 'wasInvalidatedBy' '(' id0= optionalIdentifier id2= identifier ( ',' id1= identifierOrMarker ',' (tt= time | '-' ) )? optionalAttributeValuePairs ')' -> {$id1.tree==null }? ^( WINVB ^( ID ( $id0)? ) $id2 ^( ID ) ^( TIME ) optionalAttributeValuePairs ) -> {$id1.tree!=null && $tt.tree==null}? ^( WINVB ^( ID ( $id0)? ) $id2 $id1 ^( TIME ) optionalAttributeValuePairs ) -> ^( WINVB ^( ID ( $id0)? ) $id2 $id1 time optionalAttributeValuePairs ) ;
	public final PROV_NParser.invalidationExpression_return invalidationExpression() throws RecognitionException {
		PROV_NParser.invalidationExpression_return retval = new PROV_NParser.invalidationExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal94=null;
		Token char_literal95=null;
		Token char_literal96=null;
		Token char_literal97=null;
		Token char_literal98=null;
		Token char_literal100=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope id2 =null;
		ParserRuleReturnScope id1 =null;
		ParserRuleReturnScope tt =null;
		ParserRuleReturnScope optionalAttributeValuePairs99 =null;

		Object string_literal94_tree=null;
		Object char_literal95_tree=null;
		Object char_literal96_tree=null;
		Object char_literal97_tree=null;
		Object char_literal98_tree=null;
		Object char_literal100_tree=null;
		RewriteRuleTokenStream stream_121=new RewriteRuleTokenStream(adaptor,"token 121");
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleTokenStream stream_MINUS=new RewriteRuleTokenStream(adaptor,"token MINUS");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_identifierOrMarker=new RewriteRuleSubtreeStream(adaptor,"rule identifierOrMarker");
		RewriteRuleSubtreeStream stream_time=new RewriteRuleSubtreeStream(adaptor,"rule time");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:227:2: ( 'wasInvalidatedBy' '(' id0= optionalIdentifier id2= identifier ( ',' id1= identifierOrMarker ',' (tt= time | '-' ) )? optionalAttributeValuePairs ')' -> {$id1.tree==null }? ^( WINVB ^( ID ( $id0)? ) $id2 ^( ID ) ^( TIME ) optionalAttributeValuePairs ) -> {$id1.tree!=null && $tt.tree==null}? ^( WINVB ^( ID ( $id0)? ) $id2 $id1 ^( TIME ) optionalAttributeValuePairs ) -> ^( WINVB ^( ID ( $id0)? ) $id2 $id1 time optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:227:4: 'wasInvalidatedBy' '(' id0= optionalIdentifier id2= identifier ( ',' id1= identifierOrMarker ',' (tt= time | '-' ) )? optionalAttributeValuePairs ')'
			{
			string_literal94=(Token)match(input,121,FOLLOW_121_in_invalidationExpression1963);  
			stream_121.add(string_literal94);

			char_literal95=(Token)match(input,91,FOLLOW_91_in_invalidationExpression1965);  
			stream_91.add(char_literal95);

			pushFollow(FOLLOW_optionalIdentifier_in_invalidationExpression1969);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_identifier_in_invalidationExpression1973);
			id2=identifier();
			state._fsp--;

			stream_identifier.add(id2.getTree());
			// org/openprovenance/prov/notation/PROV_N.g:227:65: ( ',' id1= identifierOrMarker ',' (tt= time | '-' ) )?
			int alt25=2;
			int LA25_0 = input.LA(1);
			if ( (LA25_0==93) ) {
				int LA25_1 = input.LA(2);
				if ( (LA25_1==MINUS||LA25_1==QUALIFIED_NAME) ) {
					alt25=1;
				}
			}
			switch (alt25) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:227:66: ',' id1= identifierOrMarker ',' (tt= time | '-' )
					{
					char_literal96=(Token)match(input,93,FOLLOW_93_in_invalidationExpression1976);  
					stream_93.add(char_literal96);

					pushFollow(FOLLOW_identifierOrMarker_in_invalidationExpression1980);
					id1=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(id1.getTree());
					char_literal97=(Token)match(input,93,FOLLOW_93_in_invalidationExpression1982);  
					stream_93.add(char_literal97);

					// org/openprovenance/prov/notation/PROV_N.g:227:97: (tt= time | '-' )
					int alt24=2;
					int LA24_0 = input.LA(1);
					if ( (LA24_0==DateTime) ) {
						alt24=1;
					}
					else if ( (LA24_0==MINUS) ) {
						alt24=2;
					}

					else {
						NoViableAltException nvae =
							new NoViableAltException("", 24, 0, input);
						throw nvae;
					}

					switch (alt24) {
						case 1 :
							// org/openprovenance/prov/notation/PROV_N.g:227:99: tt= time
							{
							pushFollow(FOLLOW_time_in_invalidationExpression1988);
							tt=time();
							state._fsp--;

							stream_time.add(tt.getTree());
							}
							break;
						case 2 :
							// org/openprovenance/prov/notation/PROV_N.g:227:109: '-'
							{
							char_literal98=(Token)match(input,MINUS,FOLLOW_MINUS_in_invalidationExpression1992);  
							stream_MINUS.add(char_literal98);

							}
							break;

					}

					}
					break;

			}

			pushFollow(FOLLOW_optionalAttributeValuePairs_in_invalidationExpression1998);
			optionalAttributeValuePairs99=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs99.getTree());
			char_literal100=(Token)match(input,92,FOLLOW_92_in_invalidationExpression2000);  
			stream_92.add(char_literal100);

			// AST REWRITE
			// elements: id0, optionalAttributeValuePairs, id2, id1, id0, id2, id1, id2, time, optionalAttributeValuePairs, optionalAttributeValuePairs, id0
			// token labels: 
			// rule labels: id0, id2, id1, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_id2=new RewriteRuleSubtreeStream(adaptor,"rule id2",id2!=null?id2.getTree():null);
			RewriteRuleSubtreeStream stream_id1=new RewriteRuleSubtreeStream(adaptor,"rule id1",id1!=null?id1.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 228:7: -> {$id1.tree==null }? ^( WINVB ^( ID ( $id0)? ) $id2 ^( ID ) ^( TIME ) optionalAttributeValuePairs )
			if ((id1!=null?((Object)id1.getTree()):null)==null ) {
				// org/openprovenance/prov/notation/PROV_N.g:229:10: ^( WINVB ^( ID ( $id0)? ) $id2 ^( ID ) ^( TIME ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WINVB, "WINVB"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:229:18: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:229:24: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:229:35: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:229:42: ^( TIME )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(TIME, "TIME"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 230:7: -> {$id1.tree!=null && $tt.tree==null}? ^( WINVB ^( ID ( $id0)? ) $id2 $id1 ^( TIME ) optionalAttributeValuePairs )
			if ((id1!=null?((Object)id1.getTree()):null)!=null && (tt!=null?((Object)tt.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:231:10: ^( WINVB ^( ID ( $id0)? ) $id2 $id1 ^( TIME ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WINVB, "WINVB"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:231:18: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:231:24: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:231:41: ^( TIME )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(TIME, "TIME"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 232:7: -> ^( WINVB ^( ID ( $id0)? ) $id2 $id1 time optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:232:10: ^( WINVB ^( ID ( $id0)? ) $id2 $id1 time optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WINVB, "WINVB"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:232:18: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:232:24: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				adaptor.addChild(root_1, stream_time.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "invalidationExpression"


	public static class communicationExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "communicationExpression"
	// org/openprovenance/prov/notation/PROV_N.g:236:1: communicationExpression : 'wasInformedBy' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier optionalAttributeValuePairs ')' -> ^( WIB ^( ID ( $id0)? ) $id2 $id1 optionalAttributeValuePairs ) ;
	public final PROV_NParser.communicationExpression_return communicationExpression() throws RecognitionException {
		PROV_NParser.communicationExpression_return retval = new PROV_NParser.communicationExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal101=null;
		Token char_literal102=null;
		Token char_literal103=null;
		Token char_literal105=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope id2 =null;
		ParserRuleReturnScope id1 =null;
		ParserRuleReturnScope optionalAttributeValuePairs104 =null;

		Object string_literal101_tree=null;
		Object char_literal102_tree=null;
		Object char_literal103_tree=null;
		Object char_literal105_tree=null;
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleTokenStream stream_120=new RewriteRuleTokenStream(adaptor,"token 120");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:237:2: ( 'wasInformedBy' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier optionalAttributeValuePairs ')' -> ^( WIB ^( ID ( $id0)? ) $id2 $id1 optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:237:4: 'wasInformedBy' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier optionalAttributeValuePairs ')'
			{
			string_literal101=(Token)match(input,120,FOLLOW_120_in_communicationExpression2134);  
			stream_120.add(string_literal101);

			char_literal102=(Token)match(input,91,FOLLOW_91_in_communicationExpression2136);  
			stream_91.add(char_literal102);

			pushFollow(FOLLOW_optionalIdentifier_in_communicationExpression2140);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_identifier_in_communicationExpression2144);
			id2=identifier();
			state._fsp--;

			stream_identifier.add(id2.getTree());
			char_literal103=(Token)match(input,93,FOLLOW_93_in_communicationExpression2146);  
			stream_93.add(char_literal103);

			pushFollow(FOLLOW_identifier_in_communicationExpression2150);
			id1=identifier();
			state._fsp--;

			stream_identifier.add(id1.getTree());
			pushFollow(FOLLOW_optionalAttributeValuePairs_in_communicationExpression2152);
			optionalAttributeValuePairs104=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs104.getTree());
			char_literal105=(Token)match(input,92,FOLLOW_92_in_communicationExpression2154);  
			stream_92.add(char_literal105);

			// AST REWRITE
			// elements: id2, id1, id0, optionalAttributeValuePairs
			// token labels: 
			// rule labels: id0, id2, id1, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_id2=new RewriteRuleSubtreeStream(adaptor,"rule id2",id2!=null?id2.getTree():null);
			RewriteRuleSubtreeStream stream_id1=new RewriteRuleSubtreeStream(adaptor,"rule id1",id1!=null?id1.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 238:7: -> ^( WIB ^( ID ( $id0)? ) $id2 $id1 optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:238:10: ^( WIB ^( ID ( $id0)? ) $id2 $id1 optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WIB, "WIB"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:238:16: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:238:22: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "communicationExpression"


	public static class agentExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "agentExpression"
	// org/openprovenance/prov/notation/PROV_N.g:247:1: agentExpression : 'agent' '(' identifier optionalAttributeValuePairs ')' -> ^( AGENT identifier optionalAttributeValuePairs ) ;
	public final PROV_NParser.agentExpression_return agentExpression() throws RecognitionException {
		PROV_NParser.agentExpression_return retval = new PROV_NParser.agentExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal106=null;
		Token char_literal107=null;
		Token char_literal110=null;
		ParserRuleReturnScope identifier108 =null;
		ParserRuleReturnScope optionalAttributeValuePairs109 =null;

		Object string_literal106_tree=null;
		Object char_literal107_tree=null;
		Object char_literal110_tree=null;
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_97=new RewriteRuleTokenStream(adaptor,"token 97");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:248:2: ( 'agent' '(' identifier optionalAttributeValuePairs ')' -> ^( AGENT identifier optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:248:4: 'agent' '(' identifier optionalAttributeValuePairs ')'
			{
			string_literal106=(Token)match(input,97,FOLLOW_97_in_agentExpression2197);  
			stream_97.add(string_literal106);

			char_literal107=(Token)match(input,91,FOLLOW_91_in_agentExpression2199);  
			stream_91.add(char_literal107);

			pushFollow(FOLLOW_identifier_in_agentExpression2201);
			identifier108=identifier();
			state._fsp--;

			stream_identifier.add(identifier108.getTree());
			pushFollow(FOLLOW_optionalAttributeValuePairs_in_agentExpression2203);
			optionalAttributeValuePairs109=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs109.getTree());
			char_literal110=(Token)match(input,92,FOLLOW_92_in_agentExpression2205);  
			stream_92.add(char_literal110);

			// AST REWRITE
			// elements: optionalAttributeValuePairs, identifier
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 249:9: -> ^( AGENT identifier optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:249:12: ^( AGENT identifier optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(AGENT, "AGENT"), root_1);
				adaptor.addChild(root_1, stream_identifier.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "agentExpression"


	public static class attributionExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "attributionExpression"
	// org/openprovenance/prov/notation/PROV_N.g:252:1: attributionExpression : 'wasAttributedTo' '(' id0= optionalIdentifier e= identifier ',' ag= identifier optionalAttributeValuePairs ')' -> ^( WAT ^( ID ( $id0)? ) $e $ag optionalAttributeValuePairs ) ;
	public final PROV_NParser.attributionExpression_return attributionExpression() throws RecognitionException {
		PROV_NParser.attributionExpression_return retval = new PROV_NParser.attributionExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal111=null;
		Token char_literal112=null;
		Token char_literal113=null;
		Token char_literal115=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope e =null;
		ParserRuleReturnScope ag =null;
		ParserRuleReturnScope optionalAttributeValuePairs114 =null;

		Object string_literal111_tree=null;
		Object char_literal112_tree=null;
		Object char_literal113_tree=null;
		Object char_literal115_tree=null;
		RewriteRuleTokenStream stream_115=new RewriteRuleTokenStream(adaptor,"token 115");
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:253:2: ( 'wasAttributedTo' '(' id0= optionalIdentifier e= identifier ',' ag= identifier optionalAttributeValuePairs ')' -> ^( WAT ^( ID ( $id0)? ) $e $ag optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:253:4: 'wasAttributedTo' '(' id0= optionalIdentifier e= identifier ',' ag= identifier optionalAttributeValuePairs ')'
			{
			string_literal111=(Token)match(input,115,FOLLOW_115_in_attributionExpression2236);  
			stream_115.add(string_literal111);

			char_literal112=(Token)match(input,91,FOLLOW_91_in_attributionExpression2238);  
			stream_91.add(char_literal112);

			pushFollow(FOLLOW_optionalIdentifier_in_attributionExpression2243);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_identifier_in_attributionExpression2247);
			e=identifier();
			state._fsp--;

			stream_identifier.add(e.getTree());
			char_literal113=(Token)match(input,93,FOLLOW_93_in_attributionExpression2249);  
			stream_93.add(char_literal113);

			pushFollow(FOLLOW_identifier_in_attributionExpression2253);
			ag=identifier();
			state._fsp--;

			stream_identifier.add(ag.getTree());
			pushFollow(FOLLOW_optionalAttributeValuePairs_in_attributionExpression2255);
			optionalAttributeValuePairs114=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs114.getTree());
			char_literal115=(Token)match(input,92,FOLLOW_92_in_attributionExpression2257);  
			stream_92.add(char_literal115);

			// AST REWRITE
			// elements: optionalAttributeValuePairs, id0, ag, e
			// token labels: 
			// rule labels: id0, e, ag, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_e=new RewriteRuleSubtreeStream(adaptor,"rule e",e!=null?e.getTree():null);
			RewriteRuleSubtreeStream stream_ag=new RewriteRuleSubtreeStream(adaptor,"rule ag",ag!=null?ag.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 254:7: -> ^( WAT ^( ID ( $id0)? ) $e $ag optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:254:10: ^( WAT ^( ID ( $id0)? ) $e $ag optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WAT, "WAT"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:254:17: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:254:23: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_e.nextTree());
				adaptor.addChild(root_1, stream_ag.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "attributionExpression"


	public static class associationExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "associationExpression"
	// org/openprovenance/prov/notation/PROV_N.g:257:1: associationExpression : 'wasAssociatedWith' '(' id0= optionalIdentifier a= identifier ( ',' ag= identifierOrMarker ',' pl= identifierOrMarker )? optionalAttributeValuePairs ')' -> {$pl.tree==null}? ^( WAW ^( ID ( $id0)? ) $a ( $ag)? ^( ID ) optionalAttributeValuePairs ) -> {$ag.tree==null}? ^( WAW ^( ID ( $id0)? ) $a ^( ID ) $pl optionalAttributeValuePairs ) -> ^( WAW ^( ID ( $id0)? ) $a ( $ag)? $pl optionalAttributeValuePairs ) ;
	public final PROV_NParser.associationExpression_return associationExpression() throws RecognitionException {
		PROV_NParser.associationExpression_return retval = new PROV_NParser.associationExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal116=null;
		Token char_literal117=null;
		Token char_literal118=null;
		Token char_literal119=null;
		Token char_literal121=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope a =null;
		ParserRuleReturnScope ag =null;
		ParserRuleReturnScope pl =null;
		ParserRuleReturnScope optionalAttributeValuePairs120 =null;

		Object string_literal116_tree=null;
		Object char_literal117_tree=null;
		Object char_literal118_tree=null;
		Object char_literal119_tree=null;
		Object char_literal121_tree=null;
		RewriteRuleTokenStream stream_114=new RewriteRuleTokenStream(adaptor,"token 114");
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_identifierOrMarker=new RewriteRuleSubtreeStream(adaptor,"rule identifierOrMarker");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:258:2: ( 'wasAssociatedWith' '(' id0= optionalIdentifier a= identifier ( ',' ag= identifierOrMarker ',' pl= identifierOrMarker )? optionalAttributeValuePairs ')' -> {$pl.tree==null}? ^( WAW ^( ID ( $id0)? ) $a ( $ag)? ^( ID ) optionalAttributeValuePairs ) -> {$ag.tree==null}? ^( WAW ^( ID ( $id0)? ) $a ^( ID ) $pl optionalAttributeValuePairs ) -> ^( WAW ^( ID ( $id0)? ) $a ( $ag)? $pl optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:258:4: 'wasAssociatedWith' '(' id0= optionalIdentifier a= identifier ( ',' ag= identifierOrMarker ',' pl= identifierOrMarker )? optionalAttributeValuePairs ')'
			{
			string_literal116=(Token)match(input,114,FOLLOW_114_in_associationExpression2297);  
			stream_114.add(string_literal116);

			char_literal117=(Token)match(input,91,FOLLOW_91_in_associationExpression2299);  
			stream_91.add(char_literal117);

			pushFollow(FOLLOW_optionalIdentifier_in_associationExpression2304);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_identifier_in_associationExpression2308);
			a=identifier();
			state._fsp--;

			stream_identifier.add(a.getTree());
			// org/openprovenance/prov/notation/PROV_N.g:258:65: ( ',' ag= identifierOrMarker ',' pl= identifierOrMarker )?
			int alt26=2;
			int LA26_0 = input.LA(1);
			if ( (LA26_0==93) ) {
				int LA26_1 = input.LA(2);
				if ( (LA26_1==MINUS||LA26_1==QUALIFIED_NAME) ) {
					alt26=1;
				}
			}
			switch (alt26) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:258:66: ',' ag= identifierOrMarker ',' pl= identifierOrMarker
					{
					char_literal118=(Token)match(input,93,FOLLOW_93_in_associationExpression2311);  
					stream_93.add(char_literal118);

					pushFollow(FOLLOW_identifierOrMarker_in_associationExpression2315);
					ag=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(ag.getTree());
					char_literal119=(Token)match(input,93,FOLLOW_93_in_associationExpression2317);  
					stream_93.add(char_literal119);

					pushFollow(FOLLOW_identifierOrMarker_in_associationExpression2321);
					pl=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(pl.getTree());
					}
					break;

			}

			pushFollow(FOLLOW_optionalAttributeValuePairs_in_associationExpression2325);
			optionalAttributeValuePairs120=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs120.getTree());
			char_literal121=(Token)match(input,92,FOLLOW_92_in_associationExpression2327);  
			stream_92.add(char_literal121);

			// AST REWRITE
			// elements: id0, id0, optionalAttributeValuePairs, id0, pl, ag, optionalAttributeValuePairs, a, a, ag, a, optionalAttributeValuePairs, pl
			// token labels: 
			// rule labels: a, id0, ag, pl, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_a=new RewriteRuleSubtreeStream(adaptor,"rule a",a!=null?a.getTree():null);
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_ag=new RewriteRuleSubtreeStream(adaptor,"rule ag",ag!=null?ag.getTree():null);
			RewriteRuleSubtreeStream stream_pl=new RewriteRuleSubtreeStream(adaptor,"rule pl",pl!=null?pl.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 259:7: -> {$pl.tree==null}? ^( WAW ^( ID ( $id0)? ) $a ( $ag)? ^( ID ) optionalAttributeValuePairs )
			if ((pl!=null?((Object)pl.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:259:28: ^( WAW ^( ID ( $id0)? ) $a ( $ag)? ^( ID ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WAW, "WAW"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:259:34: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:259:40: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_a.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:259:50: ( $ag)?
				if ( stream_ag.hasNext() ) {
					adaptor.addChild(root_1, stream_ag.nextTree());
				}
				stream_ag.reset();

				// org/openprovenance/prov/notation/PROV_N.g:259:54: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 260:7: -> {$ag.tree==null}? ^( WAW ^( ID ( $id0)? ) $a ^( ID ) $pl optionalAttributeValuePairs )
			if ((ag!=null?((Object)ag.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:260:28: ^( WAW ^( ID ( $id0)? ) $a ^( ID ) $pl optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WAW, "WAW"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:260:34: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:260:40: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_a.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:260:49: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_pl.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 261:7: -> ^( WAW ^( ID ( $id0)? ) $a ( $ag)? $pl optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:261:10: ^( WAW ^( ID ( $id0)? ) $a ( $ag)? $pl optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WAW, "WAW"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:261:16: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:261:22: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_a.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:261:32: ( $ag)?
				if ( stream_ag.hasNext() ) {
					adaptor.addChild(root_1, stream_ag.nextTree());
				}
				stream_ag.reset();

				adaptor.addChild(root_1, stream_pl.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "associationExpression"


	public static class responsibilityExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "responsibilityExpression"
	// org/openprovenance/prov/notation/PROV_N.g:264:1: responsibilityExpression : 'actedOnBehalfOf' '(' id0= optionalIdentifier ag2= identifier ',' ag1= identifier ( ',' a= identifierOrMarker )? optionalAttributeValuePairs ')' -> {$a.tree==null}? ^( AOBO ^( ID ( $id0)? ) $ag2 $ag1 ^( ID ) optionalAttributeValuePairs ) -> ^( AOBO ^( ID ( $id0)? ) $ag2 $ag1 $a optionalAttributeValuePairs ) ;
	public final PROV_NParser.responsibilityExpression_return responsibilityExpression() throws RecognitionException {
		PROV_NParser.responsibilityExpression_return retval = new PROV_NParser.responsibilityExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal122=null;
		Token char_literal123=null;
		Token char_literal124=null;
		Token char_literal125=null;
		Token char_literal127=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope ag2 =null;
		ParserRuleReturnScope ag1 =null;
		ParserRuleReturnScope a =null;
		ParserRuleReturnScope optionalAttributeValuePairs126 =null;

		Object string_literal122_tree=null;
		Object char_literal123_tree=null;
		Object char_literal124_tree=null;
		Object char_literal125_tree=null;
		Object char_literal127_tree=null;
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleTokenStream stream_95=new RewriteRuleTokenStream(adaptor,"token 95");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_identifierOrMarker=new RewriteRuleSubtreeStream(adaptor,"rule identifierOrMarker");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:265:2: ( 'actedOnBehalfOf' '(' id0= optionalIdentifier ag2= identifier ',' ag1= identifier ( ',' a= identifierOrMarker )? optionalAttributeValuePairs ')' -> {$a.tree==null}? ^( AOBO ^( ID ( $id0)? ) $ag2 $ag1 ^( ID ) optionalAttributeValuePairs ) -> ^( AOBO ^( ID ( $id0)? ) $ag2 $ag1 $a optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:265:4: 'actedOnBehalfOf' '(' id0= optionalIdentifier ag2= identifier ',' ag1= identifier ( ',' a= identifierOrMarker )? optionalAttributeValuePairs ')'
			{
			string_literal122=(Token)match(input,95,FOLLOW_95_in_responsibilityExpression2440);  
			stream_95.add(string_literal122);

			char_literal123=(Token)match(input,91,FOLLOW_91_in_responsibilityExpression2442);  
			stream_91.add(char_literal123);

			pushFollow(FOLLOW_optionalIdentifier_in_responsibilityExpression2448);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_identifier_in_responsibilityExpression2452);
			ag2=identifier();
			state._fsp--;

			stream_identifier.add(ag2.getTree());
			char_literal124=(Token)match(input,93,FOLLOW_93_in_responsibilityExpression2454);  
			stream_93.add(char_literal124);

			pushFollow(FOLLOW_identifier_in_responsibilityExpression2458);
			ag1=identifier();
			state._fsp--;

			stream_identifier.add(ag1.getTree());
			// org/openprovenance/prov/notation/PROV_N.g:265:85: ( ',' a= identifierOrMarker )?
			int alt27=2;
			int LA27_0 = input.LA(1);
			if ( (LA27_0==93) ) {
				int LA27_1 = input.LA(2);
				if ( (LA27_1==MINUS||LA27_1==QUALIFIED_NAME) ) {
					alt27=1;
				}
			}
			switch (alt27) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:265:86: ',' a= identifierOrMarker
					{
					char_literal125=(Token)match(input,93,FOLLOW_93_in_responsibilityExpression2461);  
					stream_93.add(char_literal125);

					pushFollow(FOLLOW_identifierOrMarker_in_responsibilityExpression2466);
					a=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(a.getTree());
					}
					break;

			}

			pushFollow(FOLLOW_optionalAttributeValuePairs_in_responsibilityExpression2470);
			optionalAttributeValuePairs126=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs126.getTree());
			char_literal127=(Token)match(input,92,FOLLOW_92_in_responsibilityExpression2472);  
			stream_92.add(char_literal127);

			// AST REWRITE
			// elements: a, ag2, optionalAttributeValuePairs, ag2, ag1, optionalAttributeValuePairs, ag1, id0, id0
			// token labels: 
			// rule labels: a, id0, ag1, ag2, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_a=new RewriteRuleSubtreeStream(adaptor,"rule a",a!=null?a.getTree():null);
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_ag1=new RewriteRuleSubtreeStream(adaptor,"rule ag1",ag1!=null?ag1.getTree():null);
			RewriteRuleSubtreeStream stream_ag2=new RewriteRuleSubtreeStream(adaptor,"rule ag2",ag2!=null?ag2.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 266:7: -> {$a.tree==null}? ^( AOBO ^( ID ( $id0)? ) $ag2 $ag1 ^( ID ) optionalAttributeValuePairs )
			if ((a!=null?((Object)a.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:266:27: ^( AOBO ^( ID ( $id0)? ) $ag2 $ag1 ^( ID ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(AOBO, "AOBO"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:266:35: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:266:41: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_ag2.nextTree());
				adaptor.addChild(root_1, stream_ag1.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:266:57: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 267:7: -> ^( AOBO ^( ID ( $id0)? ) $ag2 $ag1 $a optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:267:10: ^( AOBO ^( ID ( $id0)? ) $ag2 $ag1 $a optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(AOBO, "AOBO"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:267:18: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:267:24: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_ag2.nextTree());
				adaptor.addChild(root_1, stream_ag1.nextTree());
				adaptor.addChild(root_1, stream_a.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "responsibilityExpression"


	public static class derivationExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "derivationExpression"
	// org/openprovenance/prov/notation/PROV_N.g:278:1: derivationExpression : 'wasDerivedFrom' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier ( ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker )? optionalAttributeValuePairs ')' -> {$a.tree==null && $g2.tree==null && $u1.tree==null}? ^( WDF ^( ID ( $id0)? ) $id2 $id1 ^( ID ) ^( ID ) ^( ID ) optionalAttributeValuePairs ) -> ^( WDF ^( ID ( $id0)? ) $id2 $id1 $a $g2 $u1 optionalAttributeValuePairs ) ;
	public final PROV_NParser.derivationExpression_return derivationExpression() throws RecognitionException {
		PROV_NParser.derivationExpression_return retval = new PROV_NParser.derivationExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal128=null;
		Token char_literal129=null;
		Token char_literal130=null;
		Token char_literal131=null;
		Token char_literal132=null;
		Token char_literal133=null;
		Token char_literal135=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope id2 =null;
		ParserRuleReturnScope id1 =null;
		ParserRuleReturnScope a =null;
		ParserRuleReturnScope g2 =null;
		ParserRuleReturnScope u1 =null;
		ParserRuleReturnScope optionalAttributeValuePairs134 =null;

		Object string_literal128_tree=null;
		Object char_literal129_tree=null;
		Object char_literal130_tree=null;
		Object char_literal131_tree=null;
		Object char_literal132_tree=null;
		Object char_literal133_tree=null;
		Object char_literal135_tree=null;
		RewriteRuleTokenStream stream_116=new RewriteRuleTokenStream(adaptor,"token 116");
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_identifierOrMarker=new RewriteRuleSubtreeStream(adaptor,"rule identifierOrMarker");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:279:2: ( 'wasDerivedFrom' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier ( ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker )? optionalAttributeValuePairs ')' -> {$a.tree==null && $g2.tree==null && $u1.tree==null}? ^( WDF ^( ID ( $id0)? ) $id2 $id1 ^( ID ) ^( ID ) ^( ID ) optionalAttributeValuePairs ) -> ^( WDF ^( ID ( $id0)? ) $id2 $id1 $a $g2 $u1 optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:279:4: 'wasDerivedFrom' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier ( ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker )? optionalAttributeValuePairs ')'
			{
			string_literal128=(Token)match(input,116,FOLLOW_116_in_derivationExpression2557);  
			stream_116.add(string_literal128);

			char_literal129=(Token)match(input,91,FOLLOW_91_in_derivationExpression2559);  
			stream_91.add(char_literal129);

			pushFollow(FOLLOW_optionalIdentifier_in_derivationExpression2563);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_identifier_in_derivationExpression2567);
			id2=identifier();
			state._fsp--;

			stream_identifier.add(id2.getTree());
			char_literal130=(Token)match(input,93,FOLLOW_93_in_derivationExpression2569);  
			stream_93.add(char_literal130);

			pushFollow(FOLLOW_identifier_in_derivationExpression2573);
			id1=identifier();
			state._fsp--;

			stream_identifier.add(id1.getTree());
			// org/openprovenance/prov/notation/PROV_N.g:279:82: ( ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker )?
			int alt28=2;
			int LA28_0 = input.LA(1);
			if ( (LA28_0==93) ) {
				int LA28_1 = input.LA(2);
				if ( (LA28_1==MINUS||LA28_1==QUALIFIED_NAME) ) {
					alt28=1;
				}
			}
			switch (alt28) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:279:83: ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker
					{
					char_literal131=(Token)match(input,93,FOLLOW_93_in_derivationExpression2576);  
					stream_93.add(char_literal131);

					pushFollow(FOLLOW_identifierOrMarker_in_derivationExpression2580);
					a=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(a.getTree());
					char_literal132=(Token)match(input,93,FOLLOW_93_in_derivationExpression2582);  
					stream_93.add(char_literal132);

					pushFollow(FOLLOW_identifierOrMarker_in_derivationExpression2586);
					g2=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(g2.getTree());
					char_literal133=(Token)match(input,93,FOLLOW_93_in_derivationExpression2588);  
					stream_93.add(char_literal133);

					pushFollow(FOLLOW_identifierOrMarker_in_derivationExpression2592);
					u1=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(u1.getTree());
					}
					break;

			}

			pushFollow(FOLLOW_optionalAttributeValuePairs_in_derivationExpression2597);
			optionalAttributeValuePairs134=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs134.getTree());
			char_literal135=(Token)match(input,92,FOLLOW_92_in_derivationExpression2599);  
			stream_92.add(char_literal135);

			// AST REWRITE
			// elements: id2, a, optionalAttributeValuePairs, id1, id0, u1, optionalAttributeValuePairs, id2, g2, id0, id1
			// token labels: 
			// rule labels: a, id0, id2, id1, g2, u1, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_a=new RewriteRuleSubtreeStream(adaptor,"rule a",a!=null?a.getTree():null);
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_id2=new RewriteRuleSubtreeStream(adaptor,"rule id2",id2!=null?id2.getTree():null);
			RewriteRuleSubtreeStream stream_id1=new RewriteRuleSubtreeStream(adaptor,"rule id1",id1!=null?id1.getTree():null);
			RewriteRuleSubtreeStream stream_g2=new RewriteRuleSubtreeStream(adaptor,"rule g2",g2!=null?g2.getTree():null);
			RewriteRuleSubtreeStream stream_u1=new RewriteRuleSubtreeStream(adaptor,"rule u1",u1!=null?u1.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 280:7: -> {$a.tree==null && $g2.tree==null && $u1.tree==null}? ^( WDF ^( ID ( $id0)? ) $id2 $id1 ^( ID ) ^( ID ) ^( ID ) optionalAttributeValuePairs )
			if ((a!=null?((Object)a.getTree()):null)==null && (g2!=null?((Object)g2.getTree()):null)==null && (u1!=null?((Object)u1.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:281:11: ^( WDF ^( ID ( $id0)? ) $id2 $id1 ^( ID ) ^( ID ) ^( ID ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WDF, "WDF"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:281:17: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:281:23: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:281:39: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:281:45: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:281:51: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 282:7: -> ^( WDF ^( ID ( $id0)? ) $id2 $id1 $a $g2 $u1 optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:282:10: ^( WDF ^( ID ( $id0)? ) $id2 $id1 $a $g2 $u1 optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WDF, "WDF"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:282:16: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:282:22: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				adaptor.addChild(root_1, stream_a.nextTree());
				adaptor.addChild(root_1, stream_g2.nextTree());
				adaptor.addChild(root_1, stream_u1.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "derivationExpression"


	public static class revisionExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "revisionExpression"
	// org/openprovenance/prov/notation/PROV_N.g:286:1: revisionExpression : 'wasRevisionOf' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier ( ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker )? optionalAttributeValuePairs ')' -> {$a.tree==null && $g2.tree==null && $u1.tree==null}? ^( WRO ^( ID ( $id0)? ) $id2 $id1 ^( ID ) ^( ID ) ^( ID ) optionalAttributeValuePairs ) -> ^( WRO ^( ID ( $id0)? ) $id2 $id1 $a $g2 $u1 optionalAttributeValuePairs ) ;
	public final PROV_NParser.revisionExpression_return revisionExpression() throws RecognitionException {
		PROV_NParser.revisionExpression_return retval = new PROV_NParser.revisionExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal136=null;
		Token char_literal137=null;
		Token char_literal138=null;
		Token char_literal139=null;
		Token char_literal140=null;
		Token char_literal141=null;
		Token char_literal143=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope id2 =null;
		ParserRuleReturnScope id1 =null;
		ParserRuleReturnScope a =null;
		ParserRuleReturnScope g2 =null;
		ParserRuleReturnScope u1 =null;
		ParserRuleReturnScope optionalAttributeValuePairs142 =null;

		Object string_literal136_tree=null;
		Object char_literal137_tree=null;
		Object char_literal138_tree=null;
		Object char_literal139_tree=null;
		Object char_literal140_tree=null;
		Object char_literal141_tree=null;
		Object char_literal143_tree=null;
		RewriteRuleTokenStream stream_123=new RewriteRuleTokenStream(adaptor,"token 123");
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_identifierOrMarker=new RewriteRuleSubtreeStream(adaptor,"rule identifierOrMarker");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:287:2: ( 'wasRevisionOf' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier ( ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker )? optionalAttributeValuePairs ')' -> {$a.tree==null && $g2.tree==null && $u1.tree==null}? ^( WRO ^( ID ( $id0)? ) $id2 $id1 ^( ID ) ^( ID ) ^( ID ) optionalAttributeValuePairs ) -> ^( WRO ^( ID ( $id0)? ) $id2 $id1 $a $g2 $u1 optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:287:4: 'wasRevisionOf' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier ( ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker )? optionalAttributeValuePairs ')'
			{
			string_literal136=(Token)match(input,123,FOLLOW_123_in_revisionExpression2700);  
			stream_123.add(string_literal136);

			char_literal137=(Token)match(input,91,FOLLOW_91_in_revisionExpression2702);  
			stream_91.add(char_literal137);

			pushFollow(FOLLOW_optionalIdentifier_in_revisionExpression2707);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_identifier_in_revisionExpression2711);
			id2=identifier();
			state._fsp--;

			stream_identifier.add(id2.getTree());
			char_literal138=(Token)match(input,93,FOLLOW_93_in_revisionExpression2713);  
			stream_93.add(char_literal138);

			pushFollow(FOLLOW_identifier_in_revisionExpression2717);
			id1=identifier();
			state._fsp--;

			stream_identifier.add(id1.getTree());
			// org/openprovenance/prov/notation/PROV_N.g:287:82: ( ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker )?
			int alt29=2;
			int LA29_0 = input.LA(1);
			if ( (LA29_0==93) ) {
				int LA29_1 = input.LA(2);
				if ( (LA29_1==MINUS||LA29_1==QUALIFIED_NAME) ) {
					alt29=1;
				}
			}
			switch (alt29) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:287:83: ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker
					{
					char_literal139=(Token)match(input,93,FOLLOW_93_in_revisionExpression2720);  
					stream_93.add(char_literal139);

					pushFollow(FOLLOW_identifierOrMarker_in_revisionExpression2724);
					a=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(a.getTree());
					char_literal140=(Token)match(input,93,FOLLOW_93_in_revisionExpression2726);  
					stream_93.add(char_literal140);

					pushFollow(FOLLOW_identifierOrMarker_in_revisionExpression2730);
					g2=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(g2.getTree());
					char_literal141=(Token)match(input,93,FOLLOW_93_in_revisionExpression2732);  
					stream_93.add(char_literal141);

					pushFollow(FOLLOW_identifierOrMarker_in_revisionExpression2736);
					u1=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(u1.getTree());
					}
					break;

			}

			pushFollow(FOLLOW_optionalAttributeValuePairs_in_revisionExpression2741);
			optionalAttributeValuePairs142=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs142.getTree());
			char_literal143=(Token)match(input,92,FOLLOW_92_in_revisionExpression2743);  
			stream_92.add(char_literal143);

			// AST REWRITE
			// elements: id0, optionalAttributeValuePairs, id2, id2, u1, a, id0, id1, id1, optionalAttributeValuePairs, g2
			// token labels: 
			// rule labels: a, id0, id2, id1, g2, u1, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_a=new RewriteRuleSubtreeStream(adaptor,"rule a",a!=null?a.getTree():null);
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_id2=new RewriteRuleSubtreeStream(adaptor,"rule id2",id2!=null?id2.getTree():null);
			RewriteRuleSubtreeStream stream_id1=new RewriteRuleSubtreeStream(adaptor,"rule id1",id1!=null?id1.getTree():null);
			RewriteRuleSubtreeStream stream_g2=new RewriteRuleSubtreeStream(adaptor,"rule g2",g2!=null?g2.getTree():null);
			RewriteRuleSubtreeStream stream_u1=new RewriteRuleSubtreeStream(adaptor,"rule u1",u1!=null?u1.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 288:7: -> {$a.tree==null && $g2.tree==null && $u1.tree==null}? ^( WRO ^( ID ( $id0)? ) $id2 $id1 ^( ID ) ^( ID ) ^( ID ) optionalAttributeValuePairs )
			if ((a!=null?((Object)a.getTree()):null)==null && (g2!=null?((Object)g2.getTree()):null)==null && (u1!=null?((Object)u1.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:289:11: ^( WRO ^( ID ( $id0)? ) $id2 $id1 ^( ID ) ^( ID ) ^( ID ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WRO, "WRO"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:289:17: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:289:23: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:289:39: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:289:45: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:289:51: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 290:7: -> ^( WRO ^( ID ( $id0)? ) $id2 $id1 $a $g2 $u1 optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:290:10: ^( WRO ^( ID ( $id0)? ) $id2 $id1 $a $g2 $u1 optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WRO, "WRO"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:290:16: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:290:22: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				adaptor.addChild(root_1, stream_a.nextTree());
				adaptor.addChild(root_1, stream_g2.nextTree());
				adaptor.addChild(root_1, stream_u1.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "revisionExpression"


	public static class quotationExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "quotationExpression"
	// org/openprovenance/prov/notation/PROV_N.g:295:1: quotationExpression : 'wasQuotedFrom' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier ( ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker )? optionalAttributeValuePairs ')' -> {$a.tree==null && $g2.tree==null && $u1.tree==null}? ^( WQF ^( ID ( $id0)? ) $id2 $id1 ^( ID ) ^( ID ) ^( ID ) optionalAttributeValuePairs ) -> ^( WQF ^( ID ( $id0)? ) $id2 $id1 $a $g2 $u1 optionalAttributeValuePairs ) ;
	public final PROV_NParser.quotationExpression_return quotationExpression() throws RecognitionException {
		PROV_NParser.quotationExpression_return retval = new PROV_NParser.quotationExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal144=null;
		Token char_literal145=null;
		Token char_literal146=null;
		Token char_literal147=null;
		Token char_literal148=null;
		Token char_literal149=null;
		Token char_literal151=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope id2 =null;
		ParserRuleReturnScope id1 =null;
		ParserRuleReturnScope a =null;
		ParserRuleReturnScope g2 =null;
		ParserRuleReturnScope u1 =null;
		ParserRuleReturnScope optionalAttributeValuePairs150 =null;

		Object string_literal144_tree=null;
		Object char_literal145_tree=null;
		Object char_literal146_tree=null;
		Object char_literal147_tree=null;
		Object char_literal148_tree=null;
		Object char_literal149_tree=null;
		Object char_literal151_tree=null;
		RewriteRuleTokenStream stream_122=new RewriteRuleTokenStream(adaptor,"token 122");
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_identifierOrMarker=new RewriteRuleSubtreeStream(adaptor,"rule identifierOrMarker");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:296:2: ( 'wasQuotedFrom' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier ( ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker )? optionalAttributeValuePairs ')' -> {$a.tree==null && $g2.tree==null && $u1.tree==null}? ^( WQF ^( ID ( $id0)? ) $id2 $id1 ^( ID ) ^( ID ) ^( ID ) optionalAttributeValuePairs ) -> ^( WQF ^( ID ( $id0)? ) $id2 $id1 $a $g2 $u1 optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:296:4: 'wasQuotedFrom' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier ( ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker )? optionalAttributeValuePairs ')'
			{
			string_literal144=(Token)match(input,122,FOLLOW_122_in_quotationExpression2845);  
			stream_122.add(string_literal144);

			char_literal145=(Token)match(input,91,FOLLOW_91_in_quotationExpression2847);  
			stream_91.add(char_literal145);

			pushFollow(FOLLOW_optionalIdentifier_in_quotationExpression2852);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_identifier_in_quotationExpression2856);
			id2=identifier();
			state._fsp--;

			stream_identifier.add(id2.getTree());
			char_literal146=(Token)match(input,93,FOLLOW_93_in_quotationExpression2858);  
			stream_93.add(char_literal146);

			pushFollow(FOLLOW_identifier_in_quotationExpression2862);
			id1=identifier();
			state._fsp--;

			stream_identifier.add(id1.getTree());
			// org/openprovenance/prov/notation/PROV_N.g:296:82: ( ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker )?
			int alt30=2;
			int LA30_0 = input.LA(1);
			if ( (LA30_0==93) ) {
				int LA30_1 = input.LA(2);
				if ( (LA30_1==MINUS||LA30_1==QUALIFIED_NAME) ) {
					alt30=1;
				}
			}
			switch (alt30) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:296:83: ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker
					{
					char_literal147=(Token)match(input,93,FOLLOW_93_in_quotationExpression2865);  
					stream_93.add(char_literal147);

					pushFollow(FOLLOW_identifierOrMarker_in_quotationExpression2869);
					a=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(a.getTree());
					char_literal148=(Token)match(input,93,FOLLOW_93_in_quotationExpression2871);  
					stream_93.add(char_literal148);

					pushFollow(FOLLOW_identifierOrMarker_in_quotationExpression2875);
					g2=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(g2.getTree());
					char_literal149=(Token)match(input,93,FOLLOW_93_in_quotationExpression2877);  
					stream_93.add(char_literal149);

					pushFollow(FOLLOW_identifierOrMarker_in_quotationExpression2881);
					u1=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(u1.getTree());
					}
					break;

			}

			pushFollow(FOLLOW_optionalAttributeValuePairs_in_quotationExpression2886);
			optionalAttributeValuePairs150=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs150.getTree());
			char_literal151=(Token)match(input,92,FOLLOW_92_in_quotationExpression2888);  
			stream_92.add(char_literal151);

			// AST REWRITE
			// elements: id0, a, u1, optionalAttributeValuePairs, id1, id2, optionalAttributeValuePairs, id2, id1, id0, g2
			// token labels: 
			// rule labels: a, id0, id2, id1, g2, u1, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_a=new RewriteRuleSubtreeStream(adaptor,"rule a",a!=null?a.getTree():null);
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_id2=new RewriteRuleSubtreeStream(adaptor,"rule id2",id2!=null?id2.getTree():null);
			RewriteRuleSubtreeStream stream_id1=new RewriteRuleSubtreeStream(adaptor,"rule id1",id1!=null?id1.getTree():null);
			RewriteRuleSubtreeStream stream_g2=new RewriteRuleSubtreeStream(adaptor,"rule g2",g2!=null?g2.getTree():null);
			RewriteRuleSubtreeStream stream_u1=new RewriteRuleSubtreeStream(adaptor,"rule u1",u1!=null?u1.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 297:7: -> {$a.tree==null && $g2.tree==null && $u1.tree==null}? ^( WQF ^( ID ( $id0)? ) $id2 $id1 ^( ID ) ^( ID ) ^( ID ) optionalAttributeValuePairs )
			if ((a!=null?((Object)a.getTree()):null)==null && (g2!=null?((Object)g2.getTree()):null)==null && (u1!=null?((Object)u1.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:298:11: ^( WQF ^( ID ( $id0)? ) $id2 $id1 ^( ID ) ^( ID ) ^( ID ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WQF, "WQF"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:298:17: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:298:23: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:298:39: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:298:45: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:298:51: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 299:7: -> ^( WQF ^( ID ( $id0)? ) $id2 $id1 $a $g2 $u1 optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:299:10: ^( WQF ^( ID ( $id0)? ) $id2 $id1 $a $g2 $u1 optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(WQF, "WQF"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:299:16: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:299:22: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				adaptor.addChild(root_1, stream_a.nextTree());
				adaptor.addChild(root_1, stream_g2.nextTree());
				adaptor.addChild(root_1, stream_u1.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "quotationExpression"


	public static class hadPrimarySourceExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "hadPrimarySourceExpression"
	// org/openprovenance/prov/notation/PROV_N.g:303:1: hadPrimarySourceExpression : 'hadPrimarySource' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier ( ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker )? optionalAttributeValuePairs ')' -> {$a.tree==null && $g2.tree==null && $u1.tree==null}? ^( PRIMARYSOURCE ^( ID ( $id0)? ) $id2 $id1 ^( ID ) ^( ID ) ^( ID ) optionalAttributeValuePairs ) -> ^( PRIMARYSOURCE ^( ID ( $id0)? ) $id2 $id1 $a $g2 $u1 optionalAttributeValuePairs ) ;
	public final PROV_NParser.hadPrimarySourceExpression_return hadPrimarySourceExpression() throws RecognitionException {
		PROV_NParser.hadPrimarySourceExpression_return retval = new PROV_NParser.hadPrimarySourceExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal152=null;
		Token char_literal153=null;
		Token char_literal154=null;
		Token char_literal155=null;
		Token char_literal156=null;
		Token char_literal157=null;
		Token char_literal159=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope id2 =null;
		ParserRuleReturnScope id1 =null;
		ParserRuleReturnScope a =null;
		ParserRuleReturnScope g2 =null;
		ParserRuleReturnScope u1 =null;
		ParserRuleReturnScope optionalAttributeValuePairs158 =null;

		Object string_literal152_tree=null;
		Object char_literal153_tree=null;
		Object char_literal154_tree=null;
		Object char_literal155_tree=null;
		Object char_literal156_tree=null;
		Object char_literal157_tree=null;
		Object char_literal159_tree=null;
		RewriteRuleTokenStream stream_106=new RewriteRuleTokenStream(adaptor,"token 106");
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_identifierOrMarker=new RewriteRuleSubtreeStream(adaptor,"rule identifierOrMarker");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:304:2: ( 'hadPrimarySource' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier ( ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker )? optionalAttributeValuePairs ')' -> {$a.tree==null && $g2.tree==null && $u1.tree==null}? ^( PRIMARYSOURCE ^( ID ( $id0)? ) $id2 $id1 ^( ID ) ^( ID ) ^( ID ) optionalAttributeValuePairs ) -> ^( PRIMARYSOURCE ^( ID ( $id0)? ) $id2 $id1 $a $g2 $u1 optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:304:4: 'hadPrimarySource' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier ( ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker )? optionalAttributeValuePairs ')'
			{
			string_literal152=(Token)match(input,106,FOLLOW_106_in_hadPrimarySourceExpression2989);  
			stream_106.add(string_literal152);

			char_literal153=(Token)match(input,91,FOLLOW_91_in_hadPrimarySourceExpression2991);  
			stream_91.add(char_literal153);

			pushFollow(FOLLOW_optionalIdentifier_in_hadPrimarySourceExpression2996);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_identifier_in_hadPrimarySourceExpression3000);
			id2=identifier();
			state._fsp--;

			stream_identifier.add(id2.getTree());
			char_literal154=(Token)match(input,93,FOLLOW_93_in_hadPrimarySourceExpression3002);  
			stream_93.add(char_literal154);

			pushFollow(FOLLOW_identifier_in_hadPrimarySourceExpression3006);
			id1=identifier();
			state._fsp--;

			stream_identifier.add(id1.getTree());
			// org/openprovenance/prov/notation/PROV_N.g:304:85: ( ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker )?
			int alt31=2;
			int LA31_0 = input.LA(1);
			if ( (LA31_0==93) ) {
				int LA31_1 = input.LA(2);
				if ( (LA31_1==MINUS||LA31_1==QUALIFIED_NAME) ) {
					alt31=1;
				}
			}
			switch (alt31) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:304:86: ',' a= identifierOrMarker ',' g2= identifierOrMarker ',' u1= identifierOrMarker
					{
					char_literal155=(Token)match(input,93,FOLLOW_93_in_hadPrimarySourceExpression3009);  
					stream_93.add(char_literal155);

					pushFollow(FOLLOW_identifierOrMarker_in_hadPrimarySourceExpression3013);
					a=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(a.getTree());
					char_literal156=(Token)match(input,93,FOLLOW_93_in_hadPrimarySourceExpression3015);  
					stream_93.add(char_literal156);

					pushFollow(FOLLOW_identifierOrMarker_in_hadPrimarySourceExpression3019);
					g2=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(g2.getTree());
					char_literal157=(Token)match(input,93,FOLLOW_93_in_hadPrimarySourceExpression3021);  
					stream_93.add(char_literal157);

					pushFollow(FOLLOW_identifierOrMarker_in_hadPrimarySourceExpression3025);
					u1=identifierOrMarker();
					state._fsp--;

					stream_identifierOrMarker.add(u1.getTree());
					}
					break;

			}

			pushFollow(FOLLOW_optionalAttributeValuePairs_in_hadPrimarySourceExpression3030);
			optionalAttributeValuePairs158=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs158.getTree());
			char_literal159=(Token)match(input,92,FOLLOW_92_in_hadPrimarySourceExpression3032);  
			stream_92.add(char_literal159);

			// AST REWRITE
			// elements: optionalAttributeValuePairs, id1, id2, u1, optionalAttributeValuePairs, id0, id0, id2, g2, id1, a
			// token labels: 
			// rule labels: a, id0, id2, id1, g2, u1, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_a=new RewriteRuleSubtreeStream(adaptor,"rule a",a!=null?a.getTree():null);
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_id2=new RewriteRuleSubtreeStream(adaptor,"rule id2",id2!=null?id2.getTree():null);
			RewriteRuleSubtreeStream stream_id1=new RewriteRuleSubtreeStream(adaptor,"rule id1",id1!=null?id1.getTree():null);
			RewriteRuleSubtreeStream stream_g2=new RewriteRuleSubtreeStream(adaptor,"rule g2",g2!=null?g2.getTree():null);
			RewriteRuleSubtreeStream stream_u1=new RewriteRuleSubtreeStream(adaptor,"rule u1",u1!=null?u1.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 305:7: -> {$a.tree==null && $g2.tree==null && $u1.tree==null}? ^( PRIMARYSOURCE ^( ID ( $id0)? ) $id2 $id1 ^( ID ) ^( ID ) ^( ID ) optionalAttributeValuePairs )
			if ((a!=null?((Object)a.getTree()):null)==null && (g2!=null?((Object)g2.getTree()):null)==null && (u1!=null?((Object)u1.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:306:11: ^( PRIMARYSOURCE ^( ID ( $id0)? ) $id2 $id1 ^( ID ) ^( ID ) ^( ID ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(PRIMARYSOURCE, "PRIMARYSOURCE"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:306:27: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:306:33: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:306:49: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:306:55: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:306:61: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}

			else // 307:7: -> ^( PRIMARYSOURCE ^( ID ( $id0)? ) $id2 $id1 $a $g2 $u1 optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:307:10: ^( PRIMARYSOURCE ^( ID ( $id0)? ) $id2 $id1 $a $g2 $u1 optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(PRIMARYSOURCE, "PRIMARYSOURCE"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:307:26: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:307:32: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				adaptor.addChild(root_1, stream_a.nextTree());
				adaptor.addChild(root_1, stream_g2.nextTree());
				adaptor.addChild(root_1, stream_u1.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "hadPrimarySourceExpression"


	public static class influenceExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "influenceExpression"
	// org/openprovenance/prov/notation/PROV_N.g:312:1: influenceExpression : 'wasInfluencedBy' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier optionalAttributeValuePairs ')' -> ^( INFL ^( ID ( $id0)? ) $id2 $id1 optionalAttributeValuePairs ) ;
	public final PROV_NParser.influenceExpression_return influenceExpression() throws RecognitionException {
		PROV_NParser.influenceExpression_return retval = new PROV_NParser.influenceExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal160=null;
		Token char_literal161=null;
		Token char_literal162=null;
		Token char_literal164=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope id2 =null;
		ParserRuleReturnScope id1 =null;
		ParserRuleReturnScope optionalAttributeValuePairs163 =null;

		Object string_literal160_tree=null;
		Object char_literal161_tree=null;
		Object char_literal162_tree=null;
		Object char_literal164_tree=null;
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_119=new RewriteRuleTokenStream(adaptor,"token 119");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:313:2: ( 'wasInfluencedBy' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier optionalAttributeValuePairs ')' -> ^( INFL ^( ID ( $id0)? ) $id2 $id1 optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:313:4: 'wasInfluencedBy' '(' id0= optionalIdentifier id2= identifier ',' id1= identifier optionalAttributeValuePairs ')'
			{
			string_literal160=(Token)match(input,119,FOLLOW_119_in_influenceExpression3134);  
			stream_119.add(string_literal160);

			char_literal161=(Token)match(input,91,FOLLOW_91_in_influenceExpression3136);  
			stream_91.add(char_literal161);

			pushFollow(FOLLOW_optionalIdentifier_in_influenceExpression3141);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_identifier_in_influenceExpression3145);
			id2=identifier();
			state._fsp--;

			stream_identifier.add(id2.getTree());
			char_literal162=(Token)match(input,93,FOLLOW_93_in_influenceExpression3147);  
			stream_93.add(char_literal162);

			pushFollow(FOLLOW_identifier_in_influenceExpression3151);
			id1=identifier();
			state._fsp--;

			stream_identifier.add(id1.getTree());
			pushFollow(FOLLOW_optionalAttributeValuePairs_in_influenceExpression3153);
			optionalAttributeValuePairs163=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs163.getTree());
			char_literal164=(Token)match(input,92,FOLLOW_92_in_influenceExpression3155);  
			stream_92.add(char_literal164);

			// AST REWRITE
			// elements: id1, id0, id2, optionalAttributeValuePairs
			// token labels: 
			// rule labels: id0, id2, id1, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_id2=new RewriteRuleSubtreeStream(adaptor,"rule id2",id2!=null?id2.getTree():null);
			RewriteRuleSubtreeStream stream_id1=new RewriteRuleSubtreeStream(adaptor,"rule id1",id1!=null?id1.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 314:7: -> ^( INFL ^( ID ( $id0)? ) $id2 $id1 optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:314:10: ^( INFL ^( ID ( $id0)? ) $id2 $id1 optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(INFL, "INFL"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:314:17: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:314:23: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "influenceExpression"


	public static class alternateExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "alternateExpression"
	// org/openprovenance/prov/notation/PROV_N.g:328:1: alternateExpression : 'alternateOf' '(' identifier ',' identifier ')' -> ^( ALTERNATE ( identifier )+ ) ;
	public final PROV_NParser.alternateExpression_return alternateExpression() throws RecognitionException {
		PROV_NParser.alternateExpression_return retval = new PROV_NParser.alternateExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal165=null;
		Token char_literal166=null;
		Token char_literal168=null;
		Token char_literal170=null;
		ParserRuleReturnScope identifier167 =null;
		ParserRuleReturnScope identifier169 =null;

		Object string_literal165_tree=null;
		Object char_literal166_tree=null;
		Object char_literal168_tree=null;
		Object char_literal170_tree=null;
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleTokenStream stream_98=new RewriteRuleTokenStream(adaptor,"token 98");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:329:2: ( 'alternateOf' '(' identifier ',' identifier ')' -> ^( ALTERNATE ( identifier )+ ) )
			// org/openprovenance/prov/notation/PROV_N.g:329:4: 'alternateOf' '(' identifier ',' identifier ')'
			{
			string_literal165=(Token)match(input,98,FOLLOW_98_in_alternateExpression3201);  
			stream_98.add(string_literal165);

			char_literal166=(Token)match(input,91,FOLLOW_91_in_alternateExpression3203);  
			stream_91.add(char_literal166);

			pushFollow(FOLLOW_identifier_in_alternateExpression3206);
			identifier167=identifier();
			state._fsp--;

			stream_identifier.add(identifier167.getTree());
			char_literal168=(Token)match(input,93,FOLLOW_93_in_alternateExpression3208);  
			stream_93.add(char_literal168);

			pushFollow(FOLLOW_identifier_in_alternateExpression3210);
			identifier169=identifier();
			state._fsp--;

			stream_identifier.add(identifier169.getTree());
			char_literal170=(Token)match(input,92,FOLLOW_92_in_alternateExpression3212);  
			stream_92.add(char_literal170);

			// AST REWRITE
			// elements: identifier
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 330:7: -> ^( ALTERNATE ( identifier )+ )
			{
				// org/openprovenance/prov/notation/PROV_N.g:330:10: ^( ALTERNATE ( identifier )+ )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(ALTERNATE, "ALTERNATE"), root_1);
				if ( !(stream_identifier.hasNext()) ) {
					throw new RewriteEarlyExitException();
				}
				while ( stream_identifier.hasNext() ) {
					adaptor.addChild(root_1, stream_identifier.nextTree());
				}
				stream_identifier.reset();

				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "alternateExpression"


	public static class specializationExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "specializationExpression"
	// org/openprovenance/prov/notation/PROV_N.g:333:1: specializationExpression : 'specializationOf' '(' identifier ',' identifier ')' -> ^( SPECIALIZATION ( identifier )+ ) ;
	public final PROV_NParser.specializationExpression_return specializationExpression() throws RecognitionException {
		PROV_NParser.specializationExpression_return retval = new PROV_NParser.specializationExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal171=null;
		Token char_literal172=null;
		Token char_literal174=null;
		Token char_literal176=null;
		ParserRuleReturnScope identifier173 =null;
		ParserRuleReturnScope identifier175 =null;

		Object string_literal171_tree=null;
		Object char_literal172_tree=null;
		Object char_literal174_tree=null;
		Object char_literal176_tree=null;
		RewriteRuleTokenStream stream_112=new RewriteRuleTokenStream(adaptor,"token 112");
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:334:2: ( 'specializationOf' '(' identifier ',' identifier ')' -> ^( SPECIALIZATION ( identifier )+ ) )
			// org/openprovenance/prov/notation/PROV_N.g:334:4: 'specializationOf' '(' identifier ',' identifier ')'
			{
			string_literal171=(Token)match(input,112,FOLLOW_112_in_specializationExpression3238);  
			stream_112.add(string_literal171);

			char_literal172=(Token)match(input,91,FOLLOW_91_in_specializationExpression3240);  
			stream_91.add(char_literal172);

			pushFollow(FOLLOW_identifier_in_specializationExpression3243);
			identifier173=identifier();
			state._fsp--;

			stream_identifier.add(identifier173.getTree());
			char_literal174=(Token)match(input,93,FOLLOW_93_in_specializationExpression3245);  
			stream_93.add(char_literal174);

			pushFollow(FOLLOW_identifier_in_specializationExpression3247);
			identifier175=identifier();
			state._fsp--;

			stream_identifier.add(identifier175.getTree());
			char_literal176=(Token)match(input,92,FOLLOW_92_in_specializationExpression3249);  
			stream_92.add(char_literal176);

			// AST REWRITE
			// elements: identifier
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 335:7: -> ^( SPECIALIZATION ( identifier )+ )
			{
				// org/openprovenance/prov/notation/PROV_N.g:335:10: ^( SPECIALIZATION ( identifier )+ )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(SPECIALIZATION, "SPECIALIZATION"), root_1);
				if ( !(stream_identifier.hasNext()) ) {
					throw new RewriteEarlyExitException();
				}
				while ( stream_identifier.hasNext() ) {
					adaptor.addChild(root_1, stream_identifier.nextTree());
				}
				stream_identifier.reset();

				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "specializationExpression"


	public static class mentionExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "mentionExpression"
	// org/openprovenance/prov/notation/PROV_N.g:338:1: mentionExpression : 'mentionOf' '(' su= identifier ',' en= identifier ',' bu= identifier ')' -> ^( CTX $su $en $bu) ;
	public final PROV_NParser.mentionExpression_return mentionExpression() throws RecognitionException {
		PROV_NParser.mentionExpression_return retval = new PROV_NParser.mentionExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal177=null;
		Token char_literal178=null;
		Token char_literal179=null;
		Token char_literal180=null;
		Token char_literal181=null;
		ParserRuleReturnScope su =null;
		ParserRuleReturnScope en =null;
		ParserRuleReturnScope bu =null;

		Object string_literal177_tree=null;
		Object char_literal178_tree=null;
		Object char_literal179_tree=null;
		Object char_literal180_tree=null;
		Object char_literal181_tree=null;
		RewriteRuleTokenStream stream_107=new RewriteRuleTokenStream(adaptor,"token 107");
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:339:2: ( 'mentionOf' '(' su= identifier ',' en= identifier ',' bu= identifier ')' -> ^( CTX $su $en $bu) )
			// org/openprovenance/prov/notation/PROV_N.g:339:4: 'mentionOf' '(' su= identifier ',' en= identifier ',' bu= identifier ')'
			{
			string_literal177=(Token)match(input,107,FOLLOW_107_in_mentionExpression3275);  
			stream_107.add(string_literal177);

			char_literal178=(Token)match(input,91,FOLLOW_91_in_mentionExpression3277);  
			stream_91.add(char_literal178);

			pushFollow(FOLLOW_identifier_in_mentionExpression3281);
			su=identifier();
			state._fsp--;

			stream_identifier.add(su.getTree());
			char_literal179=(Token)match(input,93,FOLLOW_93_in_mentionExpression3283);  
			stream_93.add(char_literal179);

			pushFollow(FOLLOW_identifier_in_mentionExpression3287);
			en=identifier();
			state._fsp--;

			stream_identifier.add(en.getTree());
			char_literal180=(Token)match(input,93,FOLLOW_93_in_mentionExpression3289);  
			stream_93.add(char_literal180);

			pushFollow(FOLLOW_identifier_in_mentionExpression3293);
			bu=identifier();
			state._fsp--;

			stream_identifier.add(bu.getTree());
			char_literal181=(Token)match(input,92,FOLLOW_92_in_mentionExpression3295);  
			stream_92.add(char_literal181);

			// AST REWRITE
			// elements: su, bu, en
			// token labels: 
			// rule labels: su, bu, en, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_su=new RewriteRuleSubtreeStream(adaptor,"rule su",su!=null?su.getTree():null);
			RewriteRuleSubtreeStream stream_bu=new RewriteRuleSubtreeStream(adaptor,"rule bu",bu!=null?bu.getTree():null);
			RewriteRuleSubtreeStream stream_en=new RewriteRuleSubtreeStream(adaptor,"rule en",en!=null?en.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 340:9: -> ^( CTX $su $en $bu)
			{
				// org/openprovenance/prov/notation/PROV_N.g:340:12: ^( CTX $su $en $bu)
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(CTX, "CTX"), root_1);
				adaptor.addChild(root_1, stream_su.nextTree());
				adaptor.addChild(root_1, stream_en.nextTree());
				adaptor.addChild(root_1, stream_bu.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "mentionExpression"


	public static class insertionExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "insertionExpression"
	// org/openprovenance/prov/notation/PROV_N.g:351:1: insertionExpression : 'prov:derivedByInsertionFrom(' id0= optionalIdentifier id2= identifier ',' id1= identifier ',' keyEntitySet optionalAttributeValuePairs ')' -> ^( DBIF ^( ID ( $id0)? ) $id2 $id1 keyEntitySet optionalAttributeValuePairs ) ;
	public final PROV_NParser.insertionExpression_return insertionExpression() throws RecognitionException {
		PROV_NParser.insertionExpression_return retval = new PROV_NParser.insertionExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal182=null;
		Token char_literal183=null;
		Token char_literal184=null;
		Token char_literal187=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope id2 =null;
		ParserRuleReturnScope id1 =null;
		ParserRuleReturnScope keyEntitySet185 =null;
		ParserRuleReturnScope optionalAttributeValuePairs186 =null;

		Object string_literal182_tree=null;
		Object char_literal183_tree=null;
		Object char_literal184_tree=null;
		Object char_literal187_tree=null;
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleTokenStream stream_109=new RewriteRuleTokenStream(adaptor,"token 109");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_keyEntitySet=new RewriteRuleSubtreeStream(adaptor,"rule keyEntitySet");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:353:2: ( 'prov:derivedByInsertionFrom(' id0= optionalIdentifier id2= identifier ',' id1= identifier ',' keyEntitySet optionalAttributeValuePairs ')' -> ^( DBIF ^( ID ( $id0)? ) $id2 $id1 keyEntitySet optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:353:5: 'prov:derivedByInsertionFrom(' id0= optionalIdentifier id2= identifier ',' id1= identifier ',' keyEntitySet optionalAttributeValuePairs ')'
			{
			string_literal182=(Token)match(input,109,FOLLOW_109_in_insertionExpression3340);  
			stream_109.add(string_literal182);

			pushFollow(FOLLOW_optionalIdentifier_in_insertionExpression3345);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_identifier_in_insertionExpression3349);
			id2=identifier();
			state._fsp--;

			stream_identifier.add(id2.getTree());
			char_literal183=(Token)match(input,93,FOLLOW_93_in_insertionExpression3351);  
			stream_93.add(char_literal183);

			pushFollow(FOLLOW_identifier_in_insertionExpression3355);
			id1=identifier();
			state._fsp--;

			stream_identifier.add(id1.getTree());
			char_literal184=(Token)match(input,93,FOLLOW_93_in_insertionExpression3357);  
			stream_93.add(char_literal184);

			 qnameDisabled=true; 
			pushFollow(FOLLOW_keyEntitySet_in_insertionExpression3361);
			keyEntitySet185=keyEntitySet();
			state._fsp--;

			stream_keyEntitySet.add(keyEntitySet185.getTree());
			pushFollow(FOLLOW_optionalAttributeValuePairs_in_insertionExpression3363);
			optionalAttributeValuePairs186=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs186.getTree());
			char_literal187=(Token)match(input,92,FOLLOW_92_in_insertionExpression3365);  
			stream_92.add(char_literal187);

			// AST REWRITE
			// elements: id1, keyEntitySet, id0, id2, optionalAttributeValuePairs
			// token labels: 
			// rule labels: id0, id2, id1, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_id2=new RewriteRuleSubtreeStream(adaptor,"rule id2",id2!=null?id2.getTree():null);
			RewriteRuleSubtreeStream stream_id1=new RewriteRuleSubtreeStream(adaptor,"rule id1",id1!=null?id1.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 354:7: -> ^( DBIF ^( ID ( $id0)? ) $id2 $id1 keyEntitySet optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:354:10: ^( DBIF ^( ID ( $id0)? ) $id2 $id1 keyEntitySet optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(DBIF, "DBIF"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:354:17: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:354:23: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				adaptor.addChild(root_1, stream_keyEntitySet.nextTree());
				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

			 qnameDisabled = false; 
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "insertionExpression"


	public static class removalExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "removalExpression"
	// org/openprovenance/prov/notation/PROV_N.g:358:1: removalExpression : 'prov:derivedByRemovalFrom(' id0= optionalIdentifier id2= identifier ',' id1= identifier ',' '{' literal ( ',' literal )* '}' optionalAttributeValuePairs ')' -> ^( DBRF ^( ID ( $id0)? ) $id2 $id1 ^( KEYS ( literal )* ) optionalAttributeValuePairs ) ;
	public final PROV_NParser.removalExpression_return removalExpression() throws RecognitionException {
		PROV_NParser.removalExpression_return retval = new PROV_NParser.removalExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal188=null;
		Token char_literal189=null;
		Token char_literal190=null;
		Token char_literal191=null;
		Token char_literal193=null;
		Token char_literal195=null;
		Token char_literal197=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope id2 =null;
		ParserRuleReturnScope id1 =null;
		ParserRuleReturnScope literal192 =null;
		ParserRuleReturnScope literal194 =null;
		ParserRuleReturnScope optionalAttributeValuePairs196 =null;

		Object string_literal188_tree=null;
		Object char_literal189_tree=null;
		Object char_literal190_tree=null;
		Object char_literal191_tree=null;
		Object char_literal193_tree=null;
		Object char_literal195_tree=null;
		Object char_literal197_tree=null;
		RewriteRuleTokenStream stream_110=new RewriteRuleTokenStream(adaptor,"token 110");
		RewriteRuleTokenStream stream_CLOSE_CURLY_BRACE=new RewriteRuleTokenStream(adaptor,"token CLOSE_CURLY_BRACE");
		RewriteRuleTokenStream stream_OPEN_CURLY_BRACE=new RewriteRuleTokenStream(adaptor,"token OPEN_CURLY_BRACE");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");
		RewriteRuleSubtreeStream stream_literal=new RewriteRuleSubtreeStream(adaptor,"rule literal");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:360:2: ( 'prov:derivedByRemovalFrom(' id0= optionalIdentifier id2= identifier ',' id1= identifier ',' '{' literal ( ',' literal )* '}' optionalAttributeValuePairs ')' -> ^( DBRF ^( ID ( $id0)? ) $id2 $id1 ^( KEYS ( literal )* ) optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:360:4: 'prov:derivedByRemovalFrom(' id0= optionalIdentifier id2= identifier ',' id1= identifier ',' '{' literal ( ',' literal )* '}' optionalAttributeValuePairs ')'
			{
			string_literal188=(Token)match(input,110,FOLLOW_110_in_removalExpression3413);  
			stream_110.add(string_literal188);

			pushFollow(FOLLOW_optionalIdentifier_in_removalExpression3418);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_identifier_in_removalExpression3422);
			id2=identifier();
			state._fsp--;

			stream_identifier.add(id2.getTree());
			char_literal189=(Token)match(input,93,FOLLOW_93_in_removalExpression3424);  
			stream_93.add(char_literal189);

			pushFollow(FOLLOW_identifier_in_removalExpression3428);
			id1=identifier();
			state._fsp--;

			stream_identifier.add(id1.getTree());
			char_literal190=(Token)match(input,93,FOLLOW_93_in_removalExpression3430);  
			stream_93.add(char_literal190);

			 qnameDisabled=true; 
			char_literal191=(Token)match(input,OPEN_CURLY_BRACE,FOLLOW_OPEN_CURLY_BRACE_in_removalExpression3434);  
			stream_OPEN_CURLY_BRACE.add(char_literal191);

			pushFollow(FOLLOW_literal_in_removalExpression3436);
			literal192=literal();
			state._fsp--;

			stream_literal.add(literal192.getTree());
			// org/openprovenance/prov/notation/PROV_N.g:360:131: ( ',' literal )*
			loop32:
			while (true) {
				int alt32=2;
				int LA32_0 = input.LA(1);
				if ( (LA32_0==93) ) {
					alt32=1;
				}

				switch (alt32) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:360:132: ',' literal
					{
					char_literal193=(Token)match(input,93,FOLLOW_93_in_removalExpression3439);  
					stream_93.add(char_literal193);

					pushFollow(FOLLOW_literal_in_removalExpression3441);
					literal194=literal();
					state._fsp--;

					stream_literal.add(literal194.getTree());
					}
					break;

				default :
					break loop32;
				}
			}

			char_literal195=(Token)match(input,CLOSE_CURLY_BRACE,FOLLOW_CLOSE_CURLY_BRACE_in_removalExpression3445);  
			stream_CLOSE_CURLY_BRACE.add(char_literal195);

			 qnameDisabled=false; 
			pushFollow(FOLLOW_optionalAttributeValuePairs_in_removalExpression3450);
			optionalAttributeValuePairs196=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(optionalAttributeValuePairs196.getTree());
			char_literal197=(Token)match(input,92,FOLLOW_92_in_removalExpression3452);  
			stream_92.add(char_literal197);

			// AST REWRITE
			// elements: id1, optionalAttributeValuePairs, literal, id0, id2
			// token labels: 
			// rule labels: id0, id2, id1, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_id2=new RewriteRuleSubtreeStream(adaptor,"rule id2",id2!=null?id2.getTree():null);
			RewriteRuleSubtreeStream stream_id1=new RewriteRuleSubtreeStream(adaptor,"rule id1",id1!=null?id1.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 361:7: -> ^( DBRF ^( ID ( $id0)? ) $id2 $id1 ^( KEYS ( literal )* ) optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:361:10: ^( DBRF ^( ID ( $id0)? ) $id2 $id1 ^( KEYS ( literal )* ) optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(DBRF, "DBRF"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:361:17: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:361:23: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:361:39: ^( KEYS ( literal )* )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(KEYS, "KEYS"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:361:46: ( literal )*
				while ( stream_literal.hasNext() ) {
					adaptor.addChild(root_2, stream_literal.nextTree());
				}
				stream_literal.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

			 qnameDisabled = false; 
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "removalExpression"


	public static class dictionaryMembershipExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "dictionaryMembershipExpression"
	// org/openprovenance/prov/notation/PROV_N.g:366:1: dictionaryMembershipExpression : 'prov:hadDictionaryMember(' id1= identifier ',' id2= identifier ',' literal ')' -> ^( DMEM ^( ID ) $id1 ^( KES ^( KEYS literal ) ^( VALUES $id2) ) ) ;
	public final PROV_NParser.dictionaryMembershipExpression_return dictionaryMembershipExpression() throws RecognitionException {
		PROV_NParser.dictionaryMembershipExpression_return retval = new PROV_NParser.dictionaryMembershipExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal198=null;
		Token char_literal199=null;
		Token char_literal200=null;
		Token char_literal202=null;
		ParserRuleReturnScope id1 =null;
		ParserRuleReturnScope id2 =null;
		ParserRuleReturnScope literal201 =null;

		Object string_literal198_tree=null;
		Object char_literal199_tree=null;
		Object char_literal200_tree=null;
		Object char_literal202_tree=null;
		RewriteRuleTokenStream stream_111=new RewriteRuleTokenStream(adaptor,"token 111");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_literal=new RewriteRuleSubtreeStream(adaptor,"rule literal");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:367:2: ( 'prov:hadDictionaryMember(' id1= identifier ',' id2= identifier ',' literal ')' -> ^( DMEM ^( ID ) $id1 ^( KES ^( KEYS literal ) ^( VALUES $id2) ) ) )
			// org/openprovenance/prov/notation/PROV_N.g:367:5: 'prov:hadDictionaryMember(' id1= identifier ',' id2= identifier ',' literal ')'
			{
			string_literal198=(Token)match(input,111,FOLLOW_111_in_dictionaryMembershipExpression3502);  
			stream_111.add(string_literal198);

			pushFollow(FOLLOW_identifier_in_dictionaryMembershipExpression3507);
			id1=identifier();
			state._fsp--;

			stream_identifier.add(id1.getTree());
			char_literal199=(Token)match(input,93,FOLLOW_93_in_dictionaryMembershipExpression3509);  
			stream_93.add(char_literal199);

			pushFollow(FOLLOW_identifier_in_dictionaryMembershipExpression3513);
			id2=identifier();
			state._fsp--;

			stream_identifier.add(id2.getTree());
			char_literal200=(Token)match(input,93,FOLLOW_93_in_dictionaryMembershipExpression3515);  
			stream_93.add(char_literal200);

			pushFollow(FOLLOW_literal_in_dictionaryMembershipExpression3517);
			literal201=literal();
			state._fsp--;

			stream_literal.add(literal201.getTree());
			char_literal202=(Token)match(input,92,FOLLOW_92_in_dictionaryMembershipExpression3519);  
			stream_92.add(char_literal202);

			// AST REWRITE
			// elements: literal, id2, id1
			// token labels: 
			// rule labels: id2, id1, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_id2=new RewriteRuleSubtreeStream(adaptor,"rule id2",id2!=null?id2.getTree():null);
			RewriteRuleSubtreeStream stream_id1=new RewriteRuleSubtreeStream(adaptor,"rule id1",id1!=null?id1.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 368:7: -> ^( DMEM ^( ID ) $id1 ^( KES ^( KEYS literal ) ^( VALUES $id2) ) )
			{
				// org/openprovenance/prov/notation/PROV_N.g:368:10: ^( DMEM ^( ID ) $id1 ^( KES ^( KEYS literal ) ^( VALUES $id2) ) )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(DMEM, "DMEM"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:368:17: ^( ID )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_1, stream_id1.nextTree());
				// org/openprovenance/prov/notation/PROV_N.g:368:28: ^( KES ^( KEYS literal ) ^( VALUES $id2) )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(KES, "KES"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:368:34: ^( KEYS literal )
				{
				Object root_3 = (Object)adaptor.nil();
				root_3 = (Object)adaptor.becomeRoot((Object)adaptor.create(KEYS, "KEYS"), root_3);
				adaptor.addChild(root_3, stream_literal.nextTree());
				adaptor.addChild(root_2, root_3);
				}

				// org/openprovenance/prov/notation/PROV_N.g:368:50: ^( VALUES $id2)
				{
				Object root_3 = (Object)adaptor.nil();
				root_3 = (Object)adaptor.becomeRoot((Object)adaptor.create(VALUES, "VALUES"), root_3);
				adaptor.addChild(root_3, stream_id2.nextTree());
				adaptor.addChild(root_2, root_3);
				}

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "dictionaryMembershipExpression"


	public static class collectionMembershipExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "collectionMembershipExpression"
	// org/openprovenance/prov/notation/PROV_N.g:373:1: collectionMembershipExpression : 'hadMember' '(' id2= identifier ',' id1= identifier ')' -> ^( MEM $id2 $id1) ;
	public final PROV_NParser.collectionMembershipExpression_return collectionMembershipExpression() throws RecognitionException {
		PROV_NParser.collectionMembershipExpression_return retval = new PROV_NParser.collectionMembershipExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token string_literal203=null;
		Token char_literal204=null;
		Token char_literal205=null;
		Token char_literal206=null;
		ParserRuleReturnScope id2 =null;
		ParserRuleReturnScope id1 =null;

		Object string_literal203_tree=null;
		Object char_literal204_tree=null;
		Object char_literal205_tree=null;
		Object char_literal206_tree=null;
		RewriteRuleTokenStream stream_105=new RewriteRuleTokenStream(adaptor,"token 105");
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:374:2: ( 'hadMember' '(' id2= identifier ',' id1= identifier ')' -> ^( MEM $id2 $id1) )
			// org/openprovenance/prov/notation/PROV_N.g:374:5: 'hadMember' '(' id2= identifier ',' id1= identifier ')'
			{
			string_literal203=(Token)match(input,105,FOLLOW_105_in_collectionMembershipExpression3569);  
			stream_105.add(string_literal203);

			char_literal204=(Token)match(input,91,FOLLOW_91_in_collectionMembershipExpression3571);  
			stream_91.add(char_literal204);

			pushFollow(FOLLOW_identifier_in_collectionMembershipExpression3576);
			id2=identifier();
			state._fsp--;

			stream_identifier.add(id2.getTree());
			char_literal205=(Token)match(input,93,FOLLOW_93_in_collectionMembershipExpression3578);  
			stream_93.add(char_literal205);

			pushFollow(FOLLOW_identifier_in_collectionMembershipExpression3582);
			id1=identifier();
			state._fsp--;

			stream_identifier.add(id1.getTree());
			char_literal206=(Token)match(input,92,FOLLOW_92_in_collectionMembershipExpression3584);  
			stream_92.add(char_literal206);

			// AST REWRITE
			// elements: id2, id1
			// token labels: 
			// rule labels: id2, id1, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_id2=new RewriteRuleSubtreeStream(adaptor,"rule id2",id2!=null?id2.getTree():null);
			RewriteRuleSubtreeStream stream_id1=new RewriteRuleSubtreeStream(adaptor,"rule id1",id1!=null?id1.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 375:7: -> ^( MEM $id2 $id1)
			{
				// org/openprovenance/prov/notation/PROV_N.g:375:10: ^( MEM $id2 $id1)
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(MEM, "MEM"), root_1);
				adaptor.addChild(root_1, stream_id2.nextTree());
				adaptor.addChild(root_1, stream_id1.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "collectionMembershipExpression"


	public static class keyEntitySet_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "keyEntitySet"
	// org/openprovenance/prov/notation/PROV_N.g:385:1: keyEntitySet : '{' '(' literal ',' identifier ')' ( ',' '(' literal ',' identifier ')' )* '}' -> ^( KES ^( KEYS ( literal )+ ) ^( VALUES ( identifier )+ ) ) ;
	public final PROV_NParser.keyEntitySet_return keyEntitySet() throws RecognitionException {
		PROV_NParser.keyEntitySet_return retval = new PROV_NParser.keyEntitySet_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token char_literal207=null;
		Token char_literal208=null;
		Token char_literal210=null;
		Token char_literal212=null;
		Token char_literal213=null;
		Token char_literal214=null;
		Token char_literal216=null;
		Token char_literal218=null;
		Token char_literal219=null;
		ParserRuleReturnScope literal209 =null;
		ParserRuleReturnScope identifier211 =null;
		ParserRuleReturnScope literal215 =null;
		ParserRuleReturnScope identifier217 =null;

		Object char_literal207_tree=null;
		Object char_literal208_tree=null;
		Object char_literal210_tree=null;
		Object char_literal212_tree=null;
		Object char_literal213_tree=null;
		Object char_literal214_tree=null;
		Object char_literal216_tree=null;
		Object char_literal218_tree=null;
		Object char_literal219_tree=null;
		RewriteRuleTokenStream stream_CLOSE_CURLY_BRACE=new RewriteRuleTokenStream(adaptor,"token CLOSE_CURLY_BRACE");
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_OPEN_CURLY_BRACE=new RewriteRuleTokenStream(adaptor,"token OPEN_CURLY_BRACE");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
		RewriteRuleSubtreeStream stream_literal=new RewriteRuleSubtreeStream(adaptor,"rule literal");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:387:5: ( '{' '(' literal ',' identifier ')' ( ',' '(' literal ',' identifier ')' )* '}' -> ^( KES ^( KEYS ( literal )+ ) ^( VALUES ( identifier )+ ) ) )
			// org/openprovenance/prov/notation/PROV_N.g:387:7: '{' '(' literal ',' identifier ')' ( ',' '(' literal ',' identifier ')' )* '}'
			{
			char_literal207=(Token)match(input,OPEN_CURLY_BRACE,FOLLOW_OPEN_CURLY_BRACE_in_keyEntitySet3626);  
			stream_OPEN_CURLY_BRACE.add(char_literal207);

			char_literal208=(Token)match(input,91,FOLLOW_91_in_keyEntitySet3629);  
			stream_91.add(char_literal208);

			 qnameDisabled=true; 
			pushFollow(FOLLOW_literal_in_keyEntitySet3635);
			literal209=literal();
			state._fsp--;

			stream_literal.add(literal209.getTree());
			qnameDisabled=false; 
			char_literal210=(Token)match(input,93,FOLLOW_93_in_keyEntitySet3639);  
			stream_93.add(char_literal210);

			pushFollow(FOLLOW_identifier_in_keyEntitySet3642);
			identifier211=identifier();
			state._fsp--;

			stream_identifier.add(identifier211.getTree());
			char_literal212=(Token)match(input,92,FOLLOW_92_in_keyEntitySet3645);  
			stream_92.add(char_literal212);

			// org/openprovenance/prov/notation/PROV_N.g:387:95: ( ',' '(' literal ',' identifier ')' )*
			loop33:
			while (true) {
				int alt33=2;
				int LA33_0 = input.LA(1);
				if ( (LA33_0==93) ) {
					alt33=1;
				}

				switch (alt33) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:387:97: ',' '(' literal ',' identifier ')'
					{
					char_literal213=(Token)match(input,93,FOLLOW_93_in_keyEntitySet3649);  
					stream_93.add(char_literal213);

					char_literal214=(Token)match(input,91,FOLLOW_91_in_keyEntitySet3652);  
					stream_91.add(char_literal214);

					qnameDisabled=true; 
					pushFollow(FOLLOW_literal_in_keyEntitySet3657);
					literal215=literal();
					state._fsp--;

					stream_literal.add(literal215.getTree());
					qnameDisabled=false; 
					char_literal216=(Token)match(input,93,FOLLOW_93_in_keyEntitySet3662);  
					stream_93.add(char_literal216);

					pushFollow(FOLLOW_identifier_in_keyEntitySet3664);
					identifier217=identifier();
					state._fsp--;

					stream_identifier.add(identifier217.getTree());
					char_literal218=(Token)match(input,92,FOLLOW_92_in_keyEntitySet3667);  
					stream_92.add(char_literal218);

					}
					break;

				default :
					break loop33;
				}
			}

			char_literal219=(Token)match(input,CLOSE_CURLY_BRACE,FOLLOW_CLOSE_CURLY_BRACE_in_keyEntitySet3672);  
			stream_CLOSE_CURLY_BRACE.add(char_literal219);

			// AST REWRITE
			// elements: literal, identifier
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 388:7: -> ^( KES ^( KEYS ( literal )+ ) ^( VALUES ( identifier )+ ) )
			{
				// org/openprovenance/prov/notation/PROV_N.g:388:10: ^( KES ^( KEYS ( literal )+ ) ^( VALUES ( identifier )+ ) )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(KES, "KES"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:388:16: ^( KEYS ( literal )+ )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(KEYS, "KEYS"), root_2);
				if ( !(stream_literal.hasNext()) ) {
					throw new RewriteEarlyExitException();
				}
				while ( stream_literal.hasNext() ) {
					adaptor.addChild(root_2, stream_literal.nextTree());
				}
				stream_literal.reset();

				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:388:33: ^( VALUES ( identifier )+ )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(VALUES, "VALUES"), root_2);
				if ( !(stream_identifier.hasNext()) ) {
					throw new RewriteEarlyExitException();
				}
				while ( stream_identifier.hasNext() ) {
					adaptor.addChild(root_2, stream_identifier.nextTree());
				}
				stream_identifier.reset();

				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "keyEntitySet"


	public static class entitySet_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "entitySet"
	// org/openprovenance/prov/notation/PROV_N.g:395:1: entitySet : '{' ( identifier )* '}' -> ^( ES ( identifier )? ) ;
	public final PROV_NParser.entitySet_return entitySet() throws RecognitionException {
		PROV_NParser.entitySet_return retval = new PROV_NParser.entitySet_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token char_literal220=null;
		Token char_literal222=null;
		ParserRuleReturnScope identifier221 =null;

		Object char_literal220_tree=null;
		Object char_literal222_tree=null;
		RewriteRuleTokenStream stream_CLOSE_CURLY_BRACE=new RewriteRuleTokenStream(adaptor,"token CLOSE_CURLY_BRACE");
		RewriteRuleTokenStream stream_OPEN_CURLY_BRACE=new RewriteRuleTokenStream(adaptor,"token OPEN_CURLY_BRACE");
		RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:396:5: ( '{' ( identifier )* '}' -> ^( ES ( identifier )? ) )
			// org/openprovenance/prov/notation/PROV_N.g:396:7: '{' ( identifier )* '}'
			{
			char_literal220=(Token)match(input,OPEN_CURLY_BRACE,FOLLOW_OPEN_CURLY_BRACE_in_entitySet3719);  
			stream_OPEN_CURLY_BRACE.add(char_literal220);

			// org/openprovenance/prov/notation/PROV_N.g:396:12: ( identifier )*
			loop34:
			while (true) {
				int alt34=2;
				int LA34_0 = input.LA(1);
				if ( (LA34_0==QUALIFIED_NAME) ) {
					alt34=1;
				}

				switch (alt34) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:396:12: identifier
					{
					pushFollow(FOLLOW_identifier_in_entitySet3722);
					identifier221=identifier();
					state._fsp--;

					stream_identifier.add(identifier221.getTree());
					}
					break;

				default :
					break loop34;
				}
			}

			char_literal222=(Token)match(input,CLOSE_CURLY_BRACE,FOLLOW_CLOSE_CURLY_BRACE_in_entitySet3725);  
			stream_CLOSE_CURLY_BRACE.add(char_literal222);

			// AST REWRITE
			// elements: identifier
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 397:7: -> ^( ES ( identifier )? )
			{
				// org/openprovenance/prov/notation/PROV_N.g:397:10: ^( ES ( identifier )? )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(ES, "ES"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:397:16: ( identifier )?
				if ( stream_identifier.hasNext() ) {
					adaptor.addChild(root_1, stream_identifier.nextTree());
				}
				stream_identifier.reset();

				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "entitySet"


	public static class extensibilityExpression_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "extensibilityExpression"
	// org/openprovenance/prov/notation/PROV_N.g:408:1: extensibilityExpression : qn= QUALIFIED_NAME '(' id0= optionalIdentifier extensibilityArgument ( ',' extensibilityArgument )* attr= optionalAttributeValuePairs ')' -> {$attr.tree==null}? ^( EXT ^( ID QUALIFIED_NAME ) ^( ID ( $id0)? ) ( extensibilityArgument )* ^( ATTRIBUTES ) ) -> ^( EXT ^( ID QUALIFIED_NAME ) ^( ID ( $id0)? ) ( extensibilityArgument )* optionalAttributeValuePairs ) ;
	public final PROV_NParser.extensibilityExpression_return extensibilityExpression() throws RecognitionException {
		PROV_NParser.extensibilityExpression_return retval = new PROV_NParser.extensibilityExpression_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token qn=null;
		Token char_literal223=null;
		Token char_literal225=null;
		Token char_literal227=null;
		ParserRuleReturnScope id0 =null;
		ParserRuleReturnScope attr =null;
		ParserRuleReturnScope extensibilityArgument224 =null;
		ParserRuleReturnScope extensibilityArgument226 =null;

		Object qn_tree=null;
		Object char_literal223_tree=null;
		Object char_literal225_tree=null;
		Object char_literal227_tree=null;
		RewriteRuleTokenStream stream_91=new RewriteRuleTokenStream(adaptor,"token 91");
		RewriteRuleTokenStream stream_92=new RewriteRuleTokenStream(adaptor,"token 92");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleTokenStream stream_QUALIFIED_NAME=new RewriteRuleTokenStream(adaptor,"token QUALIFIED_NAME");
		RewriteRuleSubtreeStream stream_extensibilityArgument=new RewriteRuleSubtreeStream(adaptor,"rule extensibilityArgument");
		RewriteRuleSubtreeStream stream_optionalAttributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule optionalAttributeValuePairs");
		RewriteRuleSubtreeStream stream_optionalIdentifier=new RewriteRuleSubtreeStream(adaptor,"rule optionalIdentifier");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:409:2: (qn= QUALIFIED_NAME '(' id0= optionalIdentifier extensibilityArgument ( ',' extensibilityArgument )* attr= optionalAttributeValuePairs ')' -> {$attr.tree==null}? ^( EXT ^( ID QUALIFIED_NAME ) ^( ID ( $id0)? ) ( extensibilityArgument )* ^( ATTRIBUTES ) ) -> ^( EXT ^( ID QUALIFIED_NAME ) ^( ID ( $id0)? ) ( extensibilityArgument )* optionalAttributeValuePairs ) )
			// org/openprovenance/prov/notation/PROV_N.g:409:4: qn= QUALIFIED_NAME '(' id0= optionalIdentifier extensibilityArgument ( ',' extensibilityArgument )* attr= optionalAttributeValuePairs ')'
			{
			qn=(Token)match(input,QUALIFIED_NAME,FOLLOW_QUALIFIED_NAME_in_extensibilityExpression3763);  
			stream_QUALIFIED_NAME.add(qn);

			 System.out.println("extensibility: qnameDisabled " + qnameDisabled + " " + (qn!=null?qn.getText():null)); 
			char_literal223=(Token)match(input,91,FOLLOW_91_in_extensibilityExpression3768);  
			stream_91.add(char_literal223);

			pushFollow(FOLLOW_optionalIdentifier_in_extensibilityExpression3772);
			id0=optionalIdentifier();
			state._fsp--;

			stream_optionalIdentifier.add(id0.getTree());
			pushFollow(FOLLOW_extensibilityArgument_in_extensibilityExpression3774);
			extensibilityArgument224=extensibilityArgument();
			state._fsp--;

			stream_extensibilityArgument.add(extensibilityArgument224.getTree());
			// org/openprovenance/prov/notation/PROV_N.g:409:162: ( ',' extensibilityArgument )*
			loop35:
			while (true) {
				int alt35=2;
				int LA35_0 = input.LA(1);
				if ( (LA35_0==93) ) {
					int LA35_1 = input.LA(2);
					if ( (LA35_1==DateTime||LA35_1==INT_LITERAL||LA35_1==MINUS||LA35_1==OPEN_CURLY_BRACE||LA35_1==QUALIFIED_NAME||(LA35_1 >= STRING_LITERAL && LA35_1 <= STRING_LITERAL_LONG2)||(LA35_1 >= 91 && LA35_1 <= 94)) ) {
						alt35=1;
					}

				}

				switch (alt35) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:409:164: ',' extensibilityArgument
					{
					char_literal225=(Token)match(input,93,FOLLOW_93_in_extensibilityExpression3778);  
					stream_93.add(char_literal225);

					pushFollow(FOLLOW_extensibilityArgument_in_extensibilityExpression3781);
					extensibilityArgument226=extensibilityArgument();
					state._fsp--;

					stream_extensibilityArgument.add(extensibilityArgument226.getTree());
					}
					break;

				default :
					break loop35;
				}
			}

			pushFollow(FOLLOW_optionalAttributeValuePairs_in_extensibilityExpression3787);
			attr=optionalAttributeValuePairs();
			state._fsp--;

			stream_optionalAttributeValuePairs.add(attr.getTree());
			char_literal227=(Token)match(input,92,FOLLOW_92_in_extensibilityExpression3789);  
			stream_92.add(char_literal227);

			// AST REWRITE
			// elements: extensibilityArgument, id0, extensibilityArgument, id0, QUALIFIED_NAME, optionalAttributeValuePairs, QUALIFIED_NAME
			// token labels: 
			// rule labels: id0, retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_id0=new RewriteRuleSubtreeStream(adaptor,"rule id0",id0!=null?id0.getTree():null);
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 410:7: -> {$attr.tree==null}? ^( EXT ^( ID QUALIFIED_NAME ) ^( ID ( $id0)? ) ( extensibilityArgument )* ^( ATTRIBUTES ) )
			if ((attr!=null?((Object)attr.getTree()):null)==null) {
				// org/openprovenance/prov/notation/PROV_N.g:411:10: ^( EXT ^( ID QUALIFIED_NAME ) ^( ID ( $id0)? ) ( extensibilityArgument )* ^( ATTRIBUTES ) )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(EXT, "EXT"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:411:16: ^( ID QUALIFIED_NAME )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_2, stream_QUALIFIED_NAME.nextNode());
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:411:37: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:411:43: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:411:49: ( extensibilityArgument )*
				while ( stream_extensibilityArgument.hasNext() ) {
					adaptor.addChild(root_1, stream_extensibilityArgument.nextTree());
				}
				stream_extensibilityArgument.reset();

				// org/openprovenance/prov/notation/PROV_N.g:411:72: ^( ATTRIBUTES )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ATTRIBUTES, "ATTRIBUTES"), root_2);
				adaptor.addChild(root_1, root_2);
				}

				adaptor.addChild(root_0, root_1);
				}

			}

			else // 412:7: -> ^( EXT ^( ID QUALIFIED_NAME ) ^( ID ( $id0)? ) ( extensibilityArgument )* optionalAttributeValuePairs )
			{
				// org/openprovenance/prov/notation/PROV_N.g:412:10: ^( EXT ^( ID QUALIFIED_NAME ) ^( ID ( $id0)? ) ( extensibilityArgument )* optionalAttributeValuePairs )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(EXT, "EXT"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:412:16: ^( ID QUALIFIED_NAME )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				adaptor.addChild(root_2, stream_QUALIFIED_NAME.nextNode());
				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:412:37: ^( ID ( $id0)? )
				{
				Object root_2 = (Object)adaptor.nil();
				root_2 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_2);
				// org/openprovenance/prov/notation/PROV_N.g:412:43: ( $id0)?
				if ( stream_id0.hasNext() ) {
					adaptor.addChild(root_2, stream_id0.nextTree());
				}
				stream_id0.reset();

				adaptor.addChild(root_1, root_2);
				}

				// org/openprovenance/prov/notation/PROV_N.g:412:49: ( extensibilityArgument )*
				while ( stream_extensibilityArgument.hasNext() ) {
					adaptor.addChild(root_1, stream_extensibilityArgument.nextTree());
				}
				stream_extensibilityArgument.reset();

				adaptor.addChild(root_1, stream_optionalAttributeValuePairs.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "extensibilityExpression"


	public static class extensibilityArgument_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "extensibilityArgument"
	// org/openprovenance/prov/notation/PROV_N.g:415:1: extensibilityArgument : ( identifierOrMarker | literal | time | extensibilityExpression | extensibilityRecord ) ;
	public final PROV_NParser.extensibilityArgument_return extensibilityArgument() throws RecognitionException {
		PROV_NParser.extensibilityArgument_return retval = new PROV_NParser.extensibilityArgument_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		ParserRuleReturnScope identifierOrMarker228 =null;
		ParserRuleReturnScope literal229 =null;
		ParserRuleReturnScope time230 =null;
		ParserRuleReturnScope extensibilityExpression231 =null;
		ParserRuleReturnScope extensibilityRecord232 =null;


		try {
			// org/openprovenance/prov/notation/PROV_N.g:416:5: ( ( identifierOrMarker | literal | time | extensibilityExpression | extensibilityRecord ) )
			// org/openprovenance/prov/notation/PROV_N.g:416:7: ( identifierOrMarker | literal | time | extensibilityExpression | extensibilityRecord )
			{
			root_0 = (Object)adaptor.nil();


			// org/openprovenance/prov/notation/PROV_N.g:416:7: ( identifierOrMarker | literal | time | extensibilityExpression | extensibilityRecord )
			int alt36=5;
			switch ( input.LA(1) ) {
			case QUALIFIED_NAME:
				{
				int LA36_1 = input.LA(2);
				if ( (LA36_1==CLOSE_CURLY_BRACE||(LA36_1 >= 92 && LA36_1 <= 93)) ) {
					alt36=1;
				}
				else if ( (LA36_1==91) ) {
					alt36=4;
				}

				else {
					int nvaeMark = input.mark();
					try {
						input.consume();
						NoViableAltException nvae =
							new NoViableAltException("", 36, 1, input);
						throw nvae;
					} finally {
						input.rewind(nvaeMark);
					}
				}

				}
				break;
			case MINUS:
				{
				alt36=1;
				}
				break;
			case CLOSE_CURLY_BRACE:
			case INT_LITERAL:
			case STRING_LITERAL:
			case STRING_LITERAL_LONG2:
			case 92:
			case 93:
			case 94:
				{
				alt36=2;
				}
				break;
			case DateTime:
				{
				alt36=3;
				}
				break;
			case OPEN_CURLY_BRACE:
			case 91:
				{
				alt36=5;
				}
				break;
			default:
				NoViableAltException nvae =
					new NoViableAltException("", 36, 0, input);
				throw nvae;
			}
			switch (alt36) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:416:9: identifierOrMarker
					{
					pushFollow(FOLLOW_identifierOrMarker_in_extensibilityArgument3880);
					identifierOrMarker228=identifierOrMarker();
					state._fsp--;

					adaptor.addChild(root_0, identifierOrMarker228.getTree());

					}
					break;
				case 2 :
					// org/openprovenance/prov/notation/PROV_N.g:416:30: literal
					{
					pushFollow(FOLLOW_literal_in_extensibilityArgument3884);
					literal229=literal();
					state._fsp--;

					adaptor.addChild(root_0, literal229.getTree());

					}
					break;
				case 3 :
					// org/openprovenance/prov/notation/PROV_N.g:416:40: time
					{
					pushFollow(FOLLOW_time_in_extensibilityArgument3888);
					time230=time();
					state._fsp--;

					adaptor.addChild(root_0, time230.getTree());

					}
					break;
				case 4 :
					// org/openprovenance/prov/notation/PROV_N.g:416:48: extensibilityExpression
					{
					pushFollow(FOLLOW_extensibilityExpression_in_extensibilityArgument3893);
					extensibilityExpression231=extensibilityExpression();
					state._fsp--;

					adaptor.addChild(root_0, extensibilityExpression231.getTree());

					}
					break;
				case 5 :
					// org/openprovenance/prov/notation/PROV_N.g:416:74: extensibilityRecord
					{
					pushFollow(FOLLOW_extensibilityRecord_in_extensibilityArgument3897);
					extensibilityRecord232=extensibilityRecord();
					state._fsp--;

					adaptor.addChild(root_0, extensibilityRecord232.getTree());

					}
					break;

			}

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "extensibilityArgument"


	public static class extensibilityRecord_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "extensibilityRecord"
	// org/openprovenance/prov/notation/PROV_N.g:419:1: extensibilityRecord : ( '{' extensibilityArgument ( ',' extensibilityArgument )* '}' | '(' extensibilityArgument ( ',' extensibilityArgument )* ')' );
	public final PROV_NParser.extensibilityRecord_return extensibilityRecord() throws RecognitionException {
		PROV_NParser.extensibilityRecord_return retval = new PROV_NParser.extensibilityRecord_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token char_literal233=null;
		Token char_literal235=null;
		Token char_literal237=null;
		Token char_literal238=null;
		Token char_literal240=null;
		Token char_literal242=null;
		ParserRuleReturnScope extensibilityArgument234 =null;
		ParserRuleReturnScope extensibilityArgument236 =null;
		ParserRuleReturnScope extensibilityArgument239 =null;
		ParserRuleReturnScope extensibilityArgument241 =null;

		Object char_literal233_tree=null;
		Object char_literal235_tree=null;
		Object char_literal237_tree=null;
		Object char_literal238_tree=null;
		Object char_literal240_tree=null;
		Object char_literal242_tree=null;

		try {
			// org/openprovenance/prov/notation/PROV_N.g:419:20: ( '{' extensibilityArgument ( ',' extensibilityArgument )* '}' | '(' extensibilityArgument ( ',' extensibilityArgument )* ')' )
			int alt39=2;
			int LA39_0 = input.LA(1);
			if ( (LA39_0==OPEN_CURLY_BRACE) ) {
				alt39=1;
			}
			else if ( (LA39_0==91) ) {
				alt39=2;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 39, 0, input);
				throw nvae;
			}

			switch (alt39) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:420:2: '{' extensibilityArgument ( ',' extensibilityArgument )* '}'
					{
					root_0 = (Object)adaptor.nil();


					char_literal233=(Token)match(input,OPEN_CURLY_BRACE,FOLLOW_OPEN_CURLY_BRACE_in_extensibilityRecord3909); 
					char_literal233_tree = (Object)adaptor.create(char_literal233);
					adaptor.addChild(root_0, char_literal233_tree);

					pushFollow(FOLLOW_extensibilityArgument_in_extensibilityRecord3911);
					extensibilityArgument234=extensibilityArgument();
					state._fsp--;

					adaptor.addChild(root_0, extensibilityArgument234.getTree());

					// org/openprovenance/prov/notation/PROV_N.g:420:28: ( ',' extensibilityArgument )*
					loop37:
					while (true) {
						int alt37=2;
						int LA37_0 = input.LA(1);
						if ( (LA37_0==93) ) {
							alt37=1;
						}

						switch (alt37) {
						case 1 :
							// org/openprovenance/prov/notation/PROV_N.g:420:29: ',' extensibilityArgument
							{
							char_literal235=(Token)match(input,93,FOLLOW_93_in_extensibilityRecord3914); 
							char_literal235_tree = (Object)adaptor.create(char_literal235);
							adaptor.addChild(root_0, char_literal235_tree);

							pushFollow(FOLLOW_extensibilityArgument_in_extensibilityRecord3916);
							extensibilityArgument236=extensibilityArgument();
							state._fsp--;

							adaptor.addChild(root_0, extensibilityArgument236.getTree());

							}
							break;

						default :
							break loop37;
						}
					}

					char_literal237=(Token)match(input,CLOSE_CURLY_BRACE,FOLLOW_CLOSE_CURLY_BRACE_in_extensibilityRecord3920); 
					char_literal237_tree = (Object)adaptor.create(char_literal237);
					adaptor.addChild(root_0, char_literal237_tree);

					}
					break;
				case 2 :
					// org/openprovenance/prov/notation/PROV_N.g:420:64: '(' extensibilityArgument ( ',' extensibilityArgument )* ')'
					{
					root_0 = (Object)adaptor.nil();


					char_literal238=(Token)match(input,91,FOLLOW_91_in_extensibilityRecord3925); 
					char_literal238_tree = (Object)adaptor.create(char_literal238);
					adaptor.addChild(root_0, char_literal238_tree);

					pushFollow(FOLLOW_extensibilityArgument_in_extensibilityRecord3927);
					extensibilityArgument239=extensibilityArgument();
					state._fsp--;

					adaptor.addChild(root_0, extensibilityArgument239.getTree());

					// org/openprovenance/prov/notation/PROV_N.g:420:90: ( ',' extensibilityArgument )*
					loop38:
					while (true) {
						int alt38=2;
						int LA38_0 = input.LA(1);
						if ( (LA38_0==93) ) {
							alt38=1;
						}

						switch (alt38) {
						case 1 :
							// org/openprovenance/prov/notation/PROV_N.g:420:91: ',' extensibilityArgument
							{
							char_literal240=(Token)match(input,93,FOLLOW_93_in_extensibilityRecord3930); 
							char_literal240_tree = (Object)adaptor.create(char_literal240);
							adaptor.addChild(root_0, char_literal240_tree);

							pushFollow(FOLLOW_extensibilityArgument_in_extensibilityRecord3932);
							extensibilityArgument241=extensibilityArgument();
							state._fsp--;

							adaptor.addChild(root_0, extensibilityArgument241.getTree());

							}
							break;

						default :
							break loop38;
						}
					}

					char_literal242=(Token)match(input,92,FOLLOW_92_in_extensibilityRecord3936); 
					char_literal242_tree = (Object)adaptor.create(char_literal242);
					adaptor.addChild(root_0, char_literal242_tree);

					}
					break;

			}
			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "extensibilityRecord"


	public static class iriOrMarker_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "iriOrMarker"
	// org/openprovenance/prov/notation/PROV_N.g:425:1: iriOrMarker : ( IRI_REF -> ^( IRI IRI_REF ) | '-' -> ^( IRI ) ) ;
	public final PROV_NParser.iriOrMarker_return iriOrMarker() throws RecognitionException {
		PROV_NParser.iriOrMarker_return retval = new PROV_NParser.iriOrMarker_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token IRI_REF243=null;
		Token char_literal244=null;

		Object IRI_REF243_tree=null;
		Object char_literal244_tree=null;
		RewriteRuleTokenStream stream_IRI_REF=new RewriteRuleTokenStream(adaptor,"token IRI_REF");
		RewriteRuleTokenStream stream_MINUS=new RewriteRuleTokenStream(adaptor,"token MINUS");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:426:5: ( ( IRI_REF -> ^( IRI IRI_REF ) | '-' -> ^( IRI ) ) )
			// org/openprovenance/prov/notation/PROV_N.g:427:7: ( IRI_REF -> ^( IRI IRI_REF ) | '-' -> ^( IRI ) )
			{
			// org/openprovenance/prov/notation/PROV_N.g:427:7: ( IRI_REF -> ^( IRI IRI_REF ) | '-' -> ^( IRI ) )
			int alt40=2;
			int LA40_0 = input.LA(1);
			if ( (LA40_0==IRI_REF) ) {
				alt40=1;
			}
			else if ( (LA40_0==MINUS) ) {
				alt40=2;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 40, 0, input);
				throw nvae;
			}

			switch (alt40) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:427:9: IRI_REF
					{
					IRI_REF243=(Token)match(input,IRI_REF,FOLLOW_IRI_REF_in_iriOrMarker3959);  
					stream_IRI_REF.add(IRI_REF243);

					// AST REWRITE
					// elements: IRI_REF
					// token labels: 
					// rule labels: retval
					// token list labels: 
					// rule list labels: 
					// wildcard labels: 
					retval.tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

					root_0 = (Object)adaptor.nil();
					// 427:17: -> ^( IRI IRI_REF )
					{
						// org/openprovenance/prov/notation/PROV_N.g:427:20: ^( IRI IRI_REF )
						{
						Object root_1 = (Object)adaptor.nil();
						root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(IRI, "IRI"), root_1);
						adaptor.addChild(root_1, stream_IRI_REF.nextNode());
						adaptor.addChild(root_0, root_1);
						}

					}


					retval.tree = root_0;

					}
					break;
				case 2 :
					// org/openprovenance/prov/notation/PROV_N.g:429:8: '-'
					{
					char_literal244=(Token)match(input,MINUS,FOLLOW_MINUS_in_iriOrMarker3985);  
					stream_MINUS.add(char_literal244);

					// AST REWRITE
					// elements: 
					// token labels: 
					// rule labels: retval
					// token list labels: 
					// rule list labels: 
					// wildcard labels: 
					retval.tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

					root_0 = (Object)adaptor.nil();
					// 429:12: -> ^( IRI )
					{
						// org/openprovenance/prov/notation/PROV_N.g:429:15: ^( IRI )
						{
						Object root_1 = (Object)adaptor.nil();
						root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(IRI, "IRI"), root_1);
						adaptor.addChild(root_0, root_1);
						}

					}


					retval.tree = root_0;

					}
					break;

			}

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "iriOrMarker"


	public static class optionalAttributeValuePairs_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "optionalAttributeValuePairs"
	// org/openprovenance/prov/notation/PROV_N.g:437:1: optionalAttributeValuePairs : ( ',' OPEN_SQUARE_BRACE attributeValuePairs CLOSE_SQUARE_BRACE )? -> ^( ATTRIBUTES ( attributeValuePairs )? ) ;
	public final PROV_NParser.optionalAttributeValuePairs_return optionalAttributeValuePairs() throws RecognitionException {
		PROV_NParser.optionalAttributeValuePairs_return retval = new PROV_NParser.optionalAttributeValuePairs_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token char_literal245=null;
		Token OPEN_SQUARE_BRACE246=null;
		Token CLOSE_SQUARE_BRACE248=null;
		ParserRuleReturnScope attributeValuePairs247 =null;

		Object char_literal245_tree=null;
		Object OPEN_SQUARE_BRACE246_tree=null;
		Object CLOSE_SQUARE_BRACE248_tree=null;
		RewriteRuleTokenStream stream_OPEN_SQUARE_BRACE=new RewriteRuleTokenStream(adaptor,"token OPEN_SQUARE_BRACE");
		RewriteRuleTokenStream stream_93=new RewriteRuleTokenStream(adaptor,"token 93");
		RewriteRuleTokenStream stream_CLOSE_SQUARE_BRACE=new RewriteRuleTokenStream(adaptor,"token CLOSE_SQUARE_BRACE");
		RewriteRuleSubtreeStream stream_attributeValuePairs=new RewriteRuleSubtreeStream(adaptor,"rule attributeValuePairs");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:438:5: ( ( ',' OPEN_SQUARE_BRACE attributeValuePairs CLOSE_SQUARE_BRACE )? -> ^( ATTRIBUTES ( attributeValuePairs )? ) )
			// org/openprovenance/prov/notation/PROV_N.g:439:5: ( ',' OPEN_SQUARE_BRACE attributeValuePairs CLOSE_SQUARE_BRACE )?
			{
			// org/openprovenance/prov/notation/PROV_N.g:439:5: ( ',' OPEN_SQUARE_BRACE attributeValuePairs CLOSE_SQUARE_BRACE )?
			int alt41=2;
			int LA41_0 = input.LA(1);
			if ( (LA41_0==93) ) {
				alt41=1;
			}
			switch (alt41) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:439:6: ',' OPEN_SQUARE_BRACE attributeValuePairs CLOSE_SQUARE_BRACE
					{
					char_literal245=(Token)match(input,93,FOLLOW_93_in_optionalAttributeValuePairs4020);  
					stream_93.add(char_literal245);

					OPEN_SQUARE_BRACE246=(Token)match(input,OPEN_SQUARE_BRACE,FOLLOW_OPEN_SQUARE_BRACE_in_optionalAttributeValuePairs4022);  
					stream_OPEN_SQUARE_BRACE.add(OPEN_SQUARE_BRACE246);

					pushFollow(FOLLOW_attributeValuePairs_in_optionalAttributeValuePairs4024);
					attributeValuePairs247=attributeValuePairs();
					state._fsp--;

					stream_attributeValuePairs.add(attributeValuePairs247.getTree());
					CLOSE_SQUARE_BRACE248=(Token)match(input,CLOSE_SQUARE_BRACE,FOLLOW_CLOSE_SQUARE_BRACE_in_optionalAttributeValuePairs4026);  
					stream_CLOSE_SQUARE_BRACE.add(CLOSE_SQUARE_BRACE248);

					}
					break;

			}

			// AST REWRITE
			// elements: attributeValuePairs
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 440:9: -> ^( ATTRIBUTES ( attributeValuePairs )? )
			{
				// org/openprovenance/prov/notation/PROV_N.g:440:12: ^( ATTRIBUTES ( attributeValuePairs )? )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(ATTRIBUTES, "ATTRIBUTES"), root_1);
				// org/openprovenance/prov/notation/PROV_N.g:440:25: ( attributeValuePairs )?
				if ( stream_attributeValuePairs.hasNext() ) {
					adaptor.addChild(root_1, stream_attributeValuePairs.nextTree());
				}
				stream_attributeValuePairs.reset();

				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "optionalAttributeValuePairs"


	public static class identifier_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "identifier"
	// org/openprovenance/prov/notation/PROV_N.g:444:1: identifier : QUALIFIED_NAME -> ^( ID QUALIFIED_NAME ) ;
	public final PROV_NParser.identifier_return identifier() throws RecognitionException {
		PROV_NParser.identifier_return retval = new PROV_NParser.identifier_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token QUALIFIED_NAME249=null;

		Object QUALIFIED_NAME249_tree=null;
		RewriteRuleTokenStream stream_QUALIFIED_NAME=new RewriteRuleTokenStream(adaptor,"token QUALIFIED_NAME");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:445:2: ( QUALIFIED_NAME -> ^( ID QUALIFIED_NAME ) )
			// org/openprovenance/prov/notation/PROV_N.g:446:9: QUALIFIED_NAME
			{
			QUALIFIED_NAME249=(Token)match(input,QUALIFIED_NAME,FOLLOW_QUALIFIED_NAME_in_identifier4068);  
			stream_QUALIFIED_NAME.add(QUALIFIED_NAME249);

			// AST REWRITE
			// elements: QUALIFIED_NAME
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 446:24: -> ^( ID QUALIFIED_NAME )
			{
				// org/openprovenance/prov/notation/PROV_N.g:446:27: ^( ID QUALIFIED_NAME )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(ID, "ID"), root_1);
				adaptor.addChild(root_1, stream_QUALIFIED_NAME.nextNode());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "identifier"


	public static class attribute_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "attribute"
	// org/openprovenance/prov/notation/PROV_N.g:449:1: attribute : QUALIFIED_NAME ;
	public final PROV_NParser.attribute_return attribute() throws RecognitionException {
		PROV_NParser.attribute_return retval = new PROV_NParser.attribute_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token QUALIFIED_NAME250=null;

		Object QUALIFIED_NAME250_tree=null;

		try {
			// org/openprovenance/prov/notation/PROV_N.g:450:2: ( QUALIFIED_NAME )
			// org/openprovenance/prov/notation/PROV_N.g:451:9: QUALIFIED_NAME
			{
			root_0 = (Object)adaptor.nil();


			QUALIFIED_NAME250=(Token)match(input,QUALIFIED_NAME,FOLLOW_QUALIFIED_NAME_in_attribute4095); 
			QUALIFIED_NAME250_tree = (Object)adaptor.create(QUALIFIED_NAME250);
			adaptor.addChild(root_0, QUALIFIED_NAME250_tree);

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "attribute"


	public static class attributeValuePairs_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "attributeValuePairs"
	// org/openprovenance/prov/notation/PROV_N.g:454:1: attributeValuePairs : (| attributeValuePair ( ',' ! attributeValuePair )* ) ;
	public final PROV_NParser.attributeValuePairs_return attributeValuePairs() throws RecognitionException {
		PROV_NParser.attributeValuePairs_return retval = new PROV_NParser.attributeValuePairs_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token char_literal252=null;
		ParserRuleReturnScope attributeValuePair251 =null;
		ParserRuleReturnScope attributeValuePair253 =null;

		Object char_literal252_tree=null;

		try {
			// org/openprovenance/prov/notation/PROV_N.g:455:2: ( (| attributeValuePair ( ',' ! attributeValuePair )* ) )
			// org/openprovenance/prov/notation/PROV_N.g:456:9: (| attributeValuePair ( ',' ! attributeValuePair )* )
			{
			root_0 = (Object)adaptor.nil();


			// org/openprovenance/prov/notation/PROV_N.g:456:9: (| attributeValuePair ( ',' ! attributeValuePair )* )
			int alt43=2;
			int LA43_0 = input.LA(1);
			if ( (LA43_0==CLOSE_SQUARE_BRACE) ) {
				alt43=1;
			}
			else if ( (LA43_0==QUALIFIED_NAME) ) {
				alt43=2;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 43, 0, input);
				throw nvae;
			}

			switch (alt43) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:456:12: 
					{
					}
					break;
				case 2 :
					// org/openprovenance/prov/notation/PROV_N.g:456:14: attributeValuePair ( ',' ! attributeValuePair )*
					{
					pushFollow(FOLLOW_attributeValuePair_in_attributeValuePairs4119);
					attributeValuePair251=attributeValuePair();
					state._fsp--;

					adaptor.addChild(root_0, attributeValuePair251.getTree());

					// org/openprovenance/prov/notation/PROV_N.g:456:33: ( ',' ! attributeValuePair )*
					loop42:
					while (true) {
						int alt42=2;
						int LA42_0 = input.LA(1);
						if ( (LA42_0==93) ) {
							alt42=1;
						}

						switch (alt42) {
						case 1 :
							// org/openprovenance/prov/notation/PROV_N.g:456:35: ',' ! attributeValuePair
							{
							char_literal252=(Token)match(input,93,FOLLOW_93_in_attributeValuePairs4123); 
							pushFollow(FOLLOW_attributeValuePair_in_attributeValuePairs4126);
							attributeValuePair253=attributeValuePair();
							state._fsp--;

							adaptor.addChild(root_0, attributeValuePair253.getTree());

							}
							break;

						default :
							break loop42;
						}
					}

					}
					break;

			}

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "attributeValuePairs"


	public static class attributeValuePair_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "attributeValuePair"
	// org/openprovenance/prov/notation/PROV_N.g:466:1: attributeValuePair : attribute EQUAL literal -> ^( ATTRIBUTE attribute literal ) ;
	public final PROV_NParser.attributeValuePair_return attributeValuePair() throws RecognitionException {
		PROV_NParser.attributeValuePair_return retval = new PROV_NParser.attributeValuePair_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token EQUAL255=null;
		ParserRuleReturnScope attribute254 =null;
		ParserRuleReturnScope literal256 =null;

		Object EQUAL255_tree=null;
		RewriteRuleTokenStream stream_EQUAL=new RewriteRuleTokenStream(adaptor,"token EQUAL");
		RewriteRuleSubtreeStream stream_attribute=new RewriteRuleSubtreeStream(adaptor,"rule attribute");
		RewriteRuleSubtreeStream stream_literal=new RewriteRuleSubtreeStream(adaptor,"rule literal");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:469:2: ( attribute EQUAL literal -> ^( ATTRIBUTE attribute literal ) )
			// org/openprovenance/prov/notation/PROV_N.g:470:9: attribute EQUAL literal
			{
			pushFollow(FOLLOW_attribute_in_attributeValuePair4160);
			attribute254=attribute();
			state._fsp--;

			stream_attribute.add(attribute254.getTree());
			 qnameDisabled = true; 
			EQUAL255=(Token)match(input,EQUAL,FOLLOW_EQUAL_in_attributeValuePair4164);  
			stream_EQUAL.add(EQUAL255);

			pushFollow(FOLLOW_literal_in_attributeValuePair4167);
			literal256=literal();
			state._fsp--;

			stream_literal.add(literal256.getTree());
			// AST REWRITE
			// elements: literal, attribute
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 470:61: -> ^( ATTRIBUTE attribute literal )
			{
				// org/openprovenance/prov/notation/PROV_N.g:470:64: ^( ATTRIBUTE attribute literal )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(ATTRIBUTE, "ATTRIBUTE"), root_1);
				adaptor.addChild(root_1, stream_attribute.nextTree());
				adaptor.addChild(root_1, stream_literal.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

			 qnameDisabled = false; 
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "attributeValuePair"


	public static class time_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "time"
	// org/openprovenance/prov/notation/PROV_N.g:474:1: time : xsdDateTime -> ^( TIME xsdDateTime ) ;
	public final PROV_NParser.time_return time() throws RecognitionException {
		PROV_NParser.time_return retval = new PROV_NParser.time_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		ParserRuleReturnScope xsdDateTime257 =null;

		RewriteRuleSubtreeStream stream_xsdDateTime=new RewriteRuleSubtreeStream(adaptor,"rule xsdDateTime");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:475:2: ( xsdDateTime -> ^( TIME xsdDateTime ) )
			// org/openprovenance/prov/notation/PROV_N.g:476:9: xsdDateTime
			{
			pushFollow(FOLLOW_xsdDateTime_in_time4198);
			xsdDateTime257=xsdDateTime();
			state._fsp--;

			stream_xsdDateTime.add(xsdDateTime257.getTree());
			// AST REWRITE
			// elements: xsdDateTime
			// token labels: 
			// rule labels: retval
			// token list labels: 
			// rule list labels: 
			// wildcard labels: 
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (Object)adaptor.nil();
			// 476:21: -> ^( TIME xsdDateTime )
			{
				// org/openprovenance/prov/notation/PROV_N.g:476:24: ^( TIME xsdDateTime )
				{
				Object root_1 = (Object)adaptor.nil();
				root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(TIME, "TIME"), root_1);
				adaptor.addChild(root_1, stream_xsdDateTime.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "time"


	public static class literal_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "literal"
	// org/openprovenance/prov/notation/PROV_N.g:483:1: literal : ( STRING_LITERAL ( LANGTAG )? -> ^( STRING STRING_LITERAL ( LANGTAG )? ) | STRING_LITERAL_LONG2 ( LANGTAG )? -> ^( STRING_LONG STRING_LITERAL_LONG2 ( LANGTAG )? ) | INT_LITERAL -> ^( INT INT_LITERAL ) | STRING_LITERAL ( LANGTAG )? '%%' datatype -> ^( TYPEDLITERAL STRING_LITERAL datatype ( LANGTAG )? ) | '\\'' QUALIFIED_NAME '\\'' -> ^( TYPEDLITERAL QUALIFIED_NAME ) |) ;
	public final PROV_NParser.literal_return literal() throws RecognitionException {
		PROV_NParser.literal_return retval = new PROV_NParser.literal_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token STRING_LITERAL258=null;
		Token LANGTAG259=null;
		Token STRING_LITERAL_LONG2260=null;
		Token LANGTAG261=null;
		Token INT_LITERAL262=null;
		Token STRING_LITERAL263=null;
		Token LANGTAG264=null;
		Token string_literal265=null;
		Token char_literal267=null;
		Token QUALIFIED_NAME268=null;
		Token char_literal269=null;
		ParserRuleReturnScope datatype266 =null;

		Object STRING_LITERAL258_tree=null;
		Object LANGTAG259_tree=null;
		Object STRING_LITERAL_LONG2260_tree=null;
		Object LANGTAG261_tree=null;
		Object INT_LITERAL262_tree=null;
		Object STRING_LITERAL263_tree=null;
		Object LANGTAG264_tree=null;
		Object string_literal265_tree=null;
		Object char_literal267_tree=null;
		Object QUALIFIED_NAME268_tree=null;
		Object char_literal269_tree=null;
		RewriteRuleTokenStream stream_STRING_LITERAL_LONG2=new RewriteRuleTokenStream(adaptor,"token STRING_LITERAL_LONG2");
		RewriteRuleTokenStream stream_90=new RewriteRuleTokenStream(adaptor,"token 90");
		RewriteRuleTokenStream stream_INT_LITERAL=new RewriteRuleTokenStream(adaptor,"token INT_LITERAL");
		RewriteRuleTokenStream stream_STRING_LITERAL=new RewriteRuleTokenStream(adaptor,"token STRING_LITERAL");
		RewriteRuleTokenStream stream_94=new RewriteRuleTokenStream(adaptor,"token 94");
		RewriteRuleTokenStream stream_QUALIFIED_NAME=new RewriteRuleTokenStream(adaptor,"token QUALIFIED_NAME");
		RewriteRuleTokenStream stream_LANGTAG=new RewriteRuleTokenStream(adaptor,"token LANGTAG");
		RewriteRuleSubtreeStream stream_datatype=new RewriteRuleSubtreeStream(adaptor,"rule datatype");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:483:9: ( ( STRING_LITERAL ( LANGTAG )? -> ^( STRING STRING_LITERAL ( LANGTAG )? ) | STRING_LITERAL_LONG2 ( LANGTAG )? -> ^( STRING_LONG STRING_LITERAL_LONG2 ( LANGTAG )? ) | INT_LITERAL -> ^( INT INT_LITERAL ) | STRING_LITERAL ( LANGTAG )? '%%' datatype -> ^( TYPEDLITERAL STRING_LITERAL datatype ( LANGTAG )? ) | '\\'' QUALIFIED_NAME '\\'' -> ^( TYPEDLITERAL QUALIFIED_NAME ) |) )
			// org/openprovenance/prov/notation/PROV_N.g:484:9: ( STRING_LITERAL ( LANGTAG )? -> ^( STRING STRING_LITERAL ( LANGTAG )? ) | STRING_LITERAL_LONG2 ( LANGTAG )? -> ^( STRING_LONG STRING_LITERAL_LONG2 ( LANGTAG )? ) | INT_LITERAL -> ^( INT INT_LITERAL ) | STRING_LITERAL ( LANGTAG )? '%%' datatype -> ^( TYPEDLITERAL STRING_LITERAL datatype ( LANGTAG )? ) | '\\'' QUALIFIED_NAME '\\'' -> ^( TYPEDLITERAL QUALIFIED_NAME ) |)
			{
			// org/openprovenance/prov/notation/PROV_N.g:484:9: ( STRING_LITERAL ( LANGTAG )? -> ^( STRING STRING_LITERAL ( LANGTAG )? ) | STRING_LITERAL_LONG2 ( LANGTAG )? -> ^( STRING_LONG STRING_LITERAL_LONG2 ( LANGTAG )? ) | INT_LITERAL -> ^( INT INT_LITERAL ) | STRING_LITERAL ( LANGTAG )? '%%' datatype -> ^( TYPEDLITERAL STRING_LITERAL datatype ( LANGTAG )? ) | '\\'' QUALIFIED_NAME '\\'' -> ^( TYPEDLITERAL QUALIFIED_NAME ) |)
			int alt47=6;
			switch ( input.LA(1) ) {
			case STRING_LITERAL:
				{
				switch ( input.LA(2) ) {
				case LANGTAG:
					{
					int LA47_6 = input.LA(3);
					if ( ((LA47_6 >= CLOSE_CURLY_BRACE && LA47_6 <= CLOSE_SQUARE_BRACE)||(LA47_6 >= 92 && LA47_6 <= 93)) ) {
						alt47=1;
					}
					else if ( (LA47_6==90) ) {
						alt47=4;
					}

					else {
						int nvaeMark = input.mark();
						try {
							for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) {
								input.consume();
							}
							NoViableAltException nvae =
								new NoViableAltException("", 47, 6, input);
							throw nvae;
						} finally {
							input.rewind(nvaeMark);
						}
					}

					}
					break;
				case CLOSE_CURLY_BRACE:
				case CLOSE_SQUARE_BRACE:
				case 92:
				case 93:
					{
					alt47=1;
					}
					break;
				case 90:
					{
					alt47=4;
					}
					break;
				default:
					int nvaeMark = input.mark();
					try {
						input.consume();
						NoViableAltException nvae =
							new NoViableAltException("", 47, 1, input);
						throw nvae;
					} finally {
						input.rewind(nvaeMark);
					}
				}
				}
				break;
			case STRING_LITERAL_LONG2:
				{
				alt47=2;
				}
				break;
			case INT_LITERAL:
				{
				alt47=3;
				}
				break;
			case 94:
				{
				alt47=5;
				}
				break;
			case CLOSE_CURLY_BRACE:
			case CLOSE_SQUARE_BRACE:
			case 92:
			case 93:
				{
				alt47=6;
				}
				break;
			default:
				NoViableAltException nvae =
					new NoViableAltException("", 47, 0, input);
				throw nvae;
			}
			switch (alt47) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:485:10: STRING_LITERAL ( LANGTAG )?
					{
					STRING_LITERAL258=(Token)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_literal4240);  
					stream_STRING_LITERAL.add(STRING_LITERAL258);

					// org/openprovenance/prov/notation/PROV_N.g:485:25: ( LANGTAG )?
					int alt44=2;
					int LA44_0 = input.LA(1);
					if ( (LA44_0==LANGTAG) ) {
						alt44=1;
					}
					switch (alt44) {
						case 1 :
							// org/openprovenance/prov/notation/PROV_N.g:485:25: LANGTAG
							{
							LANGTAG259=(Token)match(input,LANGTAG,FOLLOW_LANGTAG_in_literal4242);  
							stream_LANGTAG.add(LANGTAG259);

							}
							break;

					}

					// AST REWRITE
					// elements: STRING_LITERAL, LANGTAG
					// token labels: 
					// rule labels: retval
					// token list labels: 
					// rule list labels: 
					// wildcard labels: 
					retval.tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

					root_0 = (Object)adaptor.nil();
					// 485:34: -> ^( STRING STRING_LITERAL ( LANGTAG )? )
					{
						// org/openprovenance/prov/notation/PROV_N.g:485:37: ^( STRING STRING_LITERAL ( LANGTAG )? )
						{
						Object root_1 = (Object)adaptor.nil();
						root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(STRING, "STRING"), root_1);
						adaptor.addChild(root_1, stream_STRING_LITERAL.nextNode());
						// org/openprovenance/prov/notation/PROV_N.g:485:61: ( LANGTAG )?
						if ( stream_LANGTAG.hasNext() ) {
							adaptor.addChild(root_1, stream_LANGTAG.nextNode());
						}
						stream_LANGTAG.reset();

						adaptor.addChild(root_0, root_1);
						}

					}


					retval.tree = root_0;

					}
					break;
				case 2 :
					// org/openprovenance/prov/notation/PROV_N.g:486:10: STRING_LITERAL_LONG2 ( LANGTAG )?
					{
					STRING_LITERAL_LONG2260=(Token)match(input,STRING_LITERAL_LONG2,FOLLOW_STRING_LITERAL_LONG2_in_literal4267);  
					stream_STRING_LITERAL_LONG2.add(STRING_LITERAL_LONG2260);

					// org/openprovenance/prov/notation/PROV_N.g:486:32: ( LANGTAG )?
					int alt45=2;
					int LA45_0 = input.LA(1);
					if ( (LA45_0==LANGTAG) ) {
						alt45=1;
					}
					switch (alt45) {
						case 1 :
							// org/openprovenance/prov/notation/PROV_N.g:486:32: LANGTAG
							{
							LANGTAG261=(Token)match(input,LANGTAG,FOLLOW_LANGTAG_in_literal4270);  
							stream_LANGTAG.add(LANGTAG261);

							}
							break;

					}

					// AST REWRITE
					// elements: STRING_LITERAL_LONG2, LANGTAG
					// token labels: 
					// rule labels: retval
					// token list labels: 
					// rule list labels: 
					// wildcard labels: 
					retval.tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

					root_0 = (Object)adaptor.nil();
					// 486:41: -> ^( STRING_LONG STRING_LITERAL_LONG2 ( LANGTAG )? )
					{
						// org/openprovenance/prov/notation/PROV_N.g:486:44: ^( STRING_LONG STRING_LITERAL_LONG2 ( LANGTAG )? )
						{
						Object root_1 = (Object)adaptor.nil();
						root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(STRING_LONG, "STRING_LONG"), root_1);
						adaptor.addChild(root_1, stream_STRING_LITERAL_LONG2.nextNode());
						// org/openprovenance/prov/notation/PROV_N.g:486:79: ( LANGTAG )?
						if ( stream_LANGTAG.hasNext() ) {
							adaptor.addChild(root_1, stream_LANGTAG.nextNode());
						}
						stream_LANGTAG.reset();

						adaptor.addChild(root_0, root_1);
						}

					}


					retval.tree = root_0;

					}
					break;
				case 3 :
					// org/openprovenance/prov/notation/PROV_N.g:487:10: INT_LITERAL
					{
					INT_LITERAL262=(Token)match(input,INT_LITERAL,FOLLOW_INT_LITERAL_in_literal4295);  
					stream_INT_LITERAL.add(INT_LITERAL262);

					// AST REWRITE
					// elements: INT_LITERAL
					// token labels: 
					// rule labels: retval
					// token list labels: 
					// rule list labels: 
					// wildcard labels: 
					retval.tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

					root_0 = (Object)adaptor.nil();
					// 487:22: -> ^( INT INT_LITERAL )
					{
						// org/openprovenance/prov/notation/PROV_N.g:487:25: ^( INT INT_LITERAL )
						{
						Object root_1 = (Object)adaptor.nil();
						root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(INT, "INT"), root_1);
						adaptor.addChild(root_1, stream_INT_LITERAL.nextNode());
						adaptor.addChild(root_0, root_1);
						}

					}


					retval.tree = root_0;

					}
					break;
				case 4 :
					// org/openprovenance/prov/notation/PROV_N.g:488:10: STRING_LITERAL ( LANGTAG )? '%%' datatype
					{
					STRING_LITERAL263=(Token)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_literal4316);  
					stream_STRING_LITERAL.add(STRING_LITERAL263);

					// org/openprovenance/prov/notation/PROV_N.g:488:25: ( LANGTAG )?
					int alt46=2;
					int LA46_0 = input.LA(1);
					if ( (LA46_0==LANGTAG) ) {
						alt46=1;
					}
					switch (alt46) {
						case 1 :
							// org/openprovenance/prov/notation/PROV_N.g:488:25: LANGTAG
							{
							LANGTAG264=(Token)match(input,LANGTAG,FOLLOW_LANGTAG_in_literal4318);  
							stream_LANGTAG.add(LANGTAG264);

							}
							break;

					}

					 qnameDisabled = false; 
					string_literal265=(Token)match(input,90,FOLLOW_90_in_literal4323);  
					stream_90.add(string_literal265);

					pushFollow(FOLLOW_datatype_in_literal4325);
					datatype266=datatype();
					state._fsp--;

					stream_datatype.add(datatype266.getTree());
					// AST REWRITE
					// elements: STRING_LITERAL, datatype, LANGTAG
					// token labels: 
					// rule labels: retval
					// token list labels: 
					// rule list labels: 
					// wildcard labels: 
					retval.tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

					root_0 = (Object)adaptor.nil();
					// 488:75: -> ^( TYPEDLITERAL STRING_LITERAL datatype ( LANGTAG )? )
					{
						// org/openprovenance/prov/notation/PROV_N.g:488:78: ^( TYPEDLITERAL STRING_LITERAL datatype ( LANGTAG )? )
						{
						Object root_1 = (Object)adaptor.nil();
						root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(TYPEDLITERAL, "TYPEDLITERAL"), root_1);
						adaptor.addChild(root_1, stream_STRING_LITERAL.nextNode());
						adaptor.addChild(root_1, stream_datatype.nextTree());
						// org/openprovenance/prov/notation/PROV_N.g:488:117: ( LANGTAG )?
						if ( stream_LANGTAG.hasNext() ) {
							adaptor.addChild(root_1, stream_LANGTAG.nextNode());
						}
						stream_LANGTAG.reset();

						adaptor.addChild(root_0, root_1);
						}

					}


					retval.tree = root_0;

					}
					break;
				case 5 :
					// org/openprovenance/prov/notation/PROV_N.g:489:10: '\\'' QUALIFIED_NAME '\\''
					{
					 qnameDisabled = false; 
					char_literal267=(Token)match(input,94,FOLLOW_94_in_literal4353);  
					stream_94.add(char_literal267);

					QUALIFIED_NAME268=(Token)match(input,QUALIFIED_NAME,FOLLOW_QUALIFIED_NAME_in_literal4355);  
					stream_QUALIFIED_NAME.add(QUALIFIED_NAME268);

					char_literal269=(Token)match(input,94,FOLLOW_94_in_literal4357);  
					stream_94.add(char_literal269);

					// AST REWRITE
					// elements: QUALIFIED_NAME
					// token labels: 
					// rule labels: retval
					// token list labels: 
					// rule list labels: 
					// wildcard labels: 
					retval.tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

					root_0 = (Object)adaptor.nil();
					// 489:62: -> ^( TYPEDLITERAL QUALIFIED_NAME )
					{
						// org/openprovenance/prov/notation/PROV_N.g:489:65: ^( TYPEDLITERAL QUALIFIED_NAME )
						{
						Object root_1 = (Object)adaptor.nil();
						root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(TYPEDLITERAL, "TYPEDLITERAL"), root_1);
						adaptor.addChild(root_1, stream_QUALIFIED_NAME.nextNode());
						adaptor.addChild(root_0, root_1);
						}

					}


					retval.tree = root_0;

					}
					break;
				case 6 :
					// org/openprovenance/prov/notation/PROV_N.g:489:98: 
					{
					}
					break;

			}

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "literal"


	public static class datatype_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "datatype"
	// org/openprovenance/prov/notation/PROV_N.g:492:1: datatype : ( IRI_REF -> ^( IRI IRI_REF ) | QUALIFIED_NAME -> ^( QNAM QUALIFIED_NAME ) ) ;
	public final PROV_NParser.datatype_return datatype() throws RecognitionException {
		PROV_NParser.datatype_return retval = new PROV_NParser.datatype_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token IRI_REF270=null;
		Token QUALIFIED_NAME271=null;

		Object IRI_REF270_tree=null;
		Object QUALIFIED_NAME271_tree=null;
		RewriteRuleTokenStream stream_IRI_REF=new RewriteRuleTokenStream(adaptor,"token IRI_REF");
		RewriteRuleTokenStream stream_QUALIFIED_NAME=new RewriteRuleTokenStream(adaptor,"token QUALIFIED_NAME");

		try {
			// org/openprovenance/prov/notation/PROV_N.g:492:9: ( ( IRI_REF -> ^( IRI IRI_REF ) | QUALIFIED_NAME -> ^( QNAM QUALIFIED_NAME ) ) )
			// org/openprovenance/prov/notation/PROV_N.g:493:9: ( IRI_REF -> ^( IRI IRI_REF ) | QUALIFIED_NAME -> ^( QNAM QUALIFIED_NAME ) )
			{
			// org/openprovenance/prov/notation/PROV_N.g:493:9: ( IRI_REF -> ^( IRI IRI_REF ) | QUALIFIED_NAME -> ^( QNAM QUALIFIED_NAME ) )
			int alt48=2;
			int LA48_0 = input.LA(1);
			if ( (LA48_0==IRI_REF) ) {
				alt48=1;
			}
			else if ( (LA48_0==QUALIFIED_NAME) ) {
				alt48=2;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 48, 0, input);
				throw nvae;
			}

			switch (alt48) {
				case 1 :
					// org/openprovenance/prov/notation/PROV_N.g:493:10: IRI_REF
					{
					IRI_REF270=(Token)match(input,IRI_REF,FOLLOW_IRI_REF_in_datatype4387);  
					stream_IRI_REF.add(IRI_REF270);

					// AST REWRITE
					// elements: IRI_REF
					// token labels: 
					// rule labels: retval
					// token list labels: 
					// rule list labels: 
					// wildcard labels: 
					retval.tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

					root_0 = (Object)adaptor.nil();
					// 493:18: -> ^( IRI IRI_REF )
					{
						// org/openprovenance/prov/notation/PROV_N.g:493:21: ^( IRI IRI_REF )
						{
						Object root_1 = (Object)adaptor.nil();
						root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(IRI, "IRI"), root_1);
						adaptor.addChild(root_1, stream_IRI_REF.nextNode());
						adaptor.addChild(root_0, root_1);
						}

					}


					retval.tree = root_0;

					}
					break;
				case 2 :
					// org/openprovenance/prov/notation/PROV_N.g:495:10: QUALIFIED_NAME
					{
					QUALIFIED_NAME271=(Token)match(input,QUALIFIED_NAME,FOLLOW_QUALIFIED_NAME_in_datatype4416);  
					stream_QUALIFIED_NAME.add(QUALIFIED_NAME271);

					// AST REWRITE
					// elements: QUALIFIED_NAME
					// token labels: 
					// rule labels: retval
					// token list labels: 
					// rule list labels: 
					// wildcard labels: 
					retval.tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

					root_0 = (Object)adaptor.nil();
					// 495:25: -> ^( QNAM QUALIFIED_NAME )
					{
						// org/openprovenance/prov/notation/PROV_N.g:495:28: ^( QNAM QUALIFIED_NAME )
						{
						Object root_1 = (Object)adaptor.nil();
						root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(QNAM, "QNAM"), root_1);
						adaptor.addChild(root_1, stream_QUALIFIED_NAME.nextNode());
						adaptor.addChild(root_0, root_1);
						}

					}


					retval.tree = root_0;

					}
					break;

			}

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "datatype"


	public static class xsdDateTime_return extends ParserRuleReturnScope {
		Object tree;
		@Override
		public Object getTree() { return tree; }
	};


	// $ANTLR start "xsdDateTime"
	// org/openprovenance/prov/notation/PROV_N.g:719:1: xsdDateTime : DateTime ;
	public final PROV_NParser.xsdDateTime_return xsdDateTime() throws RecognitionException {
		PROV_NParser.xsdDateTime_return retval = new PROV_NParser.xsdDateTime_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token DateTime272=null;

		Object DateTime272_tree=null;

		try {
			// org/openprovenance/prov/notation/PROV_N.g:719:12: ( DateTime )
			// org/openprovenance/prov/notation/PROV_N.g:719:14: DateTime
			{
			root_0 = (Object)adaptor.nil();


			DateTime272=(Token)match(input,DateTime,FOLLOW_DateTime_in_xsdDateTime5605); 
			DateTime272_tree = (Object)adaptor.create(DateTime272);
			adaptor.addChild(root_0, DateTime272_tree);

			}

			retval.stop = input.LT(-1);

			retval.tree = (Object)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "xsdDateTime"

	// Delegated rules



	public static final BitSet FOLLOW_101_in_document348 = new BitSet(new long[]{0x0000000000000000L,0x1FFFFF9F80000001L});
	public static final BitSet FOLLOW_namespaceDeclarations_in_document360 = new BitSet(new long[]{0x0000000000000000L,0x1FFFEF8F80000001L});
	public static final BitSet FOLLOW_expression_in_document367 = new BitSet(new long[]{0x0000000000000000L,0x1FFFEF8F80000001L});
	public static final BitSet FOLLOW_bundle_in_document381 = new BitSet(new long[]{0x0000000000000000L,0x0000008800000000L});
	public static final BitSet FOLLOW_bundle_in_document384 = new BitSet(new long[]{0x0000000000000000L,0x0000008800000000L});
	public static final BitSet FOLLOW_103_in_document392 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_99_in_bundle468 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_bundle470 = new BitSet(new long[]{0x0000000000000000L,0x1FFFFF5780000001L});
	public static final BitSet FOLLOW_namespaceDeclarations_in_bundle481 = new BitSet(new long[]{0x0000000000000000L,0x1FFFEF4780000001L});
	public static final BitSet FOLLOW_expression_in_bundle488 = new BitSet(new long[]{0x0000000000000000L,0x1FFFEF4780000001L});
	public static final BitSet FOLLOW_102_in_bundle494 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_defaultNamespaceDeclaration_in_namespaceDeclarations565 = new BitSet(new long[]{0x0000000000000002L,0x0000100000000000L});
	public static final BitSet FOLLOW_namespaceDeclaration_in_namespaceDeclarations569 = new BitSet(new long[]{0x0000000000000002L,0x0000100000000000L});
	public static final BitSet FOLLOW_namespaceDeclaration_in_namespaceDeclarations572 = new BitSet(new long[]{0x0000000000000002L,0x0000100000000000L});
	public static final BitSet FOLLOW_108_in_namespaceDeclaration629 = new BitSet(new long[]{0x2000000000000000L});
	public static final BitSet FOLLOW_PREFX_in_namespaceDeclaration631 = new BitSet(new long[]{0x0000020000000000L});
	public static final BitSet FOLLOW_namespace_in_namespaceDeclaration633 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_IRI_REF_in_namespace675 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_100_in_defaultNamespaceDeclaration696 = new BitSet(new long[]{0x0000020000000000L});
	public static final BitSet FOLLOW_IRI_REF_in_defaultNamespaceDeclaration698 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_entityExpression_in_expression759 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_activityExpression_in_expression763 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_generationExpression_in_expression767 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_usageExpression_in_expression772 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_startExpression_in_expression785 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_endExpression_in_expression789 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_invalidationExpression_in_expression793 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_communicationExpression_in_expression797 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_agentExpression_in_expression833 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_associationExpression_in_expression838 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_attributionExpression_in_expression842 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_responsibilityExpression_in_expression846 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_derivationExpression_in_expression874 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_influenceExpression_in_expression878 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_hadPrimarySourceExpression_in_expression882 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_quotationExpression_in_expression886 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_revisionExpression_in_expression890 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_alternateExpression_in_expression918 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_specializationExpression_in_expression922 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_insertionExpression_in_expression950 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_removalExpression_in_expression954 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_collectionMembershipExpression_in_expression958 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_dictionaryMembershipExpression_in_expression963 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_mentionExpression_in_expression993 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_extensibilityExpression_in_expression1021 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_104_in_entityExpression1045 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_entityExpression1047 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_entityExpression1049 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_entityExpression1051 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_entityExpression1053 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_96_in_activityExpression1083 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_activityExpression1085 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_activityExpression1087 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_93_in_activityExpression1090 = new BitSet(new long[]{0x0000800001000000L});
	public static final BitSet FOLLOW_time_in_activityExpression1095 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_MINUS_in_activityExpression1099 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_activityExpression1103 = new BitSet(new long[]{0x0000800001000000L});
	public static final BitSet FOLLOW_time_in_activityExpression1108 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_MINUS_in_activityExpression1112 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_activityExpression1117 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_activityExpression1119 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_118_in_generationExpression1167 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_generationExpression1169 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_optionalIdentifier_in_generationExpression1173 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_generationExpression1177 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_93_in_generationExpression1180 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_generationExpression1184 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_generationExpression1186 = new BitSet(new long[]{0x0000800001000000L});
	public static final BitSet FOLLOW_time_in_generationExpression1192 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_MINUS_in_generationExpression1196 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_generationExpression1202 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_generationExpression1204 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_identifier_in_optionalIdentifier1346 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000002L});
	public static final BitSet FOLLOW_MINUS_in_optionalIdentifier1350 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000002L});
	public static final BitSet FOLLOW_SEMICOLON_in_optionalIdentifier1353 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_identifier_in_identifierOrMarker1391 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_MINUS_in_identifierOrMarker1400 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_113_in_usageExpression1421 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_usageExpression1423 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_optionalIdentifier_in_usageExpression1427 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_usageExpression1432 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_93_in_usageExpression1435 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_usageExpression1439 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_usageExpression1441 = new BitSet(new long[]{0x0000800001000000L});
	public static final BitSet FOLLOW_time_in_usageExpression1447 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_MINUS_in_usageExpression1451 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_usageExpression1457 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_usageExpression1459 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_124_in_startExpression1591 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_startExpression1593 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_optionalIdentifier_in_startExpression1597 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_startExpression1601 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_93_in_startExpression1604 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_startExpression1608 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_startExpression1610 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_startExpression1614 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_startExpression1616 = new BitSet(new long[]{0x0000800001000000L});
	public static final BitSet FOLLOW_time_in_startExpression1622 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_MINUS_in_startExpression1626 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_startExpression1632 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_startExpression1634 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_117_in_endExpression1777 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_endExpression1779 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_optionalIdentifier_in_endExpression1783 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_endExpression1787 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_93_in_endExpression1790 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_endExpression1794 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_endExpression1796 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_endExpression1800 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_endExpression1802 = new BitSet(new long[]{0x0000800001000000L});
	public static final BitSet FOLLOW_time_in_endExpression1808 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_MINUS_in_endExpression1812 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_endExpression1818 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_endExpression1820 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_121_in_invalidationExpression1963 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_invalidationExpression1965 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_optionalIdentifier_in_invalidationExpression1969 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_invalidationExpression1973 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_93_in_invalidationExpression1976 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_invalidationExpression1980 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_invalidationExpression1982 = new BitSet(new long[]{0x0000800001000000L});
	public static final BitSet FOLLOW_time_in_invalidationExpression1988 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_MINUS_in_invalidationExpression1992 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_invalidationExpression1998 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_invalidationExpression2000 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_120_in_communicationExpression2134 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_communicationExpression2136 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_optionalIdentifier_in_communicationExpression2140 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_communicationExpression2144 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_communicationExpression2146 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_communicationExpression2150 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_communicationExpression2152 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_communicationExpression2154 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_97_in_agentExpression2197 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_agentExpression2199 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_agentExpression2201 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_agentExpression2203 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_agentExpression2205 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_115_in_attributionExpression2236 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_attributionExpression2238 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_optionalIdentifier_in_attributionExpression2243 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_attributionExpression2247 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_attributionExpression2249 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_attributionExpression2253 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_attributionExpression2255 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_attributionExpression2257 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_114_in_associationExpression2297 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_associationExpression2299 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_optionalIdentifier_in_associationExpression2304 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_associationExpression2308 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_93_in_associationExpression2311 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_associationExpression2315 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_associationExpression2317 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_associationExpression2321 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_associationExpression2325 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_associationExpression2327 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_95_in_responsibilityExpression2440 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_responsibilityExpression2442 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_optionalIdentifier_in_responsibilityExpression2448 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_responsibilityExpression2452 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_responsibilityExpression2454 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_responsibilityExpression2458 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_93_in_responsibilityExpression2461 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_responsibilityExpression2466 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_responsibilityExpression2470 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_responsibilityExpression2472 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_116_in_derivationExpression2557 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_derivationExpression2559 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_optionalIdentifier_in_derivationExpression2563 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_derivationExpression2567 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_derivationExpression2569 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_derivationExpression2573 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_93_in_derivationExpression2576 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_derivationExpression2580 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_derivationExpression2582 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_derivationExpression2586 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_derivationExpression2588 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_derivationExpression2592 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_derivationExpression2597 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_derivationExpression2599 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_123_in_revisionExpression2700 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_revisionExpression2702 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_optionalIdentifier_in_revisionExpression2707 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_revisionExpression2711 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_revisionExpression2713 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_revisionExpression2717 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_93_in_revisionExpression2720 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_revisionExpression2724 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_revisionExpression2726 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_revisionExpression2730 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_revisionExpression2732 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_revisionExpression2736 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_revisionExpression2741 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_revisionExpression2743 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_122_in_quotationExpression2845 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_quotationExpression2847 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_optionalIdentifier_in_quotationExpression2852 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_quotationExpression2856 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_quotationExpression2858 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_quotationExpression2862 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_93_in_quotationExpression2865 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_quotationExpression2869 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_quotationExpression2871 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_quotationExpression2875 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_quotationExpression2877 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_quotationExpression2881 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_quotationExpression2886 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_quotationExpression2888 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_106_in_hadPrimarySourceExpression2989 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_hadPrimarySourceExpression2991 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_optionalIdentifier_in_hadPrimarySourceExpression2996 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_hadPrimarySourceExpression3000 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_hadPrimarySourceExpression3002 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_hadPrimarySourceExpression3006 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_93_in_hadPrimarySourceExpression3009 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_hadPrimarySourceExpression3013 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_hadPrimarySourceExpression3015 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_hadPrimarySourceExpression3019 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_hadPrimarySourceExpression3021 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifierOrMarker_in_hadPrimarySourceExpression3025 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_hadPrimarySourceExpression3030 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_hadPrimarySourceExpression3032 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_119_in_influenceExpression3134 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_influenceExpression3136 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_optionalIdentifier_in_influenceExpression3141 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_influenceExpression3145 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_influenceExpression3147 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_influenceExpression3151 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_influenceExpression3153 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_influenceExpression3155 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_98_in_alternateExpression3201 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_alternateExpression3203 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_alternateExpression3206 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_alternateExpression3208 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_alternateExpression3210 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_alternateExpression3212 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_112_in_specializationExpression3238 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_specializationExpression3240 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_specializationExpression3243 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_specializationExpression3245 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_specializationExpression3247 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_specializationExpression3249 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_107_in_mentionExpression3275 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_mentionExpression3277 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_mentionExpression3281 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_mentionExpression3283 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_mentionExpression3287 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_mentionExpression3289 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_mentionExpression3293 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_mentionExpression3295 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_109_in_insertionExpression3340 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_optionalIdentifier_in_insertionExpression3345 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_insertionExpression3349 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_insertionExpression3351 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_insertionExpression3355 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_insertionExpression3357 = new BitSet(new long[]{0x0004000000000000L});
	public static final BitSet FOLLOW_keyEntitySet_in_insertionExpression3361 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_insertionExpression3363 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_insertionExpression3365 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_110_in_removalExpression3413 = new BitSet(new long[]{0x0000800000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_optionalIdentifier_in_removalExpression3418 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_removalExpression3422 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_removalExpression3424 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_removalExpression3428 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_removalExpression3430 = new BitSet(new long[]{0x0004000000000000L});
	public static final BitSet FOLLOW_OPEN_CURLY_BRACE_in_removalExpression3434 = new BitSet(new long[]{0x0000008000001000L,0x0000000060000060L});
	public static final BitSet FOLLOW_literal_in_removalExpression3436 = new BitSet(new long[]{0x0000000000001000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_removalExpression3439 = new BitSet(new long[]{0x0000008000001000L,0x0000000060000060L});
	public static final BitSet FOLLOW_literal_in_removalExpression3441 = new BitSet(new long[]{0x0000000000001000L,0x0000000020000000L});
	public static final BitSet FOLLOW_CLOSE_CURLY_BRACE_in_removalExpression3445 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_removalExpression3450 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_removalExpression3452 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_111_in_dictionaryMembershipExpression3502 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_dictionaryMembershipExpression3507 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_dictionaryMembershipExpression3509 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_dictionaryMembershipExpression3513 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_dictionaryMembershipExpression3515 = new BitSet(new long[]{0x0000008000000000L,0x0000000050000060L});
	public static final BitSet FOLLOW_literal_in_dictionaryMembershipExpression3517 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_dictionaryMembershipExpression3519 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_105_in_collectionMembershipExpression3569 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_collectionMembershipExpression3571 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_collectionMembershipExpression3576 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_collectionMembershipExpression3578 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_collectionMembershipExpression3582 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_collectionMembershipExpression3584 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_OPEN_CURLY_BRACE_in_keyEntitySet3626 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_keyEntitySet3629 = new BitSet(new long[]{0x0000008000000000L,0x0000000060000060L});
	public static final BitSet FOLLOW_literal_in_keyEntitySet3635 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_keyEntitySet3639 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_keyEntitySet3642 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_keyEntitySet3645 = new BitSet(new long[]{0x0000000000001000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_keyEntitySet3649 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_keyEntitySet3652 = new BitSet(new long[]{0x0000008000000000L,0x0000000060000060L});
	public static final BitSet FOLLOW_literal_in_keyEntitySet3657 = new BitSet(new long[]{0x0000000000000000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_keyEntitySet3662 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_keyEntitySet3664 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_keyEntitySet3667 = new BitSet(new long[]{0x0000000000001000L,0x0000000020000000L});
	public static final BitSet FOLLOW_CLOSE_CURLY_BRACE_in_keyEntitySet3672 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_OPEN_CURLY_BRACE_in_entitySet3719 = new BitSet(new long[]{0x0000000000001000L,0x0000000000000001L});
	public static final BitSet FOLLOW_identifier_in_entitySet3722 = new BitSet(new long[]{0x0000000000001000L,0x0000000000000001L});
	public static final BitSet FOLLOW_CLOSE_CURLY_BRACE_in_entitySet3725 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_QUALIFIED_NAME_in_extensibilityExpression3763 = new BitSet(new long[]{0x0000000000000000L,0x0000000008000000L});
	public static final BitSet FOLLOW_91_in_extensibilityExpression3768 = new BitSet(new long[]{0x0004808001000000L,0x0000000048000061L});
	public static final BitSet FOLLOW_optionalIdentifier_in_extensibilityExpression3772 = new BitSet(new long[]{0x0004808001000000L,0x0000000048000061L});
	public static final BitSet FOLLOW_extensibilityArgument_in_extensibilityExpression3774 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_93_in_extensibilityExpression3778 = new BitSet(new long[]{0x0004808001000000L,0x0000000048000061L});
	public static final BitSet FOLLOW_extensibilityArgument_in_extensibilityExpression3781 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_optionalAttributeValuePairs_in_extensibilityExpression3787 = new BitSet(new long[]{0x0000000000000000L,0x0000000010000000L});
	public static final BitSet FOLLOW_92_in_extensibilityExpression3789 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_identifierOrMarker_in_extensibilityArgument3880 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_literal_in_extensibilityArgument3884 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_time_in_extensibilityArgument3888 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_extensibilityExpression_in_extensibilityArgument3893 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_extensibilityRecord_in_extensibilityArgument3897 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_OPEN_CURLY_BRACE_in_extensibilityRecord3909 = new BitSet(new long[]{0x0004808001000000L,0x0000000048000061L});
	public static final BitSet FOLLOW_extensibilityArgument_in_extensibilityRecord3911 = new BitSet(new long[]{0x0000000000001000L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_extensibilityRecord3914 = new BitSet(new long[]{0x0004808001000000L,0x0000000048000061L});
	public static final BitSet FOLLOW_extensibilityArgument_in_extensibilityRecord3916 = new BitSet(new long[]{0x0000000000001000L,0x0000000020000000L});
	public static final BitSet FOLLOW_CLOSE_CURLY_BRACE_in_extensibilityRecord3920 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_91_in_extensibilityRecord3925 = new BitSet(new long[]{0x0004808001000000L,0x0000000048000061L});
	public static final BitSet FOLLOW_extensibilityArgument_in_extensibilityRecord3927 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_93_in_extensibilityRecord3930 = new BitSet(new long[]{0x0004808001000000L,0x0000000048000061L});
	public static final BitSet FOLLOW_extensibilityArgument_in_extensibilityRecord3932 = new BitSet(new long[]{0x0000000000000000L,0x0000000030000000L});
	public static final BitSet FOLLOW_92_in_extensibilityRecord3936 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_IRI_REF_in_iriOrMarker3959 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_MINUS_in_iriOrMarker3985 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_93_in_optionalAttributeValuePairs4020 = new BitSet(new long[]{0x0008000000000000L});
	public static final BitSet FOLLOW_OPEN_SQUARE_BRACE_in_optionalAttributeValuePairs4022 = new BitSet(new long[]{0x0000000000002000L,0x0000000000000001L});
	public static final BitSet FOLLOW_attributeValuePairs_in_optionalAttributeValuePairs4024 = new BitSet(new long[]{0x0000000000002000L});
	public static final BitSet FOLLOW_CLOSE_SQUARE_BRACE_in_optionalAttributeValuePairs4026 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_QUALIFIED_NAME_in_identifier4068 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_QUALIFIED_NAME_in_attribute4095 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_attributeValuePair_in_attributeValuePairs4119 = new BitSet(new long[]{0x0000000000000002L,0x0000000020000000L});
	public static final BitSet FOLLOW_93_in_attributeValuePairs4123 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_attributeValuePair_in_attributeValuePairs4126 = new BitSet(new long[]{0x0000000000000002L,0x0000000020000000L});
	public static final BitSet FOLLOW_attribute_in_attributeValuePair4160 = new BitSet(new long[]{0x0000000020000000L});
	public static final BitSet FOLLOW_EQUAL_in_attributeValuePair4164 = new BitSet(new long[]{0x0000008000000000L,0x0000000040000060L});
	public static final BitSet FOLLOW_literal_in_attributeValuePair4167 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_xsdDateTime_in_time4198 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_STRING_LITERAL_in_literal4240 = new BitSet(new long[]{0x0000100000000002L});
	public static final BitSet FOLLOW_LANGTAG_in_literal4242 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_STRING_LITERAL_LONG2_in_literal4267 = new BitSet(new long[]{0x0000100000000002L});
	public static final BitSet FOLLOW_LANGTAG_in_literal4270 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_INT_LITERAL_in_literal4295 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_STRING_LITERAL_in_literal4316 = new BitSet(new long[]{0x0000100000000000L,0x0000000004000000L});
	public static final BitSet FOLLOW_LANGTAG_in_literal4318 = new BitSet(new long[]{0x0000000000000000L,0x0000000004000000L});
	public static final BitSet FOLLOW_90_in_literal4323 = new BitSet(new long[]{0x0000020000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_datatype_in_literal4325 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_94_in_literal4353 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
	public static final BitSet FOLLOW_QUALIFIED_NAME_in_literal4355 = new BitSet(new long[]{0x0000000000000000L,0x0000000040000000L});
	public static final BitSet FOLLOW_94_in_literal4357 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_IRI_REF_in_datatype4387 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_QUALIFIED_NAME_in_datatype4416 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_DateTime_in_xsdDateTime5605 = new BitSet(new long[]{0x0000000000000002L});
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy