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

rapture.generated.MetricGenParser Maven / Gradle / Ivy

There is a newer version: 3.0.4
Show newest version
// $ANTLR 3.5.2 /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g 2016-03-01 15:52:39

    package rapture.generated;
    import rapture.dsl.metricgen.*;


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

import org.antlr.runtime.tree.*;


@SuppressWarnings("all")
public class MetricGenParser extends AbstractMetricParser {
	public static final String[] tokenNames = new String[] {
		"", "", "", "", "COMMA", "COUNTER", "EQUALS", 
		"ID", "LBRACE", "MESSAGE", "PRESENCE", "RBRACE", "STRING", "VALUE", "WITH", 
		"WS", "ENTRIES", "ENTRY", "MAIN"
	};
	public static final int EOF=-1;
	public static final int COMMA=4;
	public static final int COUNTER=5;
	public static final int EQUALS=6;
	public static final int ID=7;
	public static final int LBRACE=8;
	public static final int MESSAGE=9;
	public static final int PRESENCE=10;
	public static final int RBRACE=11;
	public static final int STRING=12;
	public static final int VALUE=13;
	public static final int WITH=14;
	public static final int WS=15;
	public static final int ENTRIES=16;
	public static final int ENTRY=17;
	public static final int MAIN=18;

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

	// delegators


	public MetricGenParser(TokenStream input) {
		this(input, new RecognizerSharedState());
	}
	public MetricGenParser(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 MetricGenParser.tokenNames; }
	@Override public String getGrammarFileName() { return "/Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g"; }


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


	// $ANTLR start "minfo"
	// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:21:1: minfo : mstyle WITH config ;
	public final MetricGenParser.minfo_return minfo() throws RecognitionException {
		MetricGenParser.minfo_return retval = new MetricGenParser.minfo_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token WITH2=null;
		ParserRuleReturnScope mstyle1 =null;
		ParserRuleReturnScope config3 =null;

		Object WITH2_tree=null;

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:21:11: ( mstyle WITH config )
			// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:21:13: mstyle WITH config
			{
			root_0 = (Object)adaptor.nil();


			pushFollow(FOLLOW_mstyle_in_minfo95);
			mstyle1=mstyle();
			state._fsp--;

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

			WITH2=(Token)match(input,WITH,FOLLOW_WITH_in_minfo97); 
			WITH2_tree = (Object)adaptor.create(WITH2);
			adaptor.addChild(root_0, WITH2_tree);

			pushFollow(FOLLOW_config_in_minfo99);
			config3=config();
			state._fsp--;

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

			}

			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 "minfo"


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


	// $ANTLR start "mstyle"
	// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:23:1: mstyle : m= ( VALUE | PRESENCE | MESSAGE | COUNTER ) ;
	public final MetricGenParser.mstyle_return mstyle() throws RecognitionException {
		MetricGenParser.mstyle_return retval = new MetricGenParser.mstyle_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token m=null;

		Object m_tree=null;

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:23:11: (m= ( VALUE | PRESENCE | MESSAGE | COUNTER ) )
			// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:23:13: m= ( VALUE | PRESENCE | MESSAGE | COUNTER )
			{
			root_0 = (Object)adaptor.nil();


			m=input.LT(1);
			if ( input.LA(1)==COUNTER||(input.LA(1) >= MESSAGE && input.LA(1) <= PRESENCE)||input.LA(1)==VALUE ) {
				input.consume();
				adaptor.addChild(root_0, (Object)adaptor.create(m));
				state.errorRecovery=false;
			}
			else {
				MismatchedSetException mse = new MismatchedSetException(null,input);
				throw mse;
			}
			 setMetric(m); 
			}

			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 "mstyle"


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


	// $ANTLR start "config"
	// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:25:1: config : LBRACE entrylist RBRACE ;
	public final MetricGenParser.config_return config() throws RecognitionException {
		MetricGenParser.config_return retval = new MetricGenParser.config_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token LBRACE4=null;
		Token RBRACE6=null;
		ParserRuleReturnScope entrylist5 =null;

		Object LBRACE4_tree=null;
		Object RBRACE6_tree=null;

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:25:11: ( LBRACE entrylist RBRACE )
			// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:25:13: LBRACE entrylist RBRACE
			{
			root_0 = (Object)adaptor.nil();


			LBRACE4=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_config139); 
			LBRACE4_tree = (Object)adaptor.create(LBRACE4);
			adaptor.addChild(root_0, LBRACE4_tree);

			pushFollow(FOLLOW_entrylist_in_config141);
			entrylist5=entrylist();
			state._fsp--;

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

			RBRACE6=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_config143); 
			RBRACE6_tree = (Object)adaptor.create(RBRACE6);
			adaptor.addChild(root_0, RBRACE6_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 "config"


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


	// $ANTLR start "entrylist"
	// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:27:1: entrylist : (k= entry )? ( COMMA k= entry )* ;
	public final MetricGenParser.entrylist_return entrylist() throws RecognitionException {
		MetricGenParser.entrylist_return retval = new MetricGenParser.entrylist_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token COMMA7=null;
		ParserRuleReturnScope k =null;

		Object COMMA7_tree=null;

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:27:11: ( (k= entry )? ( COMMA k= entry )* )
			// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:27:13: (k= entry )? ( COMMA k= entry )*
			{
			root_0 = (Object)adaptor.nil();


			// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:27:14: (k= entry )?
			int alt1=2;
			int LA1_0 = input.LA(1);
			if ( (LA1_0==ID) ) {
				alt1=1;
			}
			switch (alt1) {
				case 1 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:27:14: k= entry
					{
					pushFollow(FOLLOW_entry_in_entrylist153);
					k=entry();
					state._fsp--;

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

					}
					break;

			}

			// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:27:22: ( COMMA k= entry )*
			loop2:
			while (true) {
				int alt2=2;
				int LA2_0 = input.LA(1);
				if ( (LA2_0==COMMA) ) {
					alt2=1;
				}

				switch (alt2) {
				case 1 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:27:23: COMMA k= entry
					{
					COMMA7=(Token)match(input,COMMA,FOLLOW_COMMA_in_entrylist157); 
					COMMA7_tree = (Object)adaptor.create(COMMA7);
					adaptor.addChild(root_0, COMMA7_tree);

					pushFollow(FOLLOW_entry_in_entrylist161);
					k=entry();
					state._fsp--;

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

					}
					break;

				default :
					break loop2;
				}
			}

			}

			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 "entrylist"


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


	// $ANTLR start "entry"
	// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:28:1: entry : i= ID EQUALS v= STRING ;
	public final MetricGenParser.entry_return entry() throws RecognitionException {
		MetricGenParser.entry_return retval = new MetricGenParser.entry_return();
		retval.start = input.LT(1);

		Object root_0 = null;

		Token i=null;
		Token v=null;
		Token EQUALS8=null;

		Object i_tree=null;
		Object v_tree=null;
		Object EQUALS8_tree=null;

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:28:9: (i= ID EQUALS v= STRING )
			// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/metricgen/MetricGenParser.g:28:11: i= ID EQUALS v= STRING
			{
			root_0 = (Object)adaptor.nil();


			i=(Token)match(input,ID,FOLLOW_ID_in_entry174); 
			i_tree = (Object)adaptor.create(i);
			adaptor.addChild(root_0, i_tree);

			EQUALS8=(Token)match(input,EQUALS,FOLLOW_EQUALS_in_entry176); 
			EQUALS8_tree = (Object)adaptor.create(EQUALS8);
			adaptor.addChild(root_0, EQUALS8_tree);

			v=(Token)match(input,STRING,FOLLOW_STRING_in_entry180); 
			v_tree = (Object)adaptor.create(v);
			adaptor.addChild(root_0, v_tree);

			 addConfig((i!=null?i.getText():null), (v!=null?v.getText():null)); 
			}

			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 "entry"

	// Delegated rules



	public static final BitSet FOLLOW_mstyle_in_minfo95 = new BitSet(new long[]{0x0000000000004000L});
	public static final BitSet FOLLOW_WITH_in_minfo97 = new BitSet(new long[]{0x0000000000000100L});
	public static final BitSet FOLLOW_config_in_minfo99 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_set_in_mstyle112 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_LBRACE_in_config139 = new BitSet(new long[]{0x0000000000000890L});
	public static final BitSet FOLLOW_entrylist_in_config141 = new BitSet(new long[]{0x0000000000000800L});
	public static final BitSet FOLLOW_RBRACE_in_config143 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_entry_in_entrylist153 = new BitSet(new long[]{0x0000000000000012L});
	public static final BitSet FOLLOW_COMMA_in_entrylist157 = new BitSet(new long[]{0x0000000000000080L});
	public static final BitSet FOLLOW_entry_in_entrylist161 = new BitSet(new long[]{0x0000000000000012L});
	public static final BitSet FOLLOW_ID_in_entry174 = new BitSet(new long[]{0x0000000000000040L});
	public static final BitSet FOLLOW_EQUALS_in_entry176 = new BitSet(new long[]{0x0000000000001000L});
	public static final BitSet FOLLOW_STRING_in_entry180 = new BitSet(new long[]{0x0000000000000002L});
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy