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

de.undercouch.citeproc.bibtex.internal.InternalNameParser Maven / Gradle / Ivy

// Generated from /Users/mkraemer/code/citeproc-java/citeproc-java/citeproc-java/grammars/InternalName.g4 by ANTLR 4.12.0

package de.undercouch.citeproc.bibtex.internal;

import de.undercouch.citeproc.csl.CSLName;
import de.undercouch.citeproc.csl.CSLNameBuilder;
import org.apache.commons.lang3.StringUtils;

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", "CheckReturnValue"})
public class InternalNameParser extends Parser {
	static { RuntimeMetaData.checkVersion("4.12.0", RuntimeMetaData.VERSION); }

	protected static final DFA[] _decisionToDFA;
	protected static final PredictionContextCache _sharedContextCache =
		new PredictionContextCache();
	public static final int
		AND=1, SPACE=2, COMMA=3, UWORD=4, LWORD=5;
	public static final int
		RULE_names = 0, RULE_name = 1, RULE_uwords = 2, RULE_word = 3, RULE_words = 4, 
		RULE_von = 5, RULE_first = 6, RULE_last = 7;
	private static String[] makeRuleNames() {
		return new String[] {
			"names", "name", "uwords", "word", "words", "von", "first", "last"
		};
	}
	public static final String[] ruleNames = makeRuleNames();

	private static String[] makeLiteralNames() {
		return new String[] {
			null, "'and'", null, "','"
		};
	}
	private static final String[] _LITERAL_NAMES = makeLiteralNames();
	private static String[] makeSymbolicNames() {
		return new String[] {
			null, "AND", "SPACE", "COMMA", "UWORD", "LWORD"
		};
	}
	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] = "";
			}
		}
	}

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

	@Override

	public Vocabulary getVocabulary() {
		return VOCABULARY;
	}

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

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

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

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

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

	@SuppressWarnings("CheckReturnValue")
	public static class NamesContext extends ParserRuleContext {
		public List result = new ArrayList();;
		public NameContext name;
		public List name() {
			return getRuleContexts(NameContext.class);
		}
		public NameContext name(int i) {
			return getRuleContext(NameContext.class,i);
		}
		public List SPACE() { return getTokens(InternalNameParser.SPACE); }
		public TerminalNode SPACE(int i) {
			return getToken(InternalNameParser.SPACE, i);
		}
		public List AND() { return getTokens(InternalNameParser.AND); }
		public TerminalNode AND(int i) {
			return getToken(InternalNameParser.AND, i);
		}
		public NamesContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_names; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InternalNameListener ) ((InternalNameListener)listener).enterNames(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InternalNameListener ) ((InternalNameListener)listener).exitNames(this);
		}
	}

	public final NamesContext names() throws RecognitionException {
		NamesContext _localctx = new NamesContext(_ctx, getState());
		enterRule(_localctx, 0, RULE_names);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(16);
			((NamesContext)_localctx).name = name();
			 if (((NamesContext)_localctx).name.result != null) _localctx.result.add(((NamesContext)_localctx).name.result); 
			setState(26);
			_errHandler.sync(this);
			_la = _input.LA(1);
			while (_la==SPACE) {
				{
				{
				setState(18);
				match(SPACE);
				setState(19);
				match(AND);
				setState(20);
				match(SPACE);
				setState(21);
				((NamesContext)_localctx).name = name();
				 if (((NamesContext)_localctx).name.result != null) _localctx.result.add(((NamesContext)_localctx).name.result); 
				}
				}
				setState(28);
				_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;
	}

	@SuppressWarnings("CheckReturnValue")
	public static class NameContext extends ParserRuleContext {
		public CSLName result;
		public CSLNameBuilder builder = new CSLNameBuilder();;
		public UwordsContext uwords;
		public VonContext von;
		public LastContext last;
		public FirstContext first;
		public WordContext word;
		public UwordsContext uwords() {
			return getRuleContext(UwordsContext.class,0);
		}
		public List SPACE() { return getTokens(InternalNameParser.SPACE); }
		public TerminalNode SPACE(int i) {
			return getToken(InternalNameParser.SPACE, i);
		}
		public VonContext von() {
			return getRuleContext(VonContext.class,0);
		}
		public LastContext last() {
			return getRuleContext(LastContext.class,0);
		}
		public TerminalNode COMMA() { return getToken(InternalNameParser.COMMA, 0); }
		public FirstContext first() {
			return getRuleContext(FirstContext.class,0);
		}
		public WordContext word() {
			return getRuleContext(WordContext.class,0);
		}
		public NameContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_name; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InternalNameListener ) ((InternalNameListener)listener).enterName(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InternalNameListener ) ((InternalNameListener)listener).exitName(this);
		}
	}

	public final NameContext name() throws RecognitionException {
		NameContext _localctx = new NameContext(_ctx, getState());
		enterRule(_localctx, 2, RULE_name);
		int _la;
		try {
			setState(88);
			_errHandler.sync(this);
			switch ( getInterpreter().adaptivePredict(_input,7,_ctx) ) {
			case 1:
				enterOuterAlt(_localctx, 1);
				{
				setState(29);
				((NameContext)_localctx).uwords = uwords();
				setState(30);
				match(SPACE);
				setState(31);
				((NameContext)_localctx).von = von(0);
				setState(32);
				match(SPACE);
				setState(33);
				((NameContext)_localctx).last = last();
				setState(35);
				_errHandler.sync(this);
				_la = _input.LA(1);
				if (_la==SPACE) {
					{
					setState(34);
					match(SPACE);
					}
				}

				setState(37);
				match(COMMA);
				setState(39);
				_errHandler.sync(this);
				switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) {
				case 1:
					{
					setState(38);
					match(SPACE);
					}
					break;
				}
				setState(41);
				((NameContext)_localctx).first = first();
				 _localctx.builder.given(((NameContext)_localctx).first.result[1]).suffix(((NameContext)_localctx).first.result[0]).nonDroppingParticle((((NameContext)_localctx).uwords!=null?_input.getText(((NameContext)_localctx).uwords.start,((NameContext)_localctx).uwords.stop):null) + " " + (((NameContext)_localctx).von!=null?_input.getText(((NameContext)_localctx).von.start,((NameContext)_localctx).von.stop):null)).family((((NameContext)_localctx).last!=null?_input.getText(((NameContext)_localctx).last.start,((NameContext)_localctx).last.stop):null)); 
				}
				break;
			case 2:
				enterOuterAlt(_localctx, 2);
				{
				setState(44);
				((NameContext)_localctx).von = von(0);
				setState(45);
				match(SPACE);
				setState(46);
				((NameContext)_localctx).last = last();
				setState(48);
				_errHandler.sync(this);
				_la = _input.LA(1);
				if (_la==SPACE) {
					{
					setState(47);
					match(SPACE);
					}
				}

				setState(50);
				match(COMMA);
				setState(52);
				_errHandler.sync(this);
				switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) {
				case 1:
					{
					setState(51);
					match(SPACE);
					}
					break;
				}
				setState(54);
				((NameContext)_localctx).first = first();
				 _localctx.builder.given(((NameContext)_localctx).first.result[1]).suffix(((NameContext)_localctx).first.result[0]).nonDroppingParticle((((NameContext)_localctx).von!=null?_input.getText(((NameContext)_localctx).von.start,((NameContext)_localctx).von.stop):null)).family((((NameContext)_localctx).last!=null?_input.getText(((NameContext)_localctx).last.start,((NameContext)_localctx).last.stop):null)); 
				}
				break;
			case 3:
				enterOuterAlt(_localctx, 3);
				{
				setState(57);
				((NameContext)_localctx).last = last();
				setState(59);
				_errHandler.sync(this);
				_la = _input.LA(1);
				if (_la==SPACE) {
					{
					setState(58);
					match(SPACE);
					}
				}

				setState(61);
				match(COMMA);
				setState(63);
				_errHandler.sync(this);
				switch ( getInterpreter().adaptivePredict(_input,6,_ctx) ) {
				case 1:
					{
					setState(62);
					match(SPACE);
					}
					break;
				}
				setState(65);
				((NameContext)_localctx).first = first();

				      if ((((NameContext)_localctx).first!=null?_input.getText(((NameContext)_localctx).first.start,((NameContext)_localctx).first.stop):null).equals("Jr.")) {
				        Iterator l = ((NameContext)_localctx).last.result.iterator();
				        if (((NameContext)_localctx).last.result.size() == 1) {
				          _localctx.builder.suffix((((NameContext)_localctx).first!=null?_input.getText(((NameContext)_localctx).first.start,((NameContext)_localctx).first.stop):null)).family(StringUtils.join(l, " "));
				        } else {
				          _localctx.builder.given(l.next()).suffix((((NameContext)_localctx).first!=null?_input.getText(((NameContext)_localctx).first.start,((NameContext)_localctx).first.stop):null)).family(StringUtils.join(l, " "));
				        }
				      } else {
				        _localctx.builder.given(((NameContext)_localctx).first.result[1]).suffix(((NameContext)_localctx).first.result[0]).family((((NameContext)_localctx).last!=null?_input.getText(((NameContext)_localctx).last.start,((NameContext)_localctx).last.stop):null));
				      }
				    
				}
				break;
			case 4:
				enterOuterAlt(_localctx, 4);
				{
				setState(68);
				((NameContext)_localctx).von = von(0);
				setState(69);
				match(SPACE);
				setState(70);
				((NameContext)_localctx).last = last();
				 _localctx.builder.nonDroppingParticle((((NameContext)_localctx).von!=null?_input.getText(((NameContext)_localctx).von.start,((NameContext)_localctx).von.stop):null)).family((((NameContext)_localctx).last!=null?_input.getText(((NameContext)_localctx).last.start,((NameContext)_localctx).last.stop):null)); 
				}
				break;
			case 5:
				enterOuterAlt(_localctx, 5);
				{
				setState(73);
				((NameContext)_localctx).uwords = uwords();
				setState(74);
				match(SPACE);
				setState(75);
				((NameContext)_localctx).von = von(0);
				setState(76);
				match(SPACE);
				setState(77);
				((NameContext)_localctx).last = last();
				 _localctx.builder.given((((NameContext)_localctx).uwords!=null?_input.getText(((NameContext)_localctx).uwords.start,((NameContext)_localctx).uwords.stop):null)).nonDroppingParticle((((NameContext)_localctx).von!=null?_input.getText(((NameContext)_localctx).von.start,((NameContext)_localctx).von.stop):null)).family((((NameContext)_localctx).last!=null?_input.getText(((NameContext)_localctx).last.start,((NameContext)_localctx).last.stop):null)); 
				}
				break;
			case 6:
				enterOuterAlt(_localctx, 6);
				{
				setState(80);
				((NameContext)_localctx).uwords = uwords();
				setState(81);
				match(SPACE);
				setState(82);
				((NameContext)_localctx).word = word();
				 _localctx.builder.given((((NameContext)_localctx).uwords!=null?_input.getText(((NameContext)_localctx).uwords.start,((NameContext)_localctx).uwords.stop):null)).family((((NameContext)_localctx).word!=null?_input.getText(((NameContext)_localctx).word.start,((NameContext)_localctx).word.stop):null)); 
				}
				break;
			case 7:
				enterOuterAlt(_localctx, 7);
				{
				setState(85);
				((NameContext)_localctx).word = word();
				 _localctx.builder.family((((NameContext)_localctx).word!=null?_input.getText(((NameContext)_localctx).word.start,((NameContext)_localctx).word.stop):null)); 
				}
				break;
			}
			_ctx.stop = _input.LT(-1);

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

	@SuppressWarnings("CheckReturnValue")
	public static class UwordsContext extends ParserRuleContext {
		public List result;
		public Token w1;
		public Token w2;
		public List UWORD() { return getTokens(InternalNameParser.UWORD); }
		public TerminalNode UWORD(int i) {
			return getToken(InternalNameParser.UWORD, i);
		}
		public List SPACE() { return getTokens(InternalNameParser.SPACE); }
		public TerminalNode SPACE(int i) {
			return getToken(InternalNameParser.SPACE, i);
		}
		public UwordsContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_uwords; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InternalNameListener ) ((InternalNameListener)listener).enterUwords(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InternalNameListener ) ((InternalNameListener)listener).exitUwords(this);
		}
	}

	public final UwordsContext uwords() throws RecognitionException {
		UwordsContext _localctx = new UwordsContext(_ctx, getState());
		enterRule(_localctx, 4, RULE_uwords);

		    ((UwordsContext)_localctx).result =  new ArrayList();
		  
		try {
			int _alt;
			enterOuterAlt(_localctx, 1);
			{
			setState(90);
			((UwordsContext)_localctx).w1 = match(UWORD);
			 _localctx.result.add((((UwordsContext)_localctx).w1!=null?((UwordsContext)_localctx).w1.getText():null)); 
			setState(97);
			_errHandler.sync(this);
			_alt = getInterpreter().adaptivePredict(_input,8,_ctx);
			while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					{
					{
					setState(92);
					match(SPACE);
					setState(93);
					((UwordsContext)_localctx).w2 = match(UWORD);
					 _localctx.result.add((((UwordsContext)_localctx).w2!=null?((UwordsContext)_localctx).w2.getText():null)); 
					}
					} 
				}
				setState(99);
				_errHandler.sync(this);
				_alt = getInterpreter().adaptivePredict(_input,8,_ctx);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	@SuppressWarnings("CheckReturnValue")
	public static class WordContext extends ParserRuleContext {
		public TerminalNode UWORD() { return getToken(InternalNameParser.UWORD, 0); }
		public TerminalNode LWORD() { return getToken(InternalNameParser.LWORD, 0); }
		public WordContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_word; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InternalNameListener ) ((InternalNameListener)listener).enterWord(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InternalNameListener ) ((InternalNameListener)listener).exitWord(this);
		}
	}

	public final WordContext word() throws RecognitionException {
		WordContext _localctx = new WordContext(_ctx, getState());
		enterRule(_localctx, 6, RULE_word);
		int _la;
		try {
			enterOuterAlt(_localctx, 1);
			{
			setState(100);
			_la = _input.LA(1);
			if ( !(_la==UWORD || _la==LWORD) ) {
			_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;
	}

	@SuppressWarnings("CheckReturnValue")
	public static class WordsContext extends ParserRuleContext {
		public List word() {
			return getRuleContexts(WordContext.class);
		}
		public WordContext word(int i) {
			return getRuleContext(WordContext.class,i);
		}
		public List SPACE() { return getTokens(InternalNameParser.SPACE); }
		public TerminalNode SPACE(int i) {
			return getToken(InternalNameParser.SPACE, i);
		}
		public WordsContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_words; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InternalNameListener ) ((InternalNameListener)listener).enterWords(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InternalNameListener ) ((InternalNameListener)listener).exitWords(this);
		}
	}

	public final WordsContext words() throws RecognitionException {
		WordsContext _localctx = new WordsContext(_ctx, getState());
		enterRule(_localctx, 8, RULE_words);
		try {
			int _alt;
			enterOuterAlt(_localctx, 1);
			{
			setState(102);
			word();
			setState(107);
			_errHandler.sync(this);
			_alt = getInterpreter().adaptivePredict(_input,9,_ctx);
			while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					{
					{
					setState(103);
					match(SPACE);
					setState(104);
					word();
					}
					} 
				}
				setState(109);
				_errHandler.sync(this);
				_alt = getInterpreter().adaptivePredict(_input,9,_ctx);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	@SuppressWarnings("CheckReturnValue")
	public static class VonContext extends ParserRuleContext {
		public TerminalNode LWORD() { return getToken(InternalNameParser.LWORD, 0); }
		public VonContext von() {
			return getRuleContext(VonContext.class,0);
		}
		public List SPACE() { return getTokens(InternalNameParser.SPACE); }
		public TerminalNode SPACE(int i) {
			return getToken(InternalNameParser.SPACE, i);
		}
		public UwordsContext uwords() {
			return getRuleContext(UwordsContext.class,0);
		}
		public VonContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_von; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InternalNameListener ) ((InternalNameListener)listener).enterVon(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InternalNameListener ) ((InternalNameListener)listener).exitVon(this);
		}
	}

	public final VonContext von() throws RecognitionException {
		return von(0);
	}

	private VonContext von(int _p) throws RecognitionException {
		ParserRuleContext _parentctx = _ctx;
		int _parentState = getState();
		VonContext _localctx = new VonContext(_ctx, _parentState);
		VonContext _prevctx = _localctx;
		int _startState = 10;
		enterRecursionRule(_localctx, 10, RULE_von, _p);
		try {
			int _alt;
			enterOuterAlt(_localctx, 1);
			{
			{
			setState(111);
			match(LWORD);
			}
			_ctx.stop = _input.LT(-1);
			setState(124);
			_errHandler.sync(this);
			_alt = getInterpreter().adaptivePredict(_input,11,_ctx);
			while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
				if ( _alt==1 ) {
					if ( _parseListeners!=null ) triggerExitRuleEvent();
					_prevctx = _localctx;
					{
					setState(122);
					_errHandler.sync(this);
					switch ( getInterpreter().adaptivePredict(_input,10,_ctx) ) {
					case 1:
						{
						_localctx = new VonContext(_parentctx, _parentState);
						pushNewRecursionContext(_localctx, _startState, RULE_von);
						setState(113);
						if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
						setState(114);
						match(SPACE);
						setState(115);
						match(LWORD);
						}
						break;
					case 2:
						{
						_localctx = new VonContext(_parentctx, _parentState);
						pushNewRecursionContext(_localctx, _startState, RULE_von);
						setState(116);
						if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
						setState(117);
						match(SPACE);
						setState(118);
						uwords();
						setState(119);
						match(SPACE);
						setState(120);
						match(LWORD);
						}
						break;
					}
					} 
				}
				setState(126);
				_errHandler.sync(this);
				_alt = getInterpreter().adaptivePredict(_input,11,_ctx);
			}
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			unrollRecursionContexts(_parentctx);
		}
		return _localctx;
	}

	@SuppressWarnings("CheckReturnValue")
	public static class FirstContext extends ParserRuleContext {
		public String[] result;
		public WordsContext words;
		public WordsContext w1;
		public WordsContext w2;
		public List words() {
			return getRuleContexts(WordsContext.class);
		}
		public WordsContext words(int i) {
			return getRuleContext(WordsContext.class,i);
		}
		public TerminalNode COMMA() { return getToken(InternalNameParser.COMMA, 0); }
		public List SPACE() { return getTokens(InternalNameParser.SPACE); }
		public TerminalNode SPACE(int i) {
			return getToken(InternalNameParser.SPACE, i);
		}
		public FirstContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_first; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InternalNameListener ) ((InternalNameListener)listener).enterFirst(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InternalNameListener ) ((InternalNameListener)listener).exitFirst(this);
		}
	}

	public final FirstContext first() throws RecognitionException {
		FirstContext _localctx = new FirstContext(_ctx, getState());
		enterRule(_localctx, 12, RULE_first);

		    ((FirstContext)_localctx).result =  new String[2];
		  
		int _la;
		try {
			setState(145);
			_errHandler.sync(this);
			switch ( getInterpreter().adaptivePredict(_input,17,_ctx) ) {
			case 1:
				enterOuterAlt(_localctx, 1);
				{
				setState(128);
				_errHandler.sync(this);
				_la = _input.LA(1);
				if (_la==UWORD || _la==LWORD) {
					{
					setState(127);
					((FirstContext)_localctx).words = words();
					}
				}

				 _localctx.result[1] = (((FirstContext)_localctx).words!=null?_input.getText(((FirstContext)_localctx).words.start,((FirstContext)_localctx).words.stop):null); 
				}
				break;
			case 2:
				enterOuterAlt(_localctx, 2);
				{
				setState(132);
				_errHandler.sync(this);
				_la = _input.LA(1);
				if (_la==UWORD || _la==LWORD) {
					{
					setState(131);
					((FirstContext)_localctx).w1 = words();
					}
				}

				setState(135);
				_errHandler.sync(this);
				_la = _input.LA(1);
				if (_la==SPACE) {
					{
					setState(134);
					match(SPACE);
					}
				}

				setState(137);
				match(COMMA);
				setState(139);
				_errHandler.sync(this);
				switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) {
				case 1:
					{
					setState(138);
					match(SPACE);
					}
					break;
				}
				setState(142);
				_errHandler.sync(this);
				_la = _input.LA(1);
				if (_la==UWORD || _la==LWORD) {
					{
					setState(141);
					((FirstContext)_localctx).w2 = words();
					}
				}

				 _localctx.result[0] = (((FirstContext)_localctx).w1!=null?_input.getText(((FirstContext)_localctx).w1.start,((FirstContext)_localctx).w1.stop):null); _localctx.result[1] = (((FirstContext)_localctx).w2!=null?_input.getText(((FirstContext)_localctx).w2.start,((FirstContext)_localctx).w2.stop):null); 
				}
				break;
			}
		}
		catch (RecognitionException re) {
			_localctx.exception = re;
			_errHandler.reportError(this, re);
			_errHandler.recover(this, re);
		}
		finally {
			exitRule();
		}
		return _localctx;
	}

	@SuppressWarnings("CheckReturnValue")
	public static class LastContext extends ParserRuleContext {
		public List result;
		public Token LWORD;
		public UwordsContext uwords;
		public TerminalNode LWORD() { return getToken(InternalNameParser.LWORD, 0); }
		public UwordsContext uwords() {
			return getRuleContext(UwordsContext.class,0);
		}
		public LastContext(ParserRuleContext parent, int invokingState) {
			super(parent, invokingState);
		}
		@Override public int getRuleIndex() { return RULE_last; }
		@Override
		public void enterRule(ParseTreeListener listener) {
			if ( listener instanceof InternalNameListener ) ((InternalNameListener)listener).enterLast(this);
		}
		@Override
		public void exitRule(ParseTreeListener listener) {
			if ( listener instanceof InternalNameListener ) ((InternalNameListener)listener).exitLast(this);
		}
	}

	public final LastContext last() throws RecognitionException {
		LastContext _localctx = new LastContext(_ctx, getState());
		enterRule(_localctx, 14, RULE_last);

		    ((LastContext)_localctx).result =  new ArrayList();
		  
		try {
			setState(152);
			_errHandler.sync(this);
			switch (_input.LA(1)) {
			case LWORD:
				enterOuterAlt(_localctx, 1);
				{
				setState(147);
				((LastContext)_localctx).LWORD = match(LWORD);
				 _localctx.result.add((((LastContext)_localctx).LWORD!=null?((LastContext)_localctx).LWORD.getText():null)); 
				}
				break;
			case UWORD:
				enterOuterAlt(_localctx, 2);
				{
				setState(149);
				((LastContext)_localctx).uwords = uwords();
				 _localctx.result.addAll(((LastContext)_localctx).uwords.result); 
				}
				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 boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
		switch (ruleIndex) {
		case 5:
			return von_sempred((VonContext)_localctx, predIndex);
		}
		return true;
	}
	private boolean von_sempred(VonContext _localctx, int predIndex) {
		switch (predIndex) {
		case 0:
			return precpred(_ctx, 2);
		case 1:
			return precpred(_ctx, 1);
		}
		return true;
	}

	public static final String _serializedATN =
		"\u0004\u0001\u0005\u009b\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001"+
		"\u0002\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004"+
		"\u0002\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007"+
		"\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000"+
		"\u0001\u0000\u0001\u0000\u0005\u0000\u0019\b\u0000\n\u0000\f\u0000\u001c"+
		"\t\u0000\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001"+
		"\u0001\u0003\u0001$\b\u0001\u0001\u0001\u0001\u0001\u0003\u0001(\b\u0001"+
		"\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001"+
		"\u0001\u0001\u0003\u00011\b\u0001\u0001\u0001\u0001\u0001\u0003\u0001"+
		"5\b\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001"+
		"\u0003\u0001<\b\u0001\u0001\u0001\u0001\u0001\u0003\u0001@\b\u0001\u0001"+
		"\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001"+
		"\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001"+
		"\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001"+
		"\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0003\u0001Y\b"+
		"\u0001\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0005"+
		"\u0002`\b\u0002\n\u0002\f\u0002c\t\u0002\u0001\u0003\u0001\u0003\u0001"+
		"\u0004\u0001\u0004\u0001\u0004\u0005\u0004j\b\u0004\n\u0004\f\u0004m\t"+
		"\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001"+
		"\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001"+
		"\u0005\u0005\u0005{\b\u0005\n\u0005\f\u0005~\t\u0005\u0001\u0006\u0003"+
		"\u0006\u0081\b\u0006\u0001\u0006\u0001\u0006\u0003\u0006\u0085\b\u0006"+
		"\u0001\u0006\u0003\u0006\u0088\b\u0006\u0001\u0006\u0001\u0006\u0003\u0006"+
		"\u008c\b\u0006\u0001\u0006\u0003\u0006\u008f\b\u0006\u0001\u0006\u0003"+
		"\u0006\u0092\b\u0006\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001"+
		"\u0007\u0003\u0007\u0099\b\u0007\u0001\u0007\u0000\u0001\n\b\u0000\u0002"+
		"\u0004\u0006\b\n\f\u000e\u0000\u0001\u0001\u0000\u0004\u0005\u00aa\u0000"+
		"\u0010\u0001\u0000\u0000\u0000\u0002X\u0001\u0000\u0000\u0000\u0004Z\u0001"+
		"\u0000\u0000\u0000\u0006d\u0001\u0000\u0000\u0000\bf\u0001\u0000\u0000"+
		"\u0000\nn\u0001\u0000\u0000\u0000\f\u0091\u0001\u0000\u0000\u0000\u000e"+
		"\u0098\u0001\u0000\u0000\u0000\u0010\u0011\u0003\u0002\u0001\u0000\u0011"+
		"\u001a\u0006\u0000\uffff\uffff\u0000\u0012\u0013\u0005\u0002\u0000\u0000"+
		"\u0013\u0014\u0005\u0001\u0000\u0000\u0014\u0015\u0005\u0002\u0000\u0000"+
		"\u0015\u0016\u0003\u0002\u0001\u0000\u0016\u0017\u0006\u0000\uffff\uffff"+
		"\u0000\u0017\u0019\u0001\u0000\u0000\u0000\u0018\u0012\u0001\u0000\u0000"+
		"\u0000\u0019\u001c\u0001\u0000\u0000\u0000\u001a\u0018\u0001\u0000\u0000"+
		"\u0000\u001a\u001b\u0001\u0000\u0000\u0000\u001b\u0001\u0001\u0000\u0000"+
		"\u0000\u001c\u001a\u0001\u0000\u0000\u0000\u001d\u001e\u0003\u0004\u0002"+
		"\u0000\u001e\u001f\u0005\u0002\u0000\u0000\u001f \u0003\n\u0005\u0000"+
		" !\u0005\u0002\u0000\u0000!#\u0003\u000e\u0007\u0000\"$\u0005\u0002\u0000"+
		"\u0000#\"\u0001\u0000\u0000\u0000#$\u0001\u0000\u0000\u0000$%\u0001\u0000"+
		"\u0000\u0000%\'\u0005\u0003\u0000\u0000&(\u0005\u0002\u0000\u0000\'&\u0001"+
		"\u0000\u0000\u0000\'(\u0001\u0000\u0000\u0000()\u0001\u0000\u0000\u0000"+
		")*\u0003\f\u0006\u0000*+\u0006\u0001\uffff\uffff\u0000+Y\u0001\u0000\u0000"+
		"\u0000,-\u0003\n\u0005\u0000-.\u0005\u0002\u0000\u0000.0\u0003\u000e\u0007"+
		"\u0000/1\u0005\u0002\u0000\u00000/\u0001\u0000\u0000\u000001\u0001\u0000"+
		"\u0000\u000012\u0001\u0000\u0000\u000024\u0005\u0003\u0000\u000035\u0005"+
		"\u0002\u0000\u000043\u0001\u0000\u0000\u000045\u0001\u0000\u0000\u0000"+
		"56\u0001\u0000\u0000\u000067\u0003\f\u0006\u000078\u0006\u0001\uffff\uffff"+
		"\u00008Y\u0001\u0000\u0000\u00009;\u0003\u000e\u0007\u0000:<\u0005\u0002"+
		"\u0000\u0000;:\u0001\u0000\u0000\u0000;<\u0001\u0000\u0000\u0000<=\u0001"+
		"\u0000\u0000\u0000=?\u0005\u0003\u0000\u0000>@\u0005\u0002\u0000\u0000"+
		"?>\u0001\u0000\u0000\u0000?@\u0001\u0000\u0000\u0000@A\u0001\u0000\u0000"+
		"\u0000AB\u0003\f\u0006\u0000BC\u0006\u0001\uffff\uffff\u0000CY\u0001\u0000"+
		"\u0000\u0000DE\u0003\n\u0005\u0000EF\u0005\u0002\u0000\u0000FG\u0003\u000e"+
		"\u0007\u0000GH\u0006\u0001\uffff\uffff\u0000HY\u0001\u0000\u0000\u0000"+
		"IJ\u0003\u0004\u0002\u0000JK\u0005\u0002\u0000\u0000KL\u0003\n\u0005\u0000"+
		"LM\u0005\u0002\u0000\u0000MN\u0003\u000e\u0007\u0000NO\u0006\u0001\uffff"+
		"\uffff\u0000OY\u0001\u0000\u0000\u0000PQ\u0003\u0004\u0002\u0000QR\u0005"+
		"\u0002\u0000\u0000RS\u0003\u0006\u0003\u0000ST\u0006\u0001\uffff\uffff"+
		"\u0000TY\u0001\u0000\u0000\u0000UV\u0003\u0006\u0003\u0000VW\u0006\u0001"+
		"\uffff\uffff\u0000WY\u0001\u0000\u0000\u0000X\u001d\u0001\u0000\u0000"+
		"\u0000X,\u0001\u0000\u0000\u0000X9\u0001\u0000\u0000\u0000XD\u0001\u0000"+
		"\u0000\u0000XI\u0001\u0000\u0000\u0000XP\u0001\u0000\u0000\u0000XU\u0001"+
		"\u0000\u0000\u0000Y\u0003\u0001\u0000\u0000\u0000Z[\u0005\u0004\u0000"+
		"\u0000[a\u0006\u0002\uffff\uffff\u0000\\]\u0005\u0002\u0000\u0000]^\u0005"+
		"\u0004\u0000\u0000^`\u0006\u0002\uffff\uffff\u0000_\\\u0001\u0000\u0000"+
		"\u0000`c\u0001\u0000\u0000\u0000a_\u0001\u0000\u0000\u0000ab\u0001\u0000"+
		"\u0000\u0000b\u0005\u0001\u0000\u0000\u0000ca\u0001\u0000\u0000\u0000"+
		"de\u0007\u0000\u0000\u0000e\u0007\u0001\u0000\u0000\u0000fk\u0003\u0006"+
		"\u0003\u0000gh\u0005\u0002\u0000\u0000hj\u0003\u0006\u0003\u0000ig\u0001"+
		"\u0000\u0000\u0000jm\u0001\u0000\u0000\u0000ki\u0001\u0000\u0000\u0000"+
		"kl\u0001\u0000\u0000\u0000l\t\u0001\u0000\u0000\u0000mk\u0001\u0000\u0000"+
		"\u0000no\u0006\u0005\uffff\uffff\u0000op\u0005\u0005\u0000\u0000p|\u0001"+
		"\u0000\u0000\u0000qr\n\u0002\u0000\u0000rs\u0005\u0002\u0000\u0000s{\u0005"+
		"\u0005\u0000\u0000tu\n\u0001\u0000\u0000uv\u0005\u0002\u0000\u0000vw\u0003"+
		"\u0004\u0002\u0000wx\u0005\u0002\u0000\u0000xy\u0005\u0005\u0000\u0000"+
		"y{\u0001\u0000\u0000\u0000zq\u0001\u0000\u0000\u0000zt\u0001\u0000\u0000"+
		"\u0000{~\u0001\u0000\u0000\u0000|z\u0001\u0000\u0000\u0000|}\u0001\u0000"+
		"\u0000\u0000}\u000b\u0001\u0000\u0000\u0000~|\u0001\u0000\u0000\u0000"+
		"\u007f\u0081\u0003\b\u0004\u0000\u0080\u007f\u0001\u0000\u0000\u0000\u0080"+
		"\u0081\u0001\u0000\u0000\u0000\u0081\u0082\u0001\u0000\u0000\u0000\u0082"+
		"\u0092\u0006\u0006\uffff\uffff\u0000\u0083\u0085\u0003\b\u0004\u0000\u0084"+
		"\u0083\u0001\u0000\u0000\u0000\u0084\u0085\u0001\u0000\u0000\u0000\u0085"+
		"\u0087\u0001\u0000\u0000\u0000\u0086\u0088\u0005\u0002\u0000\u0000\u0087"+
		"\u0086\u0001\u0000\u0000\u0000\u0087\u0088\u0001\u0000\u0000\u0000\u0088"+
		"\u0089\u0001\u0000\u0000\u0000\u0089\u008b\u0005\u0003\u0000\u0000\u008a"+
		"\u008c\u0005\u0002\u0000\u0000\u008b\u008a\u0001\u0000\u0000\u0000\u008b"+
		"\u008c\u0001\u0000\u0000\u0000\u008c\u008e\u0001\u0000\u0000\u0000\u008d"+
		"\u008f\u0003\b\u0004\u0000\u008e\u008d\u0001\u0000\u0000\u0000\u008e\u008f"+
		"\u0001\u0000\u0000\u0000\u008f\u0090\u0001\u0000\u0000\u0000\u0090\u0092"+
		"\u0006\u0006\uffff\uffff\u0000\u0091\u0080\u0001\u0000\u0000\u0000\u0091"+
		"\u0084\u0001\u0000\u0000\u0000\u0092\r\u0001\u0000\u0000\u0000\u0093\u0094"+
		"\u0005\u0005\u0000\u0000\u0094\u0099\u0006\u0007\uffff\uffff\u0000\u0095"+
		"\u0096\u0003\u0004\u0002\u0000\u0096\u0097\u0006\u0007\uffff\uffff\u0000"+
		"\u0097\u0099\u0001\u0000\u0000\u0000\u0098\u0093\u0001\u0000\u0000\u0000"+
		"\u0098\u0095\u0001\u0000\u0000\u0000\u0099\u000f\u0001\u0000\u0000\u0000"+
		"\u0013\u001a#\'04;?Xakz|\u0080\u0084\u0087\u008b\u008e\u0091\u0098";
	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 - 2024 Weber Informatics LLC | Privacy Policy