// Generated from /Users/wmc/workspace/notetron/antlr-md/lib/g4/Markdown.g4 by ANTLR 4.9.2
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 MarkdownParser extends Parser {
	static { RuntimeMetaData.checkVersion("4.9.2", RuntimeMetaData.VERSION); }

	protected static final DFA[] _decisionToDFA;
	protected static final PredictionContextCache _sharedContextCache =
		new PredictionContextCache();
	public static final int
		HEADER=1, CHAR=2, INLINE_CODE=3, BLOCK_CODE=4, NL=5;
	public static final int
		RULE_markdown = 0, RULE_block = 1, RULE_inlineHeader = 2, RULE_inlineText = 3, 
		RULE_textContent = 4, RULE_blockCode = 5, RULE_text = 6, RULE_inlineCode = 7;
	private static String[] makeRuleNames() {
		return new String[] {
			"markdown", "block", "inlineHeader", "inlineText", "textContent", "blockCode", 
			"text", "inlineCode"
		};
	}
	public static final String[] ruleNames = makeRuleNames();

	private static String[] makeLiteralNames() {
		return new String[] {
		};
	}
	private static final String[] _LITERAL_NAMES = makeLiteralNames();
	private static String[] makeSymbolicNames() {
		return new String[] {
			null, "HEADER", "CHAR", "INLINE_CODE", "BLOCK_CODE", "NL"
		};
	}
	private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
	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] = "<INVALID>";
			}
		}
	}

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

	@Override

	public Vocabulary getVocabulary() {
		return VOCABULARY;
	}

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

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

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

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

	public MarkdownParser(TokenStream input) {
		super(input);
		_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
	}

	public static class MarkdownContext extends ParserRuleContext {
		public List<BlockContext> block() {
			return getRuleContexts(BlockContext.class);
		}
		public BlockContext block(int i) {
			return getRuleContext(BlockContext.class,i);
		}
		public TerminalNode EOF() { return getToken(MarkdownParser.EOF, 0); }
		public MarkdownContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_markdown; }
	}

	public final MarkdownContext markdown() throws RecognitionException {
		MarkdownContext _localctx = new MarkdownContext(_ctx, getState());
		enterRule(_localctx, 0, RULE_markdown);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(19);
			_errHandler.sync(this);
			_la = _input.LA(1);
			while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << HEADER) | (1L << CHAR) | (1L << INLINE_CODE) | (1L << BLOCK_CODE) | (1L << NL))) != 0)) {
				{
				{
				setState(16);
				block();
				}
				}
				setState(21);
				_errHandler.sync(this);
				_la = _input.LA(1);
			}
			setState(23);
			_errHandler.sync(this);
			switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) {
			case 1:
				{
				setState(22);
				match(EOF);
				}
				break;
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class BlockContext extends ParserRuleContext {
		public InlineHeaderContext inlineHeader() {
			return getRuleContext(InlineHeaderContext.class,0);
		}
		public InlineTextContext inlineText() {
			return getRuleContext(InlineTextContext.class,0);
		}
		public BlockCodeContext blockCode() {
			return getRuleContext(BlockCodeContext.class,0);
		}
		public TerminalNode NL() { return getToken(MarkdownParser.NL, 0); }
		public BlockContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_block; }
	}

	public final BlockContext block() throws RecognitionException {
		BlockContext _localctx = new BlockContext(_ctx, getState());
		enterRule(_localctx, 2, RULE_block);
		try {
			setState(29);
			_errHandler.sync(this);
			switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) {
			case 1:
				enterOuterAlt(_localctx, 1);
				{
				setState(25);
				inlineHeader();
				}
				break;
			case 2:
				enterOuterAlt(_localctx, 2);
				{
				setState(26);
				inlineText();
				}
				break;
			case 3:
				enterOuterAlt(_localctx, 3);
				{
				setState(27);
				blockCode();
				}
				break;
			case 4:
				enterOuterAlt(_localctx, 4);
				{
				setState(28);
				match(NL);
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class InlineHeaderContext extends ParserRuleContext {
		public TerminalNode HEADER() { return getToken(MarkdownParser.HEADER, 0); }
		public TextContentContext textContent() {
			return getRuleContext(TextContentContext.class,0);
		}
		public TerminalNode NL() { return getToken(MarkdownParser.NL, 0); }
		public InlineHeaderContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_inlineHeader; }
	}

	public final InlineHeaderContext inlineHeader() throws RecognitionException {
		InlineHeaderContext _localctx = new InlineHeaderContext(_ctx, getState());
		enterRule(_localctx, 4, RULE_inlineHeader);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(32);
			_errHandler.sync(this);
			_la = _input.LA(1);
			if (_la==NL) {
				{
				setState(31);
				match(NL);
				}
			}

			setState(34);
			match(HEADER);
			setState(35);
			textContent();
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class InlineTextContext extends ParserRuleContext {
		public TextContentContext textContent() {
			return getRuleContext(TextContentContext.class,0);
		}
		public TerminalNode NL() { return getToken(MarkdownParser.NL, 0); }
		public InlineTextContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_inlineText; }
	}

	public final InlineTextContext inlineText() throws RecognitionException {
		InlineTextContext _localctx = new InlineTextContext(_ctx, getState());
		enterRule(_localctx, 6, RULE_inlineText);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(38);
			_errHandler.sync(this);
			_la = _input.LA(1);
			if (_la==NL) {
				{
				setState(37);
				match(NL);
				}
			}

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

	public static class TextContentContext extends ParserRuleContext {
		public List<InlineCodeContext> inlineCode() {
			return getRuleContexts(InlineCodeContext.class);
		}
		public InlineCodeContext inlineCode(int i) {
			return getRuleContext(InlineCodeContext.class,i);
		}
		public List<TextContext> text() {
			return getRuleContexts(TextContext.class);
		}
		public TextContext text(int i) {
			return getRuleContext(TextContext.class,i);
		}
		public TextContentContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_textContent; }
	}

	public final TextContentContext textContent() throws RecognitionException {
		TextContentContext _localctx = new TextContentContext(_ctx, getState());
		enterRule(_localctx, 8, RULE_textContent);
		try {
			int _alt;
			enterOuterAlt(_localctx, 1);
			{
			setState(44); 
			_errHandler.sync(this);
			_alt = 1;
			do {
				switch (_alt) {
				case 1:
					{
					setState(44);
					_errHandler.sync(this);
					switch (_input.LA(1)) {
					case INLINE_CODE:
						{
						setState(42);
						inlineCode();
						}
						break;
					case CHAR:
						{
						setState(43);
						text();
						}
						break;
					default:
						throw new NoViableAltException(this);
					}
					}
					break;
				default:
					throw new NoViableAltException(this);
				}
				setState(46); 
				_errHandler.sync(this);
				_alt = getInterpreter().adaptivePredict(_input,6,_ctx);
			} while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class BlockCodeContext extends ParserRuleContext {
		public TerminalNode BLOCK_CODE() { return getToken(MarkdownParser.BLOCK_CODE, 0); }
		public TerminalNode NL() { return getToken(MarkdownParser.NL, 0); }
		public BlockCodeContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_blockCode; }
	}

	public final BlockCodeContext blockCode() throws RecognitionException {
		BlockCodeContext _localctx = new BlockCodeContext(_ctx, getState());
		enterRule(_localctx, 10, RULE_blockCode);
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(48);
			match(BLOCK_CODE);
			setState(50);
			_errHandler.sync(this);
			switch ( getInterpreter().adaptivePredict(_input,7,_ctx) ) {
			case 1:
				{
				setState(49);
				match(NL);
				}
				break;
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class TextContext extends ParserRuleContext {
		public List<TerminalNode> CHAR() { return getTokens(MarkdownParser.CHAR); }
		public TerminalNode CHAR(int i) {
			return getToken(MarkdownParser.CHAR, i);
		}
		public TextContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_text; }
	}

	public final TextContext text() throws RecognitionException {
		TextContext _localctx = new TextContext(_ctx, getState());
		enterRule(_localctx, 12, RULE_text);
		try {
			int _alt;
			enterOuterAlt(_localctx, 1);
			{
			setState(53); 
			_errHandler.sync(this);
			_alt = 1;
			do {
				switch (_alt) {
				case 1:
					{
					{
					setState(52);
					match(CHAR);
					}
					}
					break;
				default:
					throw new NoViableAltException(this);
				}
				setState(55); 
				_errHandler.sync(this);
				_alt = getInterpreter().adaptivePredict(_input,8,_ctx);
			} while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	public static class InlineCodeContext extends ParserRuleContext {
		public TerminalNode INLINE_CODE() { return getToken(MarkdownParser.INLINE_CODE, 0); }
		public InlineCodeContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_inlineCode; }
	}

	public final InlineCodeContext inlineCode() throws RecognitionException {
		InlineCodeContext _localctx = new InlineCodeContext(_ctx, getState());
		enterRule(_localctx, 14, RULE_inlineCode);
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(57);
			match(INLINE_CODE);
			}
		}
		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\7>\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\3\2\7\2\24\n\2\f\2"+
		"\16\2\27\13\2\3\2\5\2\32\n\2\3\3\3\3\3\3\3\3\5\3 \n\3\3\4\5\4#\n\4\3\4"+
		"\3\4\3\4\3\5\5\5)\n\5\3\5\3\5\3\6\3\6\6\6/\n\6\r\6\16\6\60\3\7\3\7\5\7"+
		"\65\n\7\3\b\6\b8\n\b\r\b\16\b9\3\t\3\t\3\t\2\2\n\2\4\6\b\n\f\16\20\2\2"+
		"\2@\2\25\3\2\2\2\4\37\3\2\2\2\6\"\3\2\2\2\b(\3\2\2\2\n.\3\2\2\2\f\62\3"+
		"\2\2\2\16\67\3\2\2\2\20;\3\2\2\2\22\24\5\4\3\2\23\22\3\2\2\2\24\27\3\2"+
		"\2\2\25\23\3\2\2\2\25\26\3\2\2\2\26\31\3\2\2\2\27\25\3\2\2\2\30\32\7\2"+
		"\2\3\31\30\3\2\2\2\31\32\3\2\2\2\32\3\3\2\2\2\33 \5\6\4\2\34 \5\b\5\2"+
		"\35 \5\f\7\2\36 \7\7\2\2\37\33\3\2\2\2\37\34\3\2\2\2\37\35\3\2\2\2\37"+
		"\36\3\2\2\2 \5\3\2\2\2!#\7\7\2\2\"!\3\2\2\2\"#\3\2\2\2#$\3\2\2\2$%\7\3"+
		"\2\2%&\5\n\6\2&\7\3\2\2\2\')\7\7\2\2(\'\3\2\2\2()\3\2\2\2)*\3\2\2\2*+"+
		"\5\n\6\2+\t\3\2\2\2,/\5\20\t\2-/\5\16\b\2.,\3\2\2\2.-\3\2\2\2/\60\3\2"+
		"\2\2\60.\3\2\2\2\60\61\3\2\2\2\61\13\3\2\2\2\62\64\7\6\2\2\63\65\7\7\2"+
		"\2\64\63\3\2\2\2\64\65\3\2\2\2\65\r\3\2\2\2\668\7\4\2\2\67\66\3\2\2\2"+
		"89\3\2\2\29\67\3\2\2\29:\3\2\2\2:\17\3\2\2\2;<\7\5\2\2<\21\3\2\2\2\13"+
		"\25\31\37\"(.\60\649";
	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);
		}
	}
}