
rapture.generated.LGenParser Maven / Gradle / Ivy
// $ANTLR 3.5.2 /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g 2016-03-01 15:52:39
package rapture.generated;
import rapture.dsl.lgen.*;
import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
import org.antlr.runtime.tree.*;
@SuppressWarnings("all")
public class LGenParser extends AbstractLParser {
public static final String[] tokenNames = new String[] {
"", "", "", "", "COMMA", "DUMMY", "EQUALS", "ETCD",
"FILE", "ID", "LBRACE", "LOCKING", "MEMORY", "MONGODB", "RBRACE", "REDIS",
"STRING", "USING", "WS", "ZOOKEEPER", "ENTRIES", "ENTRY", "MAIN"
};
public static final int EOF=-1;
public static final int COMMA=4;
public static final int DUMMY=5;
public static final int EQUALS=6;
public static final int ETCD=7;
public static final int FILE=8;
public static final int ID=9;
public static final int LBRACE=10;
public static final int LOCKING=11;
public static final int MEMORY=12;
public static final int MONGODB=13;
public static final int RBRACE=14;
public static final int REDIS=15;
public static final int STRING=16;
public static final int USING=17;
public static final int WS=18;
public static final int ZOOKEEPER=19;
public static final int ENTRIES=20;
public static final int ENTRY=21;
public static final int MAIN=22;
// delegates
public AbstractLParser[] getDelegates() {
return new AbstractLParser[] {};
}
// delegators
public LGenParser(TokenStream input) {
this(input, new RecognizerSharedState());
}
public LGenParser(TokenStream input, RecognizerSharedState state) {
super(input, state);
}
protected TreeAdaptor adaptor = new CommonTreeAdaptor();
public void setTreeAdaptor(TreeAdaptor adaptor) {
this.adaptor = adaptor;
}
public TreeAdaptor getTreeAdaptor() {
return adaptor;
}
@Override public String[] getTokenNames() { return LGenParser.tokenNames; }
@Override public String getGrammarFileName() { return "/Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g"; }
public static class linfo_return extends ParserRuleReturnScope {
Object tree;
@Override
public Object getTree() { return tree; }
};
// $ANTLR start "linfo"
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:21:1: linfo : LOCKING USING ldef ;
public final LGenParser.linfo_return linfo() throws RecognitionException {
LGenParser.linfo_return retval = new LGenParser.linfo_return();
retval.start = input.LT(1);
Object root_0 = null;
Token LOCKING1=null;
Token USING2=null;
ParserRuleReturnScope ldef3 =null;
Object LOCKING1_tree=null;
Object USING2_tree=null;
try {
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:21:11: ( LOCKING USING ldef )
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:21:13: LOCKING USING ldef
{
root_0 = (Object)adaptor.nil();
LOCKING1=(Token)match(input,LOCKING,FOLLOW_LOCKING_in_linfo95);
LOCKING1_tree = (Object)adaptor.create(LOCKING1);
adaptor.addChild(root_0, LOCKING1_tree);
USING2=(Token)match(input,USING,FOLLOW_USING_in_linfo97);
USING2_tree = (Object)adaptor.create(USING2);
adaptor.addChild(root_0, USING2_tree);
pushFollow(FOLLOW_ldef_in_linfo99);
ldef3=ldef();
state._fsp--;
adaptor.addChild(root_0, ldef3.getTree());
}
retval.stop = input.LT(-1);
retval.tree = (Object)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "linfo"
public static class ldef_return extends ParserRuleReturnScope {
Object tree;
@Override
public Object getTree() { return tree; }
};
// $ANTLR start "ldef"
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:23:1: ldef : s= lstyle config ;
public final LGenParser.ldef_return ldef() throws RecognitionException {
LGenParser.ldef_return retval = new LGenParser.ldef_return();
retval.start = input.LT(1);
Object root_0 = null;
ParserRuleReturnScope s =null;
ParserRuleReturnScope config4 =null;
try {
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:23:11: (s= lstyle config )
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:23:13: s= lstyle config
{
root_0 = (Object)adaptor.nil();
pushFollow(FOLLOW_lstyle_in_ldef114);
s=lstyle();
state._fsp--;
adaptor.addChild(root_0, s.getTree());
pushFollow(FOLLOW_config_in_ldef116);
config4=config();
state._fsp--;
adaptor.addChild(root_0, config4.getTree());
addConfig((s!=null?input.toString(s.start,s.stop):null));
}
retval.stop = input.LT(-1);
retval.tree = (Object)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "ldef"
public static class lstyle_return extends ParserRuleReturnScope {
Object tree;
@Override
public Object getTree() { return tree; }
};
// $ANTLR start "lstyle"
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:25:1: lstyle : s= ( MEMORY | FILE | REDIS | MONGODB | DUMMY ) ;
public final LGenParser.lstyle_return lstyle() throws RecognitionException {
LGenParser.lstyle_return retval = new LGenParser.lstyle_return();
retval.start = input.LT(1);
Object root_0 = null;
Token s=null;
Object s_tree=null;
try {
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:25:11: (s= ( MEMORY | FILE | REDIS | MONGODB | DUMMY ) )
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:25:13: s= ( MEMORY | FILE | REDIS | MONGODB | DUMMY )
{
root_0 = (Object)adaptor.nil();
s=input.LT(1);
if ( input.LA(1)==DUMMY||input.LA(1)==FILE||(input.LA(1) >= MEMORY && input.LA(1) <= MONGODB)||input.LA(1)==REDIS ) {
input.consume();
adaptor.addChild(root_0, (Object)adaptor.create(s));
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
setStore(s);
}
retval.stop = input.LT(-1);
retval.tree = (Object)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "lstyle"
public static class config_return extends ParserRuleReturnScope {
Object tree;
@Override
public Object getTree() { return tree; }
};
// $ANTLR start "config"
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:27:1: config : LBRACE entrylist RBRACE ;
public final LGenParser.config_return config() throws RecognitionException {
LGenParser.config_return retval = new LGenParser.config_return();
retval.start = input.LT(1);
Object root_0 = null;
Token LBRACE5=null;
Token RBRACE7=null;
ParserRuleReturnScope entrylist6 =null;
Object LBRACE5_tree=null;
Object RBRACE7_tree=null;
try {
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:27:11: ( LBRACE entrylist RBRACE )
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:27:13: LBRACE entrylist RBRACE
{
root_0 = (Object)adaptor.nil();
LBRACE5=(Token)match(input,LBRACE,FOLLOW_LBRACE_in_config162);
LBRACE5_tree = (Object)adaptor.create(LBRACE5);
adaptor.addChild(root_0, LBRACE5_tree);
pushFollow(FOLLOW_entrylist_in_config164);
entrylist6=entrylist();
state._fsp--;
adaptor.addChild(root_0, entrylist6.getTree());
RBRACE7=(Token)match(input,RBRACE,FOLLOW_RBRACE_in_config166);
RBRACE7_tree = (Object)adaptor.create(RBRACE7);
adaptor.addChild(root_0, RBRACE7_tree);
}
retval.stop = input.LT(-1);
retval.tree = (Object)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "config"
public static class entrylist_return extends ParserRuleReturnScope {
Object tree;
@Override
public Object getTree() { return tree; }
};
// $ANTLR start "entrylist"
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:29:1: entrylist : (k= entry )? ( COMMA k= entry )* ;
public final LGenParser.entrylist_return entrylist() throws RecognitionException {
LGenParser.entrylist_return retval = new LGenParser.entrylist_return();
retval.start = input.LT(1);
Object root_0 = null;
Token COMMA8=null;
ParserRuleReturnScope k =null;
Object COMMA8_tree=null;
try {
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:29:11: ( (k= entry )? ( COMMA k= entry )* )
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:29:13: (k= entry )? ( COMMA k= entry )*
{
root_0 = (Object)adaptor.nil();
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:29:14: (k= entry )?
int alt1=2;
int LA1_0 = input.LA(1);
if ( (LA1_0==ID) ) {
alt1=1;
}
switch (alt1) {
case 1 :
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:29:14: k= entry
{
pushFollow(FOLLOW_entry_in_entrylist176);
k=entry();
state._fsp--;
adaptor.addChild(root_0, k.getTree());
}
break;
}
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:29:22: ( COMMA k= entry )*
loop2:
while (true) {
int alt2=2;
int LA2_0 = input.LA(1);
if ( (LA2_0==COMMA) ) {
alt2=1;
}
switch (alt2) {
case 1 :
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:29:23: COMMA k= entry
{
COMMA8=(Token)match(input,COMMA,FOLLOW_COMMA_in_entrylist180);
COMMA8_tree = (Object)adaptor.create(COMMA8);
adaptor.addChild(root_0, COMMA8_tree);
pushFollow(FOLLOW_entry_in_entrylist184);
k=entry();
state._fsp--;
adaptor.addChild(root_0, k.getTree());
}
break;
default :
break loop2;
}
}
}
retval.stop = input.LT(-1);
retval.tree = (Object)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "entrylist"
public static class entry_return extends ParserRuleReturnScope {
Object tree;
@Override
public Object getTree() { return tree; }
};
// $ANTLR start "entry"
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:30:1: entry : i= ID EQUALS v= STRING ;
public final LGenParser.entry_return entry() throws RecognitionException {
LGenParser.entry_return retval = new LGenParser.entry_return();
retval.start = input.LT(1);
Object root_0 = null;
Token i=null;
Token v=null;
Token EQUALS9=null;
Object i_tree=null;
Object v_tree=null;
Object EQUALS9_tree=null;
try {
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:30:9: (i= ID EQUALS v= STRING )
// /Users/amkimian/Development/cloud/Rapture/Libs/RaptureCore/src/main/antlr3/rapture/dsl/lgen/LGenParser.g:30:11: i= ID EQUALS v= STRING
{
root_0 = (Object)adaptor.nil();
i=(Token)match(input,ID,FOLLOW_ID_in_entry197);
i_tree = (Object)adaptor.create(i);
adaptor.addChild(root_0, i_tree);
EQUALS9=(Token)match(input,EQUALS,FOLLOW_EQUALS_in_entry199);
EQUALS9_tree = (Object)adaptor.create(EQUALS9);
adaptor.addChild(root_0, EQUALS9_tree);
v=(Token)match(input,STRING,FOLLOW_STRING_in_entry203);
v_tree = (Object)adaptor.create(v);
adaptor.addChild(root_0, v_tree);
addConfig((i!=null?i.getText():null), (v!=null?v.getText():null));
}
retval.stop = input.LT(-1);
retval.tree = (Object)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
// do for sure before leaving
}
return retval;
}
// $ANTLR end "entry"
// Delegated rules
public static final BitSet FOLLOW_LOCKING_in_linfo95 = new BitSet(new long[]{0x0000000000020000L});
public static final BitSet FOLLOW_USING_in_linfo97 = new BitSet(new long[]{0x000000000000B120L});
public static final BitSet FOLLOW_ldef_in_linfo99 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_lstyle_in_ldef114 = new BitSet(new long[]{0x0000000000000400L});
public static final BitSet FOLLOW_config_in_ldef116 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_set_in_lstyle131 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_LBRACE_in_config162 = new BitSet(new long[]{0x0000000000004210L});
public static final BitSet FOLLOW_entrylist_in_config164 = new BitSet(new long[]{0x0000000000004000L});
public static final BitSet FOLLOW_RBRACE_in_config166 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_entry_in_entrylist176 = new BitSet(new long[]{0x0000000000000012L});
public static final BitSet FOLLOW_COMMA_in_entrylist180 = new BitSet(new long[]{0x0000000000000200L});
public static final BitSet FOLLOW_entry_in_entrylist184 = new BitSet(new long[]{0x0000000000000012L});
public static final BitSet FOLLOW_ID_in_entry197 = new BitSet(new long[]{0x0000000000000040L});
public static final BitSet FOLLOW_EQUALS_in_entry199 = new BitSet(new long[]{0x0000000000010000L});
public static final BitSet FOLLOW_STRING_in_entry203 = new BitSet(new long[]{0x0000000000000002L});
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy