package org.stringtemplate.v4.compiler;
import java.util.Collections;
import java.util.Map;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.ArrayList;
import org.stringtemplate.v4.misc.*;
import org.stringtemplate.v4.*;
import java.io.File;
import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
@SuppressWarnings("all")
public class GroupParser extends Parser {
public static final String[] tokenNames = new String[] {
"<invalid>", "<EOR>", "<DOWN>", "<UP>", "ANONYMOUS_TEMPLATE", "BIGSTRING",
"BIGSTRING_NO_NL", "COMMENT", "FALSE", "ID", "LBRACK", "LINE_COMMENT",
"RBRACK", "STRING", "TRUE", "WS", "'('", "')'", "','", "'.'", "':'", "'::='",
"';'", "'='", "'@'", "'default'", "'delimiters'", "'group'", "'implements'",
"'import'"
};
public static final int EOF=-1;
public static final int T__16=16;
public static final int T__17=17;
public static final int T__18=18;
public static final int T__19=19;
public static final int T__20=20;
public static final int T__21=21;
public static final int T__22=22;
public static final int T__23=23;
public static final int T__24=24;
public static final int T__25=25;
public static final int T__26=26;
public static final int T__27=27;
public static final int T__28=28;
public static final int T__29=29;
public static final int ANONYMOUS_TEMPLATE=4;
public static final int BIGSTRING=5;
public static final int BIGSTRING_NO_NL=6;
public static final int =7;
public static final int FALSE=8;
public static final int ID=9;
public static final int LBRACK=10;
public static final int =11;
public static final int RBRACK=12;
public static final int STRING=13;
public static final int TRUE=14;
public static final int WS=15;
public Parser[] getDelegates() {
return new Parser[] {};
}
public GroupParser(TokenStream input) {
this(input, new RecognizerSharedState());
}
public GroupParser(TokenStream input, RecognizerSharedState state) {
super(input, state);
}
@Override public String[] getTokenNames() { return GroupParser.tokenNames; }
@Override public String getGrammarFileName() { return "org/stringtemplate/v4/compiler/Group.g"; }
public STGroup group;
@Override
public void displayRecognitionError(String[] tokenNames,
RecognitionException e)
{
String msg = getErrorMessage(e, tokenNames);
group.errMgr.groupSyntaxError(ErrorType.SYNTAX_ERROR, getSourceName(), e, msg);
}
@Override
public String getSourceName() {
String fullFileName = super.getSourceName();
File f = new File(fullFileName);
return f.getName();
}
public void error(String msg) {
NoViableAltException e = new NoViableAltException("", 0, 0, input);
group.errMgr.groupSyntaxError(ErrorType.SYNTAX_ERROR, getSourceName(), e, msg);
recover(input, null);
}
public void addArgument(List<FormalArgument> args, Token t, Token defaultValueToken) {
String name = t.getText();
for (FormalArgument arg : args) {
if (arg.name.equals(name)) {
group.errMgr.compileTimeError(ErrorType.PARAMETER_REDEFINITION, null, t, name);
return;
}
}
args.add(new FormalArgument(name, defaultValueToken));
}
public final void group(STGroup group, String prefix) throws RecognitionException {
Token STRING1=null;
GroupLexer lexer = (GroupLexer)input.getTokenSource();
this.group = lexer.group = group;
try {
{
int alt1=2;
int LA1_0 = input.LA(1);
if ( (LA1_0==27) ) {
alt1=1;
}
switch (alt1) {
case 1 :
{
pushFollow(FOLLOW_oldStyleHeader_in_group86);
oldStyleHeader();
state._fsp--;
}
break;
}
int alt2=2;
int LA2_0 = input.LA(1);
if ( (LA2_0==26) ) {
alt2=1;
}
switch (alt2) {
case 1 :
{
pushFollow(FOLLOW_delimiters_in_group91);
delimiters();
state._fsp--;
}
break;
}
loop4:
while (true) {
int alt4=3;
int LA4_0 = input.LA(1);
if ( (LA4_0==29) ) {
int LA4_2 = input.LA(2);
if ( (LA4_2==STRING) ) {
alt4=1;
}
else if ( (LA4_2==ID) ) {
alt4=2;
}
}
switch (alt4) {
case 1 :
{
match(input,29,FOLLOW_29_in_group101);
STRING1=(Token)match(input,STRING,FOLLOW_STRING_in_group103);
group.importTemplates(STRING1);
}
break;
case 2 :
{
match(input,29,FOLLOW_29_in_group111);
MismatchedTokenException e = new MismatchedTokenException(STRING, input);
reportError(e);
match(input,ID,FOLLOW_ID_in_group122);
loop3:
while (true) {
int alt3=2;
int LA3_0 = input.LA(1);
if ( (LA3_0==19) ) {
alt3=1;
}
switch (alt3) {
case 1 :
{
match(input,19,FOLLOW_19_in_group125);
match(input,ID,FOLLOW_ID_in_group127);
}
break;
default :
break loop3;
}
}
}
break;
default :
break loop4;
}
}
loop5:
while (true) {
int alt5=2;
int LA5_0 = input.LA(1);
if ( (LA5_0==ID||LA5_0==24) ) {
alt5=1;
}
switch (alt5) {
case 1 :
{
pushFollow(FOLLOW_def_in_group139);
def(prefix);
state._fsp--;
}
break;
default :
break loop5;
}
}
match(input,EOF,FOLLOW_EOF_in_group145);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void () throws RecognitionException {
try {
{
match(input,27,FOLLOW_27_in_oldStyleHeader162);
match(input,ID,FOLLOW_ID_in_oldStyleHeader164);
int alt6=2;
int LA6_0 = input.LA(1);
if ( (LA6_0==20) ) {
alt6=1;
}
switch (alt6) {
case 1 :
{
match(input,20,FOLLOW_20_in_oldStyleHeader168);
match(input,ID,FOLLOW_ID_in_oldStyleHeader170);
}
break;
}
int alt8=2;
int LA8_0 = input.LA(1);
if ( (LA8_0==28) ) {
alt8=1;
}
switch (alt8) {
case 1 :
{
match(input,28,FOLLOW_28_in_oldStyleHeader182);
match(input,ID,FOLLOW_ID_in_oldStyleHeader184);
loop7:
while (true) {
int alt7=2;
int LA7_0 = input.LA(1);
if ( (LA7_0==18) ) {
alt7=1;
}
switch (alt7) {
case 1 :
{
match(input,18,FOLLOW_18_in_oldStyleHeader187);
match(input,ID,FOLLOW_ID_in_oldStyleHeader189);
}
break;
default :
break loop7;
}
}
}
break;
}
match(input,22,FOLLOW_22_in_oldStyleHeader201);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final String groupName() throws RecognitionException {
String name = null;
Token a=null;
StringBuilder buf = new StringBuilder();
try {
{
a=(Token)match(input,ID,FOLLOW_ID_in_groupName223);
buf.append((a!=null?a.getText():null));
loop9:
while (true) {
int alt9=2;
int LA9_0 = input.LA(1);
if ( (LA9_0==19) ) {
alt9=1;
}
switch (alt9) {
case 1 :
{
match(input,19,FOLLOW_19_in_groupName228);
a=(Token)match(input,ID,FOLLOW_ID_in_groupName232);
buf.append((a!=null?a.getText():null));
}
break;
default :
break loop9;
}
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return name;
}
public final void delimiters() throws RecognitionException {
Token a=null;
Token b=null;
try {
{
match(input,26,FOLLOW_26_in_delimiters250);
a=(Token)match(input,STRING,FOLLOW_STRING_in_delimiters254);
match(input,18,FOLLOW_18_in_delimiters256);
b=(Token)match(input,STRING,FOLLOW_STRING_in_delimiters260);
boolean supported = true;
char startCharacter = a.getText().charAt(1);
if (STGroup.isReservedCharacter(startCharacter)) {
group.errMgr.compileTimeError(ErrorType.UNSUPPORTED_DELIMITER, null, a, String.valueOf(startCharacter));
supported = false;
}
char stopCharacter = b.getText().charAt(1);
if (STGroup.isReservedCharacter(stopCharacter)) {
group.errMgr.compileTimeError(ErrorType.UNSUPPORTED_DELIMITER, null, b, String.valueOf(stopCharacter));
supported = false;
}
if (supported) {
group.delimiterStartChar=a.getText().charAt(1);
group.delimiterStopChar=b.getText().charAt(1);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void def(String prefix) throws RecognitionException {
try {
int alt10=2;
int LA10_0 = input.LA(1);
if ( (LA10_0==24) ) {
alt10=1;
}
else if ( (LA10_0==ID) ) {
int LA10_2 = input.LA(2);
if ( (LA10_2==16) ) {
alt10=1;
}
else if ( (LA10_2==21) ) {
int LA10_3 = input.LA(3);
if ( (LA10_3==ID) ) {
alt10=1;
}
else if ( (LA10_3==LBRACK) ) {
alt10=2;
}
else {
int nvaeMark = input.mark();
try {
for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) {
input.consume();
}
NoViableAltException nvae =
new NoViableAltException("", 10, 3, input);
throw nvae;
} finally {
input.rewind(nvaeMark);
}
}
}
else {
int nvaeMark = input.mark();
try {
input.consume();
NoViableAltException nvae =
new NoViableAltException("", 10, 2, input);
throw nvae;
} finally {
input.rewind(nvaeMark);
}
}
}
else {
NoViableAltException nvae =
new NoViableAltException("", 10, 0, input);
throw nvae;
}
switch (alt10) {
case 1 :
{
pushFollow(FOLLOW_templateDef_in_def284);
templateDef(prefix);
state._fsp--;
}
break;
case 2 :
{
pushFollow(FOLLOW_dictDef_in_def289);
dictDef();
state._fsp--;
}
break;
}
}
catch (RecognitionException re) {
state.lastErrorIndex = input.index();
error("garbled template definition starting at '"+input.LT(1).getText()+"'");
}
finally {
}
}
public final void templateDef(String prefix) throws RecognitionException {
Token enclosing=null;
Token name=null;
Token alias=null;
Token target=null;
Token STRING2=null;
Token BIGSTRING3=null;
Token BIGSTRING_NO_NL4=null;
List<FormalArgument> formalArgs5 =null;
String template=null;
int n=0;
try {
int alt13=2;
int LA13_0 = input.LA(1);
if ( (LA13_0==24) ) {
alt13=1;
}
else if ( (LA13_0==ID) ) {
int LA13_2 = input.LA(2);
if ( (LA13_2==16) ) {
alt13=1;
}
else if ( (LA13_2==21) ) {
alt13=2;
}
else {
int nvaeMark = input.mark();
try {
input.consume();
NoViableAltException nvae =
new NoViableAltException("", 13, 2, input);
throw nvae;
} finally {
input.rewind(nvaeMark);
}
}
}
else {
NoViableAltException nvae =
new NoViableAltException("", 13, 0, input);
throw nvae;
}
switch (alt13) {
case 1 :
{
int alt11=2;
int LA11_0 = input.LA(1);
if ( (LA11_0==24) ) {
alt11=1;
}
else if ( (LA11_0==ID) ) {
alt11=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 11, 0, input);
throw nvae;
}
switch (alt11) {
case 1 :
{
match(input,24,FOLLOW_24_in_templateDef313);
enclosing=(Token)match(input,ID,FOLLOW_ID_in_templateDef317);
match(input,19,FOLLOW_19_in_templateDef319);
name=(Token)match(input,ID,FOLLOW_ID_in_templateDef323);
match(input,16,FOLLOW_16_in_templateDef325);
match(input,17,FOLLOW_17_in_templateDef327);
}
break;
case 2 :
{
name=(Token)match(input,ID,FOLLOW_ID_in_templateDef335);
match(input,16,FOLLOW_16_in_templateDef337);
pushFollow(FOLLOW_formalArgs_in_templateDef339);
formalArgs5=formalArgs();
state._fsp--;
match(input,17,FOLLOW_17_in_templateDef341);
}
break;
}
match(input,21,FOLLOW_21_in_templateDef352);
Token templateToken = input.LT(1);
int alt12=4;
switch ( input.LA(1) ) {
case STRING:
{
alt12=1;
}
break;
case BIGSTRING:
{
alt12=2;
}
break;
case BIGSTRING_NO_NL:
{
alt12=3;
}
break;
case EOF:
case ID:
case 24:
{
alt12=4;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 12, 0, input);
throw nvae;
}
switch (alt12) {
case 1 :
{
STRING2=(Token)match(input,STRING,FOLLOW_STRING_in_templateDef368);
template=(STRING2!=null?STRING2.getText():null); n=1;
}
break;
case 2 :
{
BIGSTRING3=(Token)match(input,BIGSTRING,FOLLOW_BIGSTRING_in_templateDef383);
template=(BIGSTRING3!=null?BIGSTRING3.getText():null); n=2;
}
break;
case 3 :
{
BIGSTRING_NO_NL4=(Token)match(input,BIGSTRING_NO_NL,FOLLOW_BIGSTRING_NO_NL_in_templateDef395);
template=(BIGSTRING_NO_NL4!=null?BIGSTRING_NO_NL4.getText():null); n=2;
}
break;
case 4 :
{
template = "";
String msg = "missing template at '"+input.LT(1).getText()+"'";
NoViableAltException e = new NoViableAltException("", 0, 0, input);
group.errMgr.groupSyntaxError(ErrorType.SYNTAX_ERROR, getSourceName(), e, msg);
}
break;
}
if ( (name!=null?name.getTokenIndex():0) >= 0 ) {
template = Misc.strip(template, n);
String templateName = (name!=null?name.getText():null);
if ( prefix.length()>0 ) templateName = prefix+(name!=null?name.getText():null);
String enclosingTemplateName = (enclosing!=null?enclosing.getText():null);
if (enclosingTemplateName != null && enclosingTemplateName.length()>0 && prefix.length()>0) {
enclosingTemplateName = prefix + enclosingTemplateName;
}
group.defineTemplateOrRegion(templateName, enclosingTemplateName, templateToken,
template, name, formalArgs5);
}
}
break;
case 2 :
{
alias=(Token)match(input,ID,FOLLOW_ID_in_templateDef430);
match(input,21,FOLLOW_21_in_templateDef432);
target=(Token)match(input,ID,FOLLOW_ID_in_templateDef436);
group.defineTemplateAlias(alias, target);
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
protected static class formalArgs_scope {
boolean hasOptionalParameter;
}
protected Stack<formalArgs_scope> formalArgs_stack = new Stack<formalArgs_scope>();
public final List<FormalArgument> formalArgs() throws RecognitionException {
formalArgs_stack.push(new formalArgs_scope());
List<FormalArgument> args = new ArrayList<FormalArgument>();
formalArgs_stack.peek().hasOptionalParameter = false;
try {
int alt15=2;
int LA15_0 = input.LA(1);
if ( (LA15_0==ID) ) {
alt15=1;
}
else if ( (LA15_0==17) ) {
alt15=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 15, 0, input);
throw nvae;
}
switch (alt15) {
case 1 :
{
pushFollow(FOLLOW_formalArg_in_formalArgs462);
formalArg(args);
state._fsp--;
loop14:
while (true) {
int alt14=2;
int LA14_0 = input.LA(1);
if ( (LA14_0==18) ) {
alt14=1;
}
switch (alt14) {
case 1 :
{
match(input,18,FOLLOW_18_in_formalArgs466);
pushFollow(FOLLOW_formalArg_in_formalArgs468);
formalArg(args);
state._fsp--;
}
break;
default :
break loop14;
}
}
}
break;
case 2 :
{
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
formalArgs_stack.pop();
}
return args;
}
public final void formalArg(List<FormalArgument> args) throws RecognitionException {
Token a=null;
Token ID6=null;
try {
{
ID6=(Token)match(input,ID,FOLLOW_ID_in_formalArg486);
int alt16=3;
int LA16_0 = input.LA(1);
if ( (LA16_0==23) ) {
int LA16_1 = input.LA(2);
if ( (LA16_1==ANONYMOUS_TEMPLATE||LA16_1==FALSE||(LA16_1 >= STRING && LA16_1 <= TRUE)) ) {
alt16=1;
}
else if ( (LA16_1==LBRACK) ) {
alt16=2;
}
else {
int nvaeMark = input.mark();
try {
input.consume();
NoViableAltException nvae =
new NoViableAltException("", 16, 1, input);
throw nvae;
} finally {
input.rewind(nvaeMark);
}
}
}
else if ( ((LA16_0 >= 17 && LA16_0 <= 18)) ) {
alt16=3;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 16, 0, input);
throw nvae;
}
switch (alt16) {
case 1 :
{
match(input,23,FOLLOW_23_in_formalArg492);
a=input.LT(1);
if ( input.LA(1)==ANONYMOUS_TEMPLATE||input.LA(1)==FALSE||(input.LA(1) >= STRING && input.LA(1) <= TRUE) ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
formalArgs_stack.peek().hasOptionalParameter = true;
}
break;
case 2 :
{
match(input,23,FOLLOW_23_in_formalArg512);
a=(Token)match(input,LBRACK,FOLLOW_LBRACK_in_formalArg516);
match(input,RBRACK,FOLLOW_RBRACK_in_formalArg518);
formalArgs_stack.peek().hasOptionalParameter = true;
}
break;
case 3 :
{
if (formalArgs_stack.peek().hasOptionalParameter) {
group.errMgr.compileTimeError(ErrorType.REQUIRED_PARAMETER_AFTER_OPTIONAL,
null, ID6);
}
}
break;
}
addArgument(args, ID6, a);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void dictDef() throws RecognitionException {
Token ID7=null;
Map<String,Object> dict8 =null;
try {
{
ID7=(Token)match(input,ID,FOLLOW_ID_in_dictDef551);
match(input,21,FOLLOW_21_in_dictDef553);
pushFollow(FOLLOW_dict_in_dictDef555);
dict8=dict();
state._fsp--;
if ( group.rawGetDictionary((ID7!=null?ID7.getText():null))!=null ) {
group.errMgr.compileTimeError(ErrorType.MAP_REDEFINITION, null, ID7);
}
else if ( group.rawGetTemplate((ID7!=null?ID7.getText():null))!=null ) {
group.errMgr.compileTimeError(ErrorType.TEMPLATE_REDEFINITION_AS_MAP, null, ID7);
}
else {
group.defineDictionary((ID7!=null?ID7.getText():null), dict8);
}
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final Map<String,Object> dict() throws RecognitionException {
Map<String,Object> mapping = null;
mapping=new LinkedHashMap<String,Object>();
try {
{
match(input,LBRACK,FOLLOW_LBRACK_in_dict587);
pushFollow(FOLLOW_dictPairs_in_dict589);
dictPairs(mapping);
state._fsp--;
match(input,RBRACK,FOLLOW_RBRACK_in_dict592);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return mapping;
}
public final void dictPairs(Map<String,Object> mapping) throws RecognitionException {
try {
int alt19=2;
int LA19_0 = input.LA(1);
if ( (LA19_0==STRING) ) {
alt19=1;
}
else if ( (LA19_0==25) ) {
alt19=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 19, 0, input);
throw nvae;
}
switch (alt19) {
case 1 :
{
pushFollow(FOLLOW_keyValuePair_in_dictPairs607);
keyValuePair(mapping);
state._fsp--;
loop17:
while (true) {
int alt17=2;
int LA17_0 = input.LA(1);
if ( (LA17_0==18) ) {
int LA17_1 = input.LA(2);
if ( (LA17_1==STRING) ) {
alt17=1;
}
}
switch (alt17) {
case 1 :
{
match(input,18,FOLLOW_18_in_dictPairs616);
pushFollow(FOLLOW_keyValuePair_in_dictPairs618);
keyValuePair(mapping);
state._fsp--;
}
break;
default :
break loop17;
}
}
int alt18=2;
int LA18_0 = input.LA(1);
if ( (LA18_0==18) ) {
alt18=1;
}
switch (alt18) {
case 1 :
{
match(input,18,FOLLOW_18_in_dictPairs624);
pushFollow(FOLLOW_defaultValuePair_in_dictPairs626);
defaultValuePair(mapping);
state._fsp--;
}
break;
}
}
break;
case 2 :
{
pushFollow(FOLLOW_defaultValuePair_in_dictPairs637);
defaultValuePair(mapping);
state._fsp--;
}
break;
}
}
catch (RecognitionException re) {
error("missing dictionary entry at '"+input.LT(1).getText()+"'");
}
finally {
}
}
public final void defaultValuePair(Map<String,Object> mapping) throws RecognitionException {
Object keyValue9 =null;
try {
{
match(input,25,FOLLOW_25_in_defaultValuePair660);
match(input,20,FOLLOW_20_in_defaultValuePair662);
pushFollow(FOLLOW_keyValue_in_defaultValuePair664);
keyValue9=keyValue();
state._fsp--;
mapping.put(STGroup.DEFAULT_KEY, keyValue9);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final void keyValuePair(Map<String,Object> mapping) throws RecognitionException {
Token STRING10=null;
Object keyValue11 =null;
try {
{
STRING10=(Token)match(input,STRING,FOLLOW_STRING_in_keyValuePair678);
match(input,20,FOLLOW_20_in_keyValuePair680);
pushFollow(FOLLOW_keyValue_in_keyValuePair682);
keyValue11=keyValue();
state._fsp--;
mapping.put(Misc.replaceEscapes(Misc.strip((STRING10!=null?STRING10.getText():null), 1)), keyValue11);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
}
public final Object keyValue() throws RecognitionException {
Object value = null;
Token BIGSTRING12=null;
Token BIGSTRING_NO_NL13=null;
Token ANONYMOUS_TEMPLATE14=null;
Token STRING15=null;
try {
int alt20=8;
int LA20_0 = input.LA(1);
if ( (LA20_0==BIGSTRING) ) {
alt20=1;
}
else if ( (LA20_0==BIGSTRING_NO_NL) ) {
alt20=2;
}
else if ( (LA20_0==ANONYMOUS_TEMPLATE) ) {
alt20=3;
}
else if ( (LA20_0==STRING) ) {
alt20=4;
}
else if ( (LA20_0==TRUE) ) {
alt20=5;
}
else if ( (LA20_0==FALSE) ) {
alt20=6;
}
else if ( (LA20_0==LBRACK) ) {
alt20=7;
}
else if ( (LA20_0==ID) && ((input.LT(1).getText().equals("key")))) {
alt20=8;
}
switch (alt20) {
case 1 :
{
BIGSTRING12=(Token)match(input,BIGSTRING,FOLLOW_BIGSTRING_in_keyValue699);
value = group.createSingleton(BIGSTRING12);
}
break;
case 2 :
{
BIGSTRING_NO_NL13=(Token)match(input,BIGSTRING_NO_NL,FOLLOW_BIGSTRING_NO_NL_in_keyValue708);
value = group.createSingleton(BIGSTRING_NO_NL13);
}
break;
case 3 :
{
ANONYMOUS_TEMPLATE14=(Token)match(input,ANONYMOUS_TEMPLATE,FOLLOW_ANONYMOUS_TEMPLATE_in_keyValue716);
value = group.createSingleton(ANONYMOUS_TEMPLATE14);
}
break;
case 4 :
{
STRING15=(Token)match(input,STRING,FOLLOW_STRING_in_keyValue723);
value = Misc.replaceEscapes(Misc.strip((STRING15!=null?STRING15.getText():null), 1));
}
break;
case 5 :
{
match(input,TRUE,FOLLOW_TRUE_in_keyValue733);
value = true;
}
break;
case 6 :
{
match(input,FALSE,FOLLOW_FALSE_in_keyValue743);
value = false;
}
break;
case 7 :
{
match(input,LBRACK,FOLLOW_LBRACK_in_keyValue753);
match(input,RBRACK,FOLLOW_RBRACK_in_keyValue755);
value = Collections.emptyList();
}
break;
case 8 :
{
if ( !((input.LT(1).getText().equals("key"))) ) {
throw new FailedPredicateException(input, "keyValue", "input.LT(1).getText().equals(\"key\")");
}
match(input,ID,FOLLOW_ID_in_keyValue768);
value = STGroup.DICT_KEY;
}
break;
}
}
catch (RecognitionException re) {
error("missing value for key at '"+input.LT(1).getText()+"'");
}
finally {
}
return value;
}
public static final BitSet = new BitSet(new long[]{0x0000000025000200L});
public static final BitSet FOLLOW_delimiters_in_group91 = new BitSet(new long[]{0x0000000021000200L});
public static final BitSet FOLLOW_29_in_group101 = new BitSet(new long[]{0x0000000000002000L});
public static final BitSet FOLLOW_STRING_in_group103 = new BitSet(new long[]{0x0000000021000200L});
public static final BitSet FOLLOW_29_in_group111 = new BitSet(new long[]{0x0000000000000200L});
public static final BitSet FOLLOW_ID_in_group122 = new BitSet(new long[]{0x0000000021080200L});
public static final BitSet FOLLOW_19_in_group125 = new BitSet(new long[]{0x0000000000000200L});
public static final BitSet FOLLOW_ID_in_group127 = new BitSet(new long[]{0x0000000021080200L});
public static final BitSet FOLLOW_def_in_group139 = new BitSet(new long[]{0x0000000001000200L});
public static final BitSet FOLLOW_EOF_in_group145 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet = new BitSet(new long[]{0x0000000000000200L});
public static final BitSet = new BitSet(new long[]{0x0000000010500000L});
public static final BitSet = new BitSet(new long[]{0x0000000000000200L});
public static final BitSet = new BitSet(new long[]{0x0000000010400000L});
public static final BitSet = new BitSet(new long[]{0x0000000000000200L});
public static final BitSet = new BitSet(new long[]{0x0000000000440000L});
public static final BitSet = new BitSet(new long[]{0x0000000000000200L});
public static final BitSet = new BitSet(new long[]{0x0000000000440000L});
public static final BitSet = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ID_in_groupName223 = new BitSet(new long[]{0x0000000000080002L});
public static final BitSet FOLLOW_19_in_groupName228 = new BitSet(new long[]{0x0000000000000200L});
public static final BitSet FOLLOW_ID_in_groupName232 = new BitSet(new long[]{0x0000000000080002L});
public static final BitSet FOLLOW_26_in_delimiters250 = new BitSet(new long[]{0x0000000000002000L});
public static final BitSet FOLLOW_STRING_in_delimiters254 = new BitSet(new long[]{0x0000000000040000L});
public static final BitSet FOLLOW_18_in_delimiters256 = new BitSet(new long[]{0x0000000000002000L});
public static final BitSet FOLLOW_STRING_in_delimiters260 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_templateDef_in_def284 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_dictDef_in_def289 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_24_in_templateDef313 = new BitSet(new long[]{0x0000000000000200L});
public static final BitSet FOLLOW_ID_in_templateDef317 = new BitSet(new long[]{0x0000000000080000L});
public static final BitSet FOLLOW_19_in_templateDef319 = new BitSet(new long[]{0x0000000000000200L});
public static final BitSet FOLLOW_ID_in_templateDef323 = new BitSet(new long[]{0x0000000000010000L});
public static final BitSet FOLLOW_16_in_templateDef325 = new BitSet(new long[]{0x0000000000020000L});
public static final BitSet FOLLOW_17_in_templateDef327 = new BitSet(new long[]{0x0000000000200000L});
public static final BitSet FOLLOW_ID_in_templateDef335 = new BitSet(new long[]{0x0000000000010000L});
public static final BitSet FOLLOW_16_in_templateDef337 = new BitSet(new long[]{0x0000000000020200L});
public static final BitSet FOLLOW_formalArgs_in_templateDef339 = new BitSet(new long[]{0x0000000000020000L});
public static final BitSet FOLLOW_17_in_templateDef341 = new BitSet(new long[]{0x0000000000200000L});
public static final BitSet FOLLOW_21_in_templateDef352 = new BitSet(new long[]{0x0000000000002062L});
public static final BitSet FOLLOW_STRING_in_templateDef368 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_BIGSTRING_in_templateDef383 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_BIGSTRING_NO_NL_in_templateDef395 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ID_in_templateDef430 = new BitSet(new long[]{0x0000000000200000L});
public static final BitSet FOLLOW_21_in_templateDef432 = new BitSet(new long[]{0x0000000000000200L});
public static final BitSet FOLLOW_ID_in_templateDef436 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_formalArg_in_formalArgs462 = new BitSet(new long[]{0x0000000000040002L});
public static final BitSet FOLLOW_18_in_formalArgs466 = new BitSet(new long[]{0x0000000000000200L});
public static final BitSet FOLLOW_formalArg_in_formalArgs468 = new BitSet(new long[]{0x0000000000040002L});
public static final BitSet FOLLOW_ID_in_formalArg486 = new BitSet(new long[]{0x0000000000800002L});
public static final BitSet FOLLOW_23_in_formalArg492 = new BitSet(new long[]{0x0000000000006110L});
public static final BitSet FOLLOW_set_in_formalArg496 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_23_in_formalArg512 = new BitSet(new long[]{0x0000000000000400L});
public static final BitSet FOLLOW_LBRACK_in_formalArg516 = new BitSet(new long[]{0x0000000000001000L});
public static final BitSet FOLLOW_RBRACK_in_formalArg518 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ID_in_dictDef551 = new BitSet(new long[]{0x0000000000200000L});
public static final BitSet FOLLOW_21_in_dictDef553 = new BitSet(new long[]{0x0000000000000400L});
public static final BitSet FOLLOW_dict_in_dictDef555 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_LBRACK_in_dict587 = new BitSet(new long[]{0x0000000002002000L});
public static final BitSet FOLLOW_dictPairs_in_dict589 = new BitSet(new long[]{0x0000000000001000L});
public static final BitSet FOLLOW_RBRACK_in_dict592 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_keyValuePair_in_dictPairs607 = new BitSet(new long[]{0x0000000000040002L});
public static final BitSet FOLLOW_18_in_dictPairs616 = new BitSet(new long[]{0x0000000000002000L});
public static final BitSet FOLLOW_keyValuePair_in_dictPairs618 = new BitSet(new long[]{0x0000000000040002L});
public static final BitSet FOLLOW_18_in_dictPairs624 = new BitSet(new long[]{0x0000000002000000L});
public static final BitSet FOLLOW_defaultValuePair_in_dictPairs626 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_defaultValuePair_in_dictPairs637 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_25_in_defaultValuePair660 = new BitSet(new long[]{0x0000000000100000L});
public static final BitSet FOLLOW_20_in_defaultValuePair662 = new BitSet(new long[]{0x0000000000006770L});
public static final BitSet FOLLOW_keyValue_in_defaultValuePair664 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_STRING_in_keyValuePair678 = new BitSet(new long[]{0x0000000000100000L});
public static final BitSet FOLLOW_20_in_keyValuePair680 = new BitSet(new long[]{0x0000000000006770L});
public static final BitSet FOLLOW_keyValue_in_keyValuePair682 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_BIGSTRING_in_keyValue699 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_BIGSTRING_NO_NL_in_keyValue708 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ANONYMOUS_TEMPLATE_in_keyValue716 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_STRING_in_keyValue723 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_TRUE_in_keyValue733 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_FALSE_in_keyValue743 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_LBRACK_in_keyValue753 = new BitSet(new long[]{0x0000000000001000L});
public static final BitSet FOLLOW_RBRACK_in_keyValue755 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ID_in_keyValue768 = new BitSet(new long[]{0x0000000000000002L});
}