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

s.greycat-language.10.source-code.GreyCatModelParser Maven / Gradle / Ivy

The newest version!
// Generated from GreyCatModel.g4 by ANTLR 4.7
package greycat.language;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.misc.*;
import org.antlr.v4.runtime.tree.*;
import java.util.List;
import java.util.Iterator;
import java.util.ArrayList;

@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class GreyCatModelParser extends Parser {
	static { RuntimeMetaData.checkVersion("4.7", RuntimeMetaData.VERSION); }

	protected static final DFA[] _decisionToDFA;
	protected static final PredictionContextCache _sharedContextCache =
		new PredictionContextCache();
	public static final int
		T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, 
		T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17, 
		T__17=18, T__18=19, T__19=20, STRING=21, IDENT=22, NUMBER=23, WS=24, SL_COMMENT=25, 
		ML_COMMENT=26;
	public static final int
		RULE_modelDcl = 0, RULE_importDcl = 1, RULE_constDcl = 2, RULE_constValueDcl = 3, 
		RULE_simpleValueDcl = 4, RULE_taskValueDcl = 5, RULE_actionValueDcl = 6, 
		RULE_actionParamList = 7, RULE_actionParam = 8, RULE_subTask = 9, RULE_classDcl = 10, 
		RULE_customTypeDcl = 11, RULE_parentDcl = 12, RULE_attributeDcl = 13, 
		RULE_annotationDcl = 14, RULE_attributeValueDcl = 15, RULE_complexAttributeValueDcl = 16, 
		RULE_complexValueDcl = 17, RULE_ntupleValueDlc = 18, RULE_ntupleElementDlc = 19, 
		RULE_relationDcl = 20, RULE_referenceDcl = 21, RULE_oppositeDcl = 22, 
		RULE_localIndexDcl = 23, RULE_indexAttributesDcl = 24, RULE_globalIndexDcl = 25;
	public static final String[] ruleNames = {
		"modelDcl", "importDcl", "constDcl", "constValueDcl", "simpleValueDcl", 
		"taskValueDcl", "actionValueDcl", "actionParamList", "actionParam", "subTask", 
		"classDcl", "customTypeDcl", "parentDcl", "attributeDcl", "annotationDcl", 
		"attributeValueDcl", "complexAttributeValueDcl", "complexValueDcl", "ntupleValueDlc", 
		"ntupleElementDlc", "relationDcl", "referenceDcl", "oppositeDcl", "localIndexDcl", 
		"indexAttributesDcl", "globalIndexDcl"
	};

	private static final String[] _LITERAL_NAMES = {
		null, "'import'", "'const'", "':'", "'='", "'.'", "'('", "')'", "','", 
		"'{'", "'}'", "'class'", "'type'", "'extends'", "'att'", "'@'", "'rel'", 
		"'ref'", "'oppositeOf'", "'index'", "'using'"
	};
	private static final String[] _SYMBOLIC_NAMES = {
		null, null, null, null, null, null, null, null, null, null, null, null, 
		null, null, null, null, null, null, null, null, null, "STRING", "IDENT", 
		"NUMBER", "WS", "SL_COMMENT", "ML_COMMENT"
	};
	public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);

	/**
	 * @deprecated Use {@link #VOCABULARY} instead.
	 */
	@Deprecated
	public static final String[] tokenNames;
	static {
		tokenNames = new String[_SYMBOLIC_NAMES.length];
		for (int i = 0; i < tokenNames.length; i++) {
			tokenNames[i] = VOCABULARY.getLiteralName(i);
			if (tokenNames[i] == null) {
				tokenNames[i] = VOCABULARY.getSymbolicName(i);
			}

			if (tokenNames[i] == null) {
				tokenNames[i] = "";
			}
		}
	}

	@Override
	@Deprecated
	public String[] getTokenNames() {
		return tokenNames;
	}

	@Override

	public Vocabulary getVocabulary() {
		return VOCABULARY;
	}

	@Override
	public String getGrammarFileName() { return "GreyCatModel.g4"; }

	@Override
	public String[] getRuleNames() { return ruleNames; }

	@Override
	public String getSerializedATN() { return _serializedATN; }

	@Override
	public ATN getATN() { return _ATN; }

	public GreyCatModelParser(TokenStream input) {
		super(input);
		_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
	}
	public static class ModelDclContext extends ParserRuleContext {
		public List constDcl() {
			return getRuleContexts(ConstDclContext.class);
		}
		public ConstDclContext constDcl(int i) {
			return getRuleContext(ConstDclContext.class,i);
		}
		public List classDcl() {
			return getRuleContexts(ClassDclContext.class);
		}
		public ClassDclContext classDcl(int i) {
			return getRuleContext(ClassDclContext.class,i);
		}
		public List globalIndexDcl() {
			return getRuleContexts(GlobalIndexDclContext.class);
		}
		public GlobalIndexDclContext globalIndexDcl(int i) {
			return getRuleContext(GlobalIndexDclContext.class,i);
		}
		public List customTypeDcl() {
			return getRuleContexts(CustomTypeDclContext.class);
		}
		public CustomTypeDclContext customTypeDcl(int i) {
			return getRuleContext(CustomTypeDclContext.class,i);
		}
		public List importDcl() {
			return getRuleContexts(ImportDclContext.class);
		}
		public ImportDclContext importDcl(int i) {
			return getRuleContext(ImportDclContext.class,i);
		}
		public ModelDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_modelDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterModelDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitModelDcl(this);
		}
	}

	public final ModelDclContext modelDcl() throws RecognitionException {
		ModelDclContext _localctx = new ModelDclContext(_ctx, getState());
		enterRule(_localctx, 0, RULE_modelDcl);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(59);
			_errHandler.sync(this);
			_la = _input.LA(1);
			while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__1) | (1L << T__10) | (1L << T__11) | (1L << T__18))) != 0)) {
				{
				setState(57);
				_errHandler.sync(this);
				switch (_input.LA(1)) {
				case T__1:
					{
					setState(52);
					constDcl();
					}
					break;
				case T__10:
					{
					setState(53);
					classDcl();
					}
					break;
				case T__18:
					{
					setState(54);
					globalIndexDcl();
					}
					break;
				case T__11:
					{
					setState(55);
					customTypeDcl();
					}
					break;
				case T__0:
					{
					setState(56);
					importDcl();
					}
					break;
				default:
					throw new NoViableAltException(this);
				}
				}
				setState(61);
				_errHandler.sync(this);
				_la = _input.LA(1);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class ImportDclContext extends ParserRuleContext {
		public Token path;
		public TerminalNode STRING() { return getToken(GreyCatModelParser.STRING, 0); }
		public ImportDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_importDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterImportDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitImportDcl(this);
		}
	}

	public final ImportDclContext importDcl() throws RecognitionException {
		ImportDclContext _localctx = new ImportDclContext(_ctx, getState());
		enterRule(_localctx, 2, RULE_importDcl);
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(62);
			match(T__0);
			setState(63);
			((ImportDclContext)_localctx).path = match(STRING);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class ConstDclContext extends ParserRuleContext {
		public Token name;
		public Token type;
		public List IDENT() { return getTokens(GreyCatModelParser.IDENT); }
		public TerminalNode IDENT(int i) {
			return getToken(GreyCatModelParser.IDENT, i);
		}
		public ConstValueDclContext constValueDcl() {
			return getRuleContext(ConstValueDclContext.class,0);
		}
		public ConstDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_constDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterConstDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitConstDcl(this);
		}
	}

	public final ConstDclContext constDcl() throws RecognitionException {
		ConstDclContext _localctx = new ConstDclContext(_ctx, getState());
		enterRule(_localctx, 4, RULE_constDcl);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(65);
			match(T__1);
			setState(66);
			((ConstDclContext)_localctx).name = match(IDENT);
			setState(67);
			match(T__2);
			setState(68);
			((ConstDclContext)_localctx).type = match(IDENT);
			setState(71);
			_errHandler.sync(this);
			_la = _input.LA(1);
			if (_la==T__3) {
				{
				setState(69);
				match(T__3);
				setState(70);
				constValueDcl();
				}
			}

			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class ConstValueDclContext extends ParserRuleContext {
		public SimpleValueDclContext simpleValueDcl() {
			return getRuleContext(SimpleValueDclContext.class,0);
		}
		public TaskValueDclContext taskValueDcl() {
			return getRuleContext(TaskValueDclContext.class,0);
		}
		public ConstValueDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_constValueDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterConstValueDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitConstValueDcl(this);
		}
	}

	public final ConstValueDclContext constValueDcl() throws RecognitionException {
		ConstValueDclContext _localctx = new ConstValueDclContext(_ctx, getState());
		enterRule(_localctx, 6, RULE_constValueDcl);
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(75);
			_errHandler.sync(this);
			switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) {
			case 1:
				{
				setState(73);
				simpleValueDcl();
				}
				break;
			case 2:
				{
				setState(74);
				taskValueDcl();
				}
				break;
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class SimpleValueDclContext extends ParserRuleContext {
		public TerminalNode IDENT() { return getToken(GreyCatModelParser.IDENT, 0); }
		public TerminalNode STRING() { return getToken(GreyCatModelParser.STRING, 0); }
		public TerminalNode NUMBER() { return getToken(GreyCatModelParser.NUMBER, 0); }
		public SimpleValueDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_simpleValueDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterSimpleValueDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitSimpleValueDcl(this);
		}
	}

	public final SimpleValueDclContext simpleValueDcl() throws RecognitionException {
		SimpleValueDclContext _localctx = new SimpleValueDclContext(_ctx, getState());
		enterRule(_localctx, 8, RULE_simpleValueDcl);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(77);
			_la = _input.LA(1);
			if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << STRING) | (1L << IDENT) | (1L << NUMBER))) != 0)) ) {
			_errHandler.recoverInline(this);
			}
			else {
				if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
				_errHandler.reportMatch(this);
				consume();
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class TaskValueDclContext extends ParserRuleContext {
		public List actionValueDcl() {
			return getRuleContexts(ActionValueDclContext.class);
		}
		public ActionValueDclContext actionValueDcl(int i) {
			return getRuleContext(ActionValueDclContext.class,i);
		}
		public TaskValueDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_taskValueDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterTaskValueDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitTaskValueDcl(this);
		}
	}

	public final TaskValueDclContext taskValueDcl() throws RecognitionException {
		TaskValueDclContext _localctx = new TaskValueDclContext(_ctx, getState());
		enterRule(_localctx, 10, RULE_taskValueDcl);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(79);
			actionValueDcl();
			setState(84);
			_errHandler.sync(this);
			_la = _input.LA(1);
			while (_la==T__4) {
				{
				{
				setState(80);
				match(T__4);
				setState(81);
				actionValueDcl();
				}
				}
				setState(86);
				_errHandler.sync(this);
				_la = _input.LA(1);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class ActionValueDclContext extends ParserRuleContext {
		public TerminalNode IDENT() { return getToken(GreyCatModelParser.IDENT, 0); }
		public ActionParamListContext actionParamList() {
			return getRuleContext(ActionParamListContext.class,0);
		}
		public ActionValueDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_actionValueDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterActionValueDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitActionValueDcl(this);
		}
	}

	public final ActionValueDclContext actionValueDcl() throws RecognitionException {
		ActionValueDclContext _localctx = new ActionValueDclContext(_ctx, getState());
		enterRule(_localctx, 12, RULE_actionValueDcl);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(87);
			match(IDENT);
			setState(92);
			_errHandler.sync(this);
			_la = _input.LA(1);
			if (_la==T__5) {
				{
				setState(88);
				match(T__5);
				setState(89);
				actionParamList();
				setState(90);
				match(T__6);
				}
			}

			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class ActionParamListContext extends ParserRuleContext {
		public List actionParam() {
			return getRuleContexts(ActionParamContext.class);
		}
		public ActionParamContext actionParam(int i) {
			return getRuleContext(ActionParamContext.class,i);
		}
		public ActionParamListContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_actionParamList; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterActionParamList(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitActionParamList(this);
		}
	}

	public final ActionParamListContext actionParamList() throws RecognitionException {
		ActionParamListContext _localctx = new ActionParamListContext(_ctx, getState());
		enterRule(_localctx, 14, RULE_actionParamList);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(94);
			actionParam();
			setState(99);
			_errHandler.sync(this);
			_la = _input.LA(1);
			while (_la==T__7) {
				{
				{
				setState(95);
				match(T__7);
				setState(96);
				actionParam();
				}
				}
				setState(101);
				_errHandler.sync(this);
				_la = _input.LA(1);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class ActionParamContext extends ParserRuleContext {
		public TerminalNode STRING() { return getToken(GreyCatModelParser.STRING, 0); }
		public TerminalNode NUMBER() { return getToken(GreyCatModelParser.NUMBER, 0); }
		public SubTaskContext subTask() {
			return getRuleContext(SubTaskContext.class,0);
		}
		public ActionParamContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_actionParam; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterActionParam(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitActionParam(this);
		}
	}

	public final ActionParamContext actionParam() throws RecognitionException {
		ActionParamContext _localctx = new ActionParamContext(_ctx, getState());
		enterRule(_localctx, 16, RULE_actionParam);
		try {
			setState(105);
			_errHandler.sync(this);
			switch (_input.LA(1)) {
			case STRING:
				enterOuterAlt(_localctx, 1);
				{
				setState(102);
				match(STRING);
				}
				break;
			case NUMBER:
				enterOuterAlt(_localctx, 2);
				{
				setState(103);
				match(NUMBER);
				}
				break;
			case T__8:
				enterOuterAlt(_localctx, 3);
				{
				setState(104);
				subTask();
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class SubTaskContext extends ParserRuleContext {
		public TaskValueDclContext taskValueDcl() {
			return getRuleContext(TaskValueDclContext.class,0);
		}
		public SubTaskContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_subTask; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterSubTask(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitSubTask(this);
		}
	}

	public final SubTaskContext subTask() throws RecognitionException {
		SubTaskContext _localctx = new SubTaskContext(_ctx, getState());
		enterRule(_localctx, 18, RULE_subTask);
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(107);
			match(T__8);
			setState(108);
			taskValueDcl();
			setState(109);
			match(T__9);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class ClassDclContext extends ParserRuleContext {
		public Token name;
		public TerminalNode IDENT() { return getToken(GreyCatModelParser.IDENT, 0); }
		public ParentDclContext parentDcl() {
			return getRuleContext(ParentDclContext.class,0);
		}
		public List annotationDcl() {
			return getRuleContexts(AnnotationDclContext.class);
		}
		public AnnotationDclContext annotationDcl(int i) {
			return getRuleContext(AnnotationDclContext.class,i);
		}
		public List constDcl() {
			return getRuleContexts(ConstDclContext.class);
		}
		public ConstDclContext constDcl(int i) {
			return getRuleContext(ConstDclContext.class,i);
		}
		public List attributeDcl() {
			return getRuleContexts(AttributeDclContext.class);
		}
		public AttributeDclContext attributeDcl(int i) {
			return getRuleContext(AttributeDclContext.class,i);
		}
		public List relationDcl() {
			return getRuleContexts(RelationDclContext.class);
		}
		public RelationDclContext relationDcl(int i) {
			return getRuleContext(RelationDclContext.class,i);
		}
		public List referenceDcl() {
			return getRuleContexts(ReferenceDclContext.class);
		}
		public ReferenceDclContext referenceDcl(int i) {
			return getRuleContext(ReferenceDclContext.class,i);
		}
		public List localIndexDcl() {
			return getRuleContexts(LocalIndexDclContext.class);
		}
		public LocalIndexDclContext localIndexDcl(int i) {
			return getRuleContext(LocalIndexDclContext.class,i);
		}
		public ClassDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_classDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterClassDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitClassDcl(this);
		}
	}

	public final ClassDclContext classDcl() throws RecognitionException {
		ClassDclContext _localctx = new ClassDclContext(_ctx, getState());
		enterRule(_localctx, 20, RULE_classDcl);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(111);
			match(T__10);
			setState(112);
			((ClassDclContext)_localctx).name = match(IDENT);
			setState(114);
			_errHandler.sync(this);
			_la = _input.LA(1);
			if (_la==T__12) {
				{
				setState(113);
				parentDcl();
				}
			}

			setState(116);
			match(T__8);
			setState(125);
			_errHandler.sync(this);
			_la = _input.LA(1);
			while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__1) | (1L << T__13) | (1L << T__14) | (1L << T__15) | (1L << T__16) | (1L << T__18))) != 0)) {
				{
				setState(123);
				_errHandler.sync(this);
				switch (_input.LA(1)) {
				case T__14:
					{
					setState(117);
					annotationDcl();
					}
					break;
				case T__1:
					{
					setState(118);
					constDcl();
					}
					break;
				case T__13:
					{
					setState(119);
					attributeDcl();
					}
					break;
				case T__15:
					{
					setState(120);
					relationDcl();
					}
					break;
				case T__16:
					{
					setState(121);
					referenceDcl();
					}
					break;
				case T__18:
					{
					setState(122);
					localIndexDcl();
					}
					break;
				default:
					throw new NoViableAltException(this);
				}
				}
				setState(127);
				_errHandler.sync(this);
				_la = _input.LA(1);
			}
			setState(128);
			match(T__9);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class CustomTypeDclContext extends ParserRuleContext {
		public Token name;
		public TerminalNode IDENT() { return getToken(GreyCatModelParser.IDENT, 0); }
		public ParentDclContext parentDcl() {
			return getRuleContext(ParentDclContext.class,0);
		}
		public List constDcl() {
			return getRuleContexts(ConstDclContext.class);
		}
		public ConstDclContext constDcl(int i) {
			return getRuleContext(ConstDclContext.class,i);
		}
		public List attributeDcl() {
			return getRuleContexts(AttributeDclContext.class);
		}
		public AttributeDclContext attributeDcl(int i) {
			return getRuleContext(AttributeDclContext.class,i);
		}
		public CustomTypeDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_customTypeDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterCustomTypeDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitCustomTypeDcl(this);
		}
	}

	public final CustomTypeDclContext customTypeDcl() throws RecognitionException {
		CustomTypeDclContext _localctx = new CustomTypeDclContext(_ctx, getState());
		enterRule(_localctx, 22, RULE_customTypeDcl);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(130);
			match(T__11);
			setState(131);
			((CustomTypeDclContext)_localctx).name = match(IDENT);
			setState(133);
			_errHandler.sync(this);
			_la = _input.LA(1);
			if (_la==T__12) {
				{
				setState(132);
				parentDcl();
				}
			}

			setState(135);
			match(T__8);
			setState(140);
			_errHandler.sync(this);
			_la = _input.LA(1);
			while (_la==T__1 || _la==T__13) {
				{
				setState(138);
				_errHandler.sync(this);
				switch (_input.LA(1)) {
				case T__1:
					{
					setState(136);
					constDcl();
					}
					break;
				case T__13:
					{
					setState(137);
					attributeDcl();
					}
					break;
				default:
					throw new NoViableAltException(this);
				}
				}
				setState(142);
				_errHandler.sync(this);
				_la = _input.LA(1);
			}
			setState(143);
			match(T__9);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class ParentDclContext extends ParserRuleContext {
		public TerminalNode IDENT() { return getToken(GreyCatModelParser.IDENT, 0); }
		public ParentDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_parentDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterParentDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitParentDcl(this);
		}
	}

	public final ParentDclContext parentDcl() throws RecognitionException {
		ParentDclContext _localctx = new ParentDclContext(_ctx, getState());
		enterRule(_localctx, 24, RULE_parentDcl);
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(145);
			match(T__12);
			setState(146);
			match(IDENT);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class AttributeDclContext extends ParserRuleContext {
		public Token name;
		public Token type;
		public List IDENT() { return getTokens(GreyCatModelParser.IDENT); }
		public TerminalNode IDENT(int i) {
			return getToken(GreyCatModelParser.IDENT, i);
		}
		public AttributeValueDclContext attributeValueDcl() {
			return getRuleContext(AttributeValueDclContext.class,0);
		}
		public AttributeDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_attributeDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterAttributeDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitAttributeDcl(this);
		}
	}

	public final AttributeDclContext attributeDcl() throws RecognitionException {
		AttributeDclContext _localctx = new AttributeDclContext(_ctx, getState());
		enterRule(_localctx, 26, RULE_attributeDcl);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(148);
			match(T__13);
			setState(149);
			((AttributeDclContext)_localctx).name = match(IDENT);
			setState(150);
			match(T__2);
			setState(151);
			((AttributeDclContext)_localctx).type = match(IDENT);
			setState(154);
			_errHandler.sync(this);
			_la = _input.LA(1);
			if (_la==T__3) {
				{
				setState(152);
				match(T__3);
				setState(153);
				attributeValueDcl();
				}
			}

			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class AnnotationDclContext extends ParserRuleContext {
		public Token name;
		public AttributeValueDclContext value;
		public TerminalNode IDENT() { return getToken(GreyCatModelParser.IDENT, 0); }
		public AttributeValueDclContext attributeValueDcl() {
			return getRuleContext(AttributeValueDclContext.class,0);
		}
		public AnnotationDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_annotationDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterAnnotationDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitAnnotationDcl(this);
		}
	}

	public final AnnotationDclContext annotationDcl() throws RecognitionException {
		AnnotationDclContext _localctx = new AnnotationDclContext(_ctx, getState());
		enterRule(_localctx, 28, RULE_annotationDcl);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(156);
			match(T__14);
			setState(157);
			((AnnotationDclContext)_localctx).name = match(IDENT);
			setState(160);
			_errHandler.sync(this);
			_la = _input.LA(1);
			if (_la==T__3) {
				{
				setState(158);
				match(T__3);
				setState(159);
				((AnnotationDclContext)_localctx).value = attributeValueDcl();
				}
			}

			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class AttributeValueDclContext extends ParserRuleContext {
		public TerminalNode IDENT() { return getToken(GreyCatModelParser.IDENT, 0); }
		public TerminalNode STRING() { return getToken(GreyCatModelParser.STRING, 0); }
		public TerminalNode NUMBER() { return getToken(GreyCatModelParser.NUMBER, 0); }
		public ComplexAttributeValueDclContext complexAttributeValueDcl() {
			return getRuleContext(ComplexAttributeValueDclContext.class,0);
		}
		public AttributeValueDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_attributeValueDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterAttributeValueDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitAttributeValueDcl(this);
		}
	}

	public final AttributeValueDclContext attributeValueDcl() throws RecognitionException {
		AttributeValueDclContext _localctx = new AttributeValueDclContext(_ctx, getState());
		enterRule(_localctx, 30, RULE_attributeValueDcl);
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(166);
			_errHandler.sync(this);
			switch (_input.LA(1)) {
			case IDENT:
				{
				setState(162);
				match(IDENT);
				}
				break;
			case STRING:
				{
				setState(163);
				match(STRING);
				}
				break;
			case NUMBER:
				{
				setState(164);
				match(NUMBER);
				}
				break;
			case T__5:
				{
				setState(165);
				complexAttributeValueDcl();
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class ComplexAttributeValueDclContext extends ParserRuleContext {
		public List complexValueDcl() {
			return getRuleContexts(ComplexValueDclContext.class);
		}
		public ComplexValueDclContext complexValueDcl(int i) {
			return getRuleContext(ComplexValueDclContext.class,i);
		}
		public ComplexAttributeValueDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_complexAttributeValueDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterComplexAttributeValueDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitComplexAttributeValueDcl(this);
		}
	}

	public final ComplexAttributeValueDclContext complexAttributeValueDcl() throws RecognitionException {
		ComplexAttributeValueDclContext _localctx = new ComplexAttributeValueDclContext(_ctx, getState());
		enterRule(_localctx, 32, RULE_complexAttributeValueDcl);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(168);
			match(T__5);
			setState(169);
			complexValueDcl();
			setState(174);
			_errHandler.sync(this);
			_la = _input.LA(1);
			while (_la==T__7) {
				{
				{
				setState(170);
				match(T__7);
				setState(171);
				complexValueDcl();
				}
				}
				setState(176);
				_errHandler.sync(this);
				_la = _input.LA(1);
			}
			setState(177);
			match(T__6);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class ComplexValueDclContext extends ParserRuleContext {
		public TerminalNode IDENT() { return getToken(GreyCatModelParser.IDENT, 0); }
		public TerminalNode STRING() { return getToken(GreyCatModelParser.STRING, 0); }
		public TerminalNode NUMBER() { return getToken(GreyCatModelParser.NUMBER, 0); }
		public NtupleValueDlcContext ntupleValueDlc() {
			return getRuleContext(NtupleValueDlcContext.class,0);
		}
		public ComplexValueDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_complexValueDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterComplexValueDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitComplexValueDcl(this);
		}
	}

	public final ComplexValueDclContext complexValueDcl() throws RecognitionException {
		ComplexValueDclContext _localctx = new ComplexValueDclContext(_ctx, getState());
		enterRule(_localctx, 34, RULE_complexValueDcl);
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(183);
			_errHandler.sync(this);
			switch (_input.LA(1)) {
			case IDENT:
				{
				setState(179);
				match(IDENT);
				}
				break;
			case STRING:
				{
				setState(180);
				match(STRING);
				}
				break;
			case NUMBER:
				{
				setState(181);
				match(NUMBER);
				}
				break;
			case T__5:
				{
				setState(182);
				ntupleValueDlc();
				}
				break;
			default:
				throw new NoViableAltException(this);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class NtupleValueDlcContext extends ParserRuleContext {
		public List ntupleElementDlc() {
			return getRuleContexts(NtupleElementDlcContext.class);
		}
		public NtupleElementDlcContext ntupleElementDlc(int i) {
			return getRuleContext(NtupleElementDlcContext.class,i);
		}
		public NtupleValueDlcContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_ntupleValueDlc; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterNtupleValueDlc(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitNtupleValueDlc(this);
		}
	}

	public final NtupleValueDlcContext ntupleValueDlc() throws RecognitionException {
		NtupleValueDlcContext _localctx = new NtupleValueDlcContext(_ctx, getState());
		enterRule(_localctx, 36, RULE_ntupleValueDlc);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(185);
			match(T__5);
			setState(186);
			ntupleElementDlc();
			setState(191);
			_errHandler.sync(this);
			_la = _input.LA(1);
			while (_la==T__7) {
				{
				{
				setState(187);
				match(T__7);
				setState(188);
				ntupleElementDlc();
				}
				}
				setState(193);
				_errHandler.sync(this);
				_la = _input.LA(1);
			}
			setState(194);
			match(T__6);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class NtupleElementDlcContext extends ParserRuleContext {
		public TerminalNode IDENT() { return getToken(GreyCatModelParser.IDENT, 0); }
		public TerminalNode STRING() { return getToken(GreyCatModelParser.STRING, 0); }
		public TerminalNode NUMBER() { return getToken(GreyCatModelParser.NUMBER, 0); }
		public NtupleElementDlcContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_ntupleElementDlc; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterNtupleElementDlc(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitNtupleElementDlc(this);
		}
	}

	public final NtupleElementDlcContext ntupleElementDlc() throws RecognitionException {
		NtupleElementDlcContext _localctx = new NtupleElementDlcContext(_ctx, getState());
		enterRule(_localctx, 38, RULE_ntupleElementDlc);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(196);
			_la = _input.LA(1);
			if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << STRING) | (1L << IDENT) | (1L << NUMBER))) != 0)) ) {
			_errHandler.recoverInline(this);
			}
			else {
				if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
				_errHandler.reportMatch(this);
				consume();
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class RelationDclContext extends ParserRuleContext {
		public Token name;
		public Token type;
		public List IDENT() { return getTokens(GreyCatModelParser.IDENT); }
		public TerminalNode IDENT(int i) {
			return getToken(GreyCatModelParser.IDENT, i);
		}
		public OppositeDclContext oppositeDcl() {
			return getRuleContext(OppositeDclContext.class,0);
		}
		public RelationDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_relationDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterRelationDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitRelationDcl(this);
		}
	}

	public final RelationDclContext relationDcl() throws RecognitionException {
		RelationDclContext _localctx = new RelationDclContext(_ctx, getState());
		enterRule(_localctx, 40, RULE_relationDcl);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(198);
			match(T__15);
			setState(199);
			((RelationDclContext)_localctx).name = match(IDENT);
			setState(200);
			match(T__2);
			setState(201);
			((RelationDclContext)_localctx).type = match(IDENT);
			setState(203);
			_errHandler.sync(this);
			_la = _input.LA(1);
			if (_la==T__17) {
				{
				setState(202);
				oppositeDcl();
				}
			}

			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class ReferenceDclContext extends ParserRuleContext {
		public Token name;
		public Token type;
		public List IDENT() { return getTokens(GreyCatModelParser.IDENT); }
		public TerminalNode IDENT(int i) {
			return getToken(GreyCatModelParser.IDENT, i);
		}
		public OppositeDclContext oppositeDcl() {
			return getRuleContext(OppositeDclContext.class,0);
		}
		public ReferenceDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_referenceDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterReferenceDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitReferenceDcl(this);
		}
	}

	public final ReferenceDclContext referenceDcl() throws RecognitionException {
		ReferenceDclContext _localctx = new ReferenceDclContext(_ctx, getState());
		enterRule(_localctx, 42, RULE_referenceDcl);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(205);
			match(T__16);
			setState(206);
			((ReferenceDclContext)_localctx).name = match(IDENT);
			setState(207);
			match(T__2);
			setState(208);
			((ReferenceDclContext)_localctx).type = match(IDENT);
			setState(210);
			_errHandler.sync(this);
			_la = _input.LA(1);
			if (_la==T__17) {
				{
				setState(209);
				oppositeDcl();
				}
			}

			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class OppositeDclContext extends ParserRuleContext {
		public Token name;
		public TerminalNode IDENT() { return getToken(GreyCatModelParser.IDENT, 0); }
		public OppositeDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_oppositeDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterOppositeDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitOppositeDcl(this);
		}
	}

	public final OppositeDclContext oppositeDcl() throws RecognitionException {
		OppositeDclContext _localctx = new OppositeDclContext(_ctx, getState());
		enterRule(_localctx, 44, RULE_oppositeDcl);
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(212);
			match(T__17);
			setState(213);
			((OppositeDclContext)_localctx).name = match(IDENT);
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class LocalIndexDclContext extends ParserRuleContext {
		public Token name;
		public Token type;
		public IndexAttributesDclContext indexAttributesDcl() {
			return getRuleContext(IndexAttributesDclContext.class,0);
		}
		public List IDENT() { return getTokens(GreyCatModelParser.IDENT); }
		public TerminalNode IDENT(int i) {
			return getToken(GreyCatModelParser.IDENT, i);
		}
		public OppositeDclContext oppositeDcl() {
			return getRuleContext(OppositeDclContext.class,0);
		}
		public LocalIndexDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_localIndexDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterLocalIndexDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitLocalIndexDcl(this);
		}
	}

	public final LocalIndexDclContext localIndexDcl() throws RecognitionException {
		LocalIndexDclContext _localctx = new LocalIndexDclContext(_ctx, getState());
		enterRule(_localctx, 46, RULE_localIndexDcl);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(215);
			match(T__18);
			setState(216);
			((LocalIndexDclContext)_localctx).name = match(IDENT);
			setState(217);
			match(T__2);
			setState(218);
			((LocalIndexDclContext)_localctx).type = match(IDENT);
			setState(219);
			match(T__19);
			setState(220);
			indexAttributesDcl();
			setState(222);
			_errHandler.sync(this);
			_la = _input.LA(1);
			if (_la==T__17) {
				{
				setState(221);
				oppositeDcl();
				}
			}

			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class IndexAttributesDclContext extends ParserRuleContext {
		public List IDENT() { return getTokens(GreyCatModelParser.IDENT); }
		public TerminalNode IDENT(int i) {
			return getToken(GreyCatModelParser.IDENT, i);
		}
		public IndexAttributesDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_indexAttributesDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterIndexAttributesDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitIndexAttributesDcl(this);
		}
	}

	public final IndexAttributesDclContext indexAttributesDcl() throws RecognitionException {
		IndexAttributesDclContext _localctx = new IndexAttributesDclContext(_ctx, getState());
		enterRule(_localctx, 48, RULE_indexAttributesDcl);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(224);
			match(IDENT);
			setState(229);
			_errHandler.sync(this);
			_la = _input.LA(1);
			while (_la==T__7) {
				{
				{
				setState(225);
				match(T__7);
				setState(226);
				match(IDENT);
				}
				}
				setState(231);
				_errHandler.sync(this);
				_la = _input.LA(1);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class GlobalIndexDclContext extends ParserRuleContext {
		public Token name;
		public Token type;
		public IndexAttributesDclContext indexAttributesDcl() {
			return getRuleContext(IndexAttributesDclContext.class,0);
		}
		public List IDENT() { return getTokens(GreyCatModelParser.IDENT); }
		public TerminalNode IDENT(int i) {
			return getToken(GreyCatModelParser.IDENT, i);
		}
		public GlobalIndexDclContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_globalIndexDcl; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).enterGlobalIndexDcl(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof GreyCatModelListener ) ((GreyCatModelListener)listener).exitGlobalIndexDcl(this);
		}
	}

	public final GlobalIndexDclContext globalIndexDcl() throws RecognitionException {
		GlobalIndexDclContext _localctx = new GlobalIndexDclContext(_ctx, getState());
		enterRule(_localctx, 50, RULE_globalIndexDcl);
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(232);
			match(T__18);
			setState(233);
			((GlobalIndexDclContext)_localctx).name = match(IDENT);
			setState(234);
			match(T__2);
			setState(235);
			((GlobalIndexDclContext)_localctx).type = match(IDENT);
			setState(236);
			match(T__19);
			setState(237);
			indexAttributesDcl();
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static final String _serializedATN =
		"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\34\u00f2\4\2\t\2"+
		"\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+
		"\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+
		"\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+
		"\4\32\t\32\4\33\t\33\3\2\3\2\3\2\3\2\3\2\7\2<\n\2\f\2\16\2?\13\2\3\3\3"+
		"\3\3\3\3\4\3\4\3\4\3\4\3\4\3\4\5\4J\n\4\3\5\3\5\5\5N\n\5\3\6\3\6\3\7\3"+
		"\7\3\7\7\7U\n\7\f\7\16\7X\13\7\3\b\3\b\3\b\3\b\3\b\5\b_\n\b\3\t\3\t\3"+
		"\t\7\td\n\t\f\t\16\tg\13\t\3\n\3\n\3\n\5\nl\n\n\3\13\3\13\3\13\3\13\3"+
		"\f\3\f\3\f\5\fu\n\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\7\f~\n\f\f\f\16\f\u0081"+
		"\13\f\3\f\3\f\3\r\3\r\3\r\5\r\u0088\n\r\3\r\3\r\3\r\7\r\u008d\n\r\f\r"+
		"\16\r\u0090\13\r\3\r\3\r\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17"+
		"\5\17\u009d\n\17\3\20\3\20\3\20\3\20\5\20\u00a3\n\20\3\21\3\21\3\21\3"+
		"\21\5\21\u00a9\n\21\3\22\3\22\3\22\3\22\7\22\u00af\n\22\f\22\16\22\u00b2"+
		"\13\22\3\22\3\22\3\23\3\23\3\23\3\23\5\23\u00ba\n\23\3\24\3\24\3\24\3"+
		"\24\7\24\u00c0\n\24\f\24\16\24\u00c3\13\24\3\24\3\24\3\25\3\25\3\26\3"+
		"\26\3\26\3\26\3\26\5\26\u00ce\n\26\3\27\3\27\3\27\3\27\3\27\5\27\u00d5"+
		"\n\27\3\30\3\30\3\30\3\31\3\31\3\31\3\31\3\31\3\31\3\31\5\31\u00e1\n\31"+
		"\3\32\3\32\3\32\7\32\u00e6\n\32\f\32\16\32\u00e9\13\32\3\33\3\33\3\33"+
		"\3\33\3\33\3\33\3\33\3\33\2\2\34\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36"+
		" \"$&(*,.\60\62\64\2\3\3\2\27\31\2\u00fb\2=\3\2\2\2\4@\3\2\2\2\6C\3\2"+
		"\2\2\bM\3\2\2\2\nO\3\2\2\2\fQ\3\2\2\2\16Y\3\2\2\2\20`\3\2\2\2\22k\3\2"+
		"\2\2\24m\3\2\2\2\26q\3\2\2\2\30\u0084\3\2\2\2\32\u0093\3\2\2\2\34\u0096"+
		"\3\2\2\2\36\u009e\3\2\2\2 \u00a8\3\2\2\2\"\u00aa\3\2\2\2$\u00b9\3\2\2"+
		"\2&\u00bb\3\2\2\2(\u00c6\3\2\2\2*\u00c8\3\2\2\2,\u00cf\3\2\2\2.\u00d6"+
		"\3\2\2\2\60\u00d9\3\2\2\2\62\u00e2\3\2\2\2\64\u00ea\3\2\2\2\66<\5\6\4"+
		"\2\67<\5\26\f\28<\5\64\33\29<\5\30\r\2:<\5\4\3\2;\66\3\2\2\2;\67\3\2\2"+
		"\2;8\3\2\2\2;9\3\2\2\2;:\3\2\2\2\3\2\2\2>\3\3\2"+
		"\2\2?=\3\2\2\2@A\7\3\2\2AB\7\27\2\2B\5\3\2\2\2CD\7\4\2\2DE\7\30\2\2EF"+
		"\7\5\2\2FI\7\30\2\2GH\7\6\2\2HJ\5\b\5\2IG\3\2\2\2IJ\3\2\2\2J\7\3\2\2\2"+
		"KN\5\n\6\2LN\5\f\7\2MK\3\2\2\2ML\3\2\2\2N\t\3\2\2\2OP\t\2\2\2P\13\3\2"+
		"\2\2QV\5\16\b\2RS\7\7\2\2SU\5\16\b\2TR\3\2\2\2UX\3\2\2\2VT\3\2\2\2VW\3"+
		"\2\2\2W\r\3\2\2\2XV\3\2\2\2Y^\7\30\2\2Z[\7\b\2\2[\\\5\20\t\2\\]\7\t\2"+
		"\2]_\3\2\2\2^Z\3\2\2\2^_\3\2\2\2_\17\3\2\2\2`e\5\22\n\2ab\7\n\2\2bd\5"+
		"\22\n\2ca\3\2\2\2dg\3\2\2\2ec\3\2\2\2ef\3\2\2\2f\21\3\2\2\2ge\3\2\2\2"+
		"hl\7\27\2\2il\7\31\2\2jl\5\24\13\2kh\3\2\2\2ki\3\2\2\2kj\3\2\2\2l\23\3"+
		"\2\2\2mn\7\13\2\2no\5\f\7\2op\7\f\2\2p\25\3\2\2\2qr\7\r\2\2rt\7\30\2\2"+
		"su\5\32\16\2ts\3\2\2\2tu\3\2\2\2uv\3\2\2\2v\177\7\13\2\2w~\5\36\20\2x"+
		"~\5\6\4\2y~\5\34\17\2z~\5*\26\2{~\5,\27\2|~\5\60\31\2}w\3\2\2\2}x\3\2"+
		"\2\2}y\3\2\2\2}z\3\2\2\2}{\3\2\2\2}|\3\2\2\2~\u0081\3\2\2\2\177}\3\2\2"+
		"\2\177\u0080\3\2\2\2\u0080\u0082\3\2\2\2\u0081\177\3\2\2\2\u0082\u0083"+
		"\7\f\2\2\u0083\27\3\2\2\2\u0084\u0085\7\16\2\2\u0085\u0087\7\30\2\2\u0086"+
		"\u0088\5\32\16\2\u0087\u0086\3\2\2\2\u0087\u0088\3\2\2\2\u0088\u0089\3"+
		"\2\2\2\u0089\u008e\7\13\2\2\u008a\u008d\5\6\4\2\u008b\u008d\5\34\17\2"+
		"\u008c\u008a\3\2\2\2\u008c\u008b\3\2\2\2\u008d\u0090\3\2\2\2\u008e\u008c"+
		"\3\2\2\2\u008e\u008f\3\2\2\2\u008f\u0091\3\2\2\2\u0090\u008e\3\2\2\2\u0091"+
		"\u0092\7\f\2\2\u0092\31\3\2\2\2\u0093\u0094\7\17\2\2\u0094\u0095\7\30"+
		"\2\2\u0095\33\3\2\2\2\u0096\u0097\7\20\2\2\u0097\u0098\7\30\2\2\u0098"+
		"\u0099\7\5\2\2\u0099\u009c\7\30\2\2\u009a\u009b\7\6\2\2\u009b\u009d\5"+
		" \21\2\u009c\u009a\3\2\2\2\u009c\u009d\3\2\2\2\u009d\35\3\2\2\2\u009e"+
		"\u009f\7\21\2\2\u009f\u00a2\7\30\2\2\u00a0\u00a1\7\6\2\2\u00a1\u00a3\5"+
		" \21\2\u00a2\u00a0\3\2\2\2\u00a2\u00a3\3\2\2\2\u00a3\37\3\2\2\2\u00a4"+
		"\u00a9\7\30\2\2\u00a5\u00a9\7\27\2\2\u00a6\u00a9\7\31\2\2\u00a7\u00a9"+
		"\5\"\22\2\u00a8\u00a4\3\2\2\2\u00a8\u00a5\3\2\2\2\u00a8\u00a6\3\2\2\2"+
		"\u00a8\u00a7\3\2\2\2\u00a9!\3\2\2\2\u00aa\u00ab\7\b\2\2\u00ab\u00b0\5"+
		"$\23\2\u00ac\u00ad\7\n\2\2\u00ad\u00af\5$\23\2\u00ae\u00ac\3\2\2\2\u00af"+
		"\u00b2\3\2\2\2\u00b0\u00ae\3\2\2\2\u00b0\u00b1\3\2\2\2\u00b1\u00b3\3\2"+
		"\2\2\u00b2\u00b0\3\2\2\2\u00b3\u00b4\7\t\2\2\u00b4#\3\2\2\2\u00b5\u00ba"+
		"\7\30\2\2\u00b6\u00ba\7\27\2\2\u00b7\u00ba\7\31\2\2\u00b8\u00ba\5&\24"+
		"\2\u00b9\u00b5\3\2\2\2\u00b9\u00b6\3\2\2\2\u00b9\u00b7\3\2\2\2\u00b9\u00b8"+
		"\3\2\2\2\u00ba%\3\2\2\2\u00bb\u00bc\7\b\2\2\u00bc\u00c1\5(\25\2\u00bd"+
		"\u00be\7\n\2\2\u00be\u00c0\5(\25\2\u00bf\u00bd\3\2\2\2\u00c0\u00c3\3\2"+
		"\2\2\u00c1\u00bf\3\2\2\2\u00c1\u00c2\3\2\2\2\u00c2\u00c4\3\2\2\2\u00c3"+
		"\u00c1\3\2\2\2\u00c4\u00c5\7\t\2\2\u00c5\'\3\2\2\2\u00c6\u00c7\t\2\2\2"+
		"\u00c7)\3\2\2\2\u00c8\u00c9\7\22\2\2\u00c9\u00ca\7\30\2\2\u00ca\u00cb"+
		"\7\5\2\2\u00cb\u00cd\7\30\2\2\u00cc\u00ce\5.\30\2\u00cd\u00cc\3\2\2\2"+
		"\u00cd\u00ce\3\2\2\2\u00ce+\3\2\2\2\u00cf\u00d0\7\23\2\2\u00d0\u00d1\7"+
		"\30\2\2\u00d1\u00d2\7\5\2\2\u00d2\u00d4\7\30\2\2\u00d3\u00d5\5.\30\2\u00d4"+
		"\u00d3\3\2\2\2\u00d4\u00d5\3\2\2\2\u00d5-\3\2\2\2\u00d6\u00d7\7\24\2\2"+
		"\u00d7\u00d8\7\30\2\2\u00d8/\3\2\2\2\u00d9\u00da\7\25\2\2\u00da\u00db"+
		"\7\30\2\2\u00db\u00dc\7\5\2\2\u00dc\u00dd\7\30\2\2\u00dd\u00de\7\26\2"+
		"\2\u00de\u00e0\5\62\32\2\u00df\u00e1\5.\30\2\u00e0\u00df\3\2\2\2\u00e0"+
		"\u00e1\3\2\2\2\u00e1\61\3\2\2\2\u00e2\u00e7\7\30\2\2\u00e3\u00e4\7\n\2"+
		"\2\u00e4\u00e6\7\30\2\2\u00e5\u00e3\3\2\2\2\u00e6\u00e9\3\2\2\2\u00e7"+
		"\u00e5\3\2\2\2\u00e7\u00e8\3\2\2\2\u00e8\63\3\2\2\2\u00e9\u00e7\3\2\2"+
		"\2\u00ea\u00eb\7\25\2\2\u00eb\u00ec\7\30\2\2\u00ec\u00ed\7\5\2\2\u00ed"+
		"\u00ee\7\30\2\2\u00ee\u00ef\7\26\2\2\u00ef\u00f0\5\62\32\2\u00f0\65\3"+
		"\2\2\2\32;=IMV^ekt}\177\u0087\u008c\u008e\u009c\u00a2\u00a8\u00b0\u00b9"+
		"\u00c1\u00cd\u00d4\u00e0\u00e7";
	public static final ATN _ATN =
		new ATNDeserializer().deserialize(_serializedATN.toCharArray());
	static {
		_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
		for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
			_decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy