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

com.incapture.rapgen.TTreePython Maven / Gradle / Ivy

// $ANTLR 3.5.2 /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g 2016-03-01 15:23:00

    package com.incapture.rapgen;
    import com.incapture.rapgen.annotations.*;


import org.antlr.runtime.*;
import org.antlr.runtime.tree.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

import org.antlr.stringtemplate.*;
import org.antlr.stringtemplate.language.*;
import java.util.HashMap;
@SuppressWarnings("all")
public class TTreePython extends AbstractPythonTTree {
	public static final String[] tokenNames = new String[] {
		"", "", "", "", "ADDRESSABLE", "API", "AT", "BANG", 
		"BEAN", "BOOLTYPE", "BYTEARRAYTYPE", "CACHEABLE", "CLOSESQUARE", "COLUMN", 
		"COMMA", "COMMENT", "CRUDTYPED", "DATA", "DATETYPE", "DEPRECATED", "DOC", 
		"DOT", "DOUBLETYPE", "DYNENT", "ENTITLE", "EQUAL", "EXTENDS", "FALSE", 
		"G_THAN", "ID", "INCLUDE", "INDEXED", "INT", "INTTYPE", "LBRAC", "LISTTYPE", 
		"LONGCTYPE", "LONGTYPE", "LPAREN", "L_THAN", "MAPTYPE", "MINUS", "NEW", 
		"OBJECTTYPE", "OPENSQUARE", "PACKAGE", "PACKAGENAME", "PRIVATE", "PUBLIC", 
		"RBRAC", "REGULARENTITLE", "RPAREN", "SCHEME", "SDKNAME", "SEMI", "SETTYPE", 
		"SQUOTE", "STORABLE", "STORAGE_PATH", "STREAMING", "STRING", "STRINGTYPE", 
		"TRUE", "TYPED", "VOIDTYPE", "WS", "APIENTRY", "APISEC", "CLASSTYPE", 
		"COMPLEX", "CRUDINFO", "CRUDINFOENTRY", "CRUDPACKAGEANNOTATION", "CRUDTYPEDEF", 
		"ENTITLEASPECT", "ENUM", "EXPR", "FIELD_CONSTRUCTOR", "FNNAME", "INDEX_COMPONENT", 
		"INDEX_NAME", "INNERA", "INNERC", "INNERT", "MAIN", "MEMBER", "MEMBERS", 
		"MINVERSIONDEF", "NAME", "PARAM", "PARAMS", "PRIVATEVIS", "PUBLICVIS", 
		"RAW", "RETTYPE", "SCRIPT", "SDKDEF", "STATEMENT", "STORABLE_ENCODING", 
		"STORABLE_PREFIX", "STORABLE_REPO_NAME", "STORABLE_SEPARATOR", "STORABLE_TTL_DAYS", 
		"STORAGE_PATH_ADDER", "STREAMINGASPECT", "TYPE", "TYPEASPECT", "TYPEDEF", 
		"TYPEFIELDS", "TYPEMEMBER", "VERSIONDEF", "VISIBILITY", "112", "113", 
		"114", "115", "116", "117", "118", "119", "120", "121", "122", "123", 
		"124", "125", "126", "127", "128", "129", "130", "131", "132", "133", 
		"134", "135", "136", "137", "138", "139"
	};
	public static final int EOF=-1;
	public static final int ADDRESSABLE=4;
	public static final int API=5;
	public static final int AT=6;
	public static final int BANG=7;
	public static final int BEAN=8;
	public static final int BOOLTYPE=9;
	public static final int BYTEARRAYTYPE=10;
	public static final int CACHEABLE=11;
	public static final int CLOSESQUARE=12;
	public static final int COLUMN=13;
	public static final int COMMA=14;
	public static final int COMMENT=15;
	public static final int CRUDTYPED=16;
	public static final int DATA=17;
	public static final int DATETYPE=18;
	public static final int DEPRECATED=19;
	public static final int DOC=20;
	public static final int DOT=21;
	public static final int DOUBLETYPE=22;
	public static final int DYNENT=23;
	public static final int ENTITLE=24;
	public static final int EQUAL=25;
	public static final int EXTENDS=26;
	public static final int FALSE=27;
	public static final int G_THAN=28;
	public static final int ID=29;
	public static final int INCLUDE=30;
	public static final int INDEXED=31;
	public static final int INT=32;
	public static final int INTTYPE=33;
	public static final int LBRAC=34;
	public static final int LISTTYPE=35;
	public static final int LONGCTYPE=36;
	public static final int LONGTYPE=37;
	public static final int LPAREN=38;
	public static final int L_THAN=39;
	public static final int MAPTYPE=40;
	public static final int MINUS=41;
	public static final int NEW=42;
	public static final int OBJECTTYPE=43;
	public static final int OPENSQUARE=44;
	public static final int PACKAGE=45;
	public static final int PACKAGENAME=46;
	public static final int PRIVATE=47;
	public static final int PUBLIC=48;
	public static final int RBRAC=49;
	public static final int REGULARENTITLE=50;
	public static final int RPAREN=51;
	public static final int SCHEME=52;
	public static final int SDKNAME=53;
	public static final int SEMI=54;
	public static final int SETTYPE=55;
	public static final int SQUOTE=56;
	public static final int STORABLE=57;
	public static final int STORAGE_PATH=58;
	public static final int STREAMING=59;
	public static final int STRING=60;
	public static final int STRINGTYPE=61;
	public static final int TRUE=62;
	public static final int TYPED=63;
	public static final int VOIDTYPE=64;
	public static final int WS=65;
	public static final int APIENTRY=66;
	public static final int APISEC=67;
	public static final int CLASSTYPE=68;
	public static final int COMPLEX=69;
	public static final int CRUDINFO=70;
	public static final int CRUDINFOENTRY=71;
	public static final int CRUDPACKAGEANNOTATION=72;
	public static final int CRUDTYPEDEF=73;
	public static final int ENTITLEASPECT=74;
	public static final int ENUM=75;
	public static final int EXPR=76;
	public static final int FIELD_CONSTRUCTOR=77;
	public static final int FNNAME=78;
	public static final int INDEX_COMPONENT=79;
	public static final int INDEX_NAME=80;
	public static final int INNERA=81;
	public static final int INNERC=82;
	public static final int INNERT=83;
	public static final int MAIN=84;
	public static final int MEMBER=85;
	public static final int MEMBERS=86;
	public static final int MINVERSIONDEF=87;
	public static final int NAME=88;
	public static final int PARAM=89;
	public static final int PARAMS=90;
	public static final int PRIVATEVIS=91;
	public static final int PUBLICVIS=92;
	public static final int RAW=93;
	public static final int RETTYPE=94;
	public static final int SCRIPT=95;
	public static final int SDKDEF=96;
	public static final int STATEMENT=97;
	public static final int STORABLE_ENCODING=98;
	public static final int STORABLE_PREFIX=99;
	public static final int STORABLE_REPO_NAME=100;
	public static final int STORABLE_SEPARATOR=101;
	public static final int STORABLE_TTL_DAYS=102;
	public static final int STORAGE_PATH_ADDER=103;
	public static final int STREAMINGASPECT=104;
	public static final int TYPE=105;
	public static final int TYPEASPECT=106;
	public static final int TYPEDEF=107;
	public static final int TYPEFIELDS=108;
	public static final int TYPEMEMBER=109;
	public static final int VERSIONDEF=110;
	public static final int VISIBILITY=111;

	// delegates
	public TTreePython_TTreeShared gTTreeShared;
	public AbstractPythonTTree[] getDelegates() {
		return new AbstractPythonTTree[] {gTTreeShared};
	}

	// delegators


	public TTreePython(TreeNodeStream input) {
		this(input, new RecognizerSharedState());
	}
	public TTreePython(TreeNodeStream input, RecognizerSharedState state) {
		super(input, state);
		gTTreeShared = new TTreePython_TTreeShared(input, state, this);
	}

	protected StringTemplateGroup templateLib =
	  new StringTemplateGroup("TTreePythonTemplates", AngleBracketTemplateLexer.class);

	public void setTemplateLib(StringTemplateGroup templateLib) {
	  this.templateLib = templateLib;
	}
	public StringTemplateGroup getTemplateLib() {
	  return templateLib;
	}
	/** allows convenient multi-value initialization:
	 *  "new STAttrMap().put(...).put(...)"
	 */
	@SuppressWarnings("serial")
	public static class STAttrMap extends HashMap {
		public STAttrMap put(String attrName, Object value) {
			super.put(attrName, value);
			return this;
		}
	}
	@Override public String[] getTokenNames() { return TTreePython.tokenNames; }
	@Override public String getGrammarFileName() { return "/Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g"; }


	    String sdkName = null;


	protected static class hmxdef_scope {
		List apis;
	}
	protected Stack hmxdef_stack = new Stack();

	public static class hmxdef_return extends TreeRuleReturnScope {
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "hmxdef"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:22:1: hmxdef : ^( MAIN ( sdkExpr )? versionExpr minVerExpr ( ^( INNERT typeExpr ) | ^( INNERA a= apiExpr ) | ^( INNERC c= crudTypeExpr ) )* ) ;
	public final TTreePython.hmxdef_return hmxdef() throws RecognitionException {
		hmxdef_stack.push(new hmxdef_scope());
		TTreePython.hmxdef_return retval = new TTreePython.hmxdef_return();
		retval.start = input.LT(1);

		TreeRuleReturnScope a =null;
		TreeRuleReturnScope c =null;
		TreeRuleReturnScope sdkExpr1 =null;
		TreeRuleReturnScope versionExpr2 =null;

		 hmxdef_stack.peek().apis = new ArrayList(); 
		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:25:3: ( ^( MAIN ( sdkExpr )? versionExpr minVerExpr ( ^( INNERT typeExpr ) | ^( INNERA a= apiExpr ) | ^( INNERC c= crudTypeExpr ) )* ) )
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:25:3: ^( MAIN ( sdkExpr )? versionExpr minVerExpr ( ^( INNERT typeExpr ) | ^( INNERA a= apiExpr ) | ^( INNERC c= crudTypeExpr ) )* )
			{
			match(input,MAIN,FOLLOW_MAIN_in_hmxdef100); 
			match(input, Token.DOWN, null); 
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:25:10: ( sdkExpr )?
			int alt1=2;
			int LA1_0 = input.LA(1);
			if ( (LA1_0==SDKDEF) ) {
				alt1=1;
			}
			switch (alt1) {
				case 1 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:25:10: sdkExpr
					{
					pushFollow(FOLLOW_sdkExpr_in_hmxdef102);
					sdkExpr1=sdkExpr();
					state._fsp--;

					}
					break;

			}

			 sdkName = (sdkExpr1!=null?((TTreePython_TTreeShared.sdkExpr_return)sdkExpr1).name:null); 
			pushFollow(FOLLOW_versionExpr_in_hmxdef107);
			versionExpr2=versionExpr();
			state._fsp--;

			pushFollow(FOLLOW_minVerExpr_in_hmxdef109);
			minVerExpr();
			state._fsp--;

			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:26:11: ( ^( INNERT typeExpr ) | ^( INNERA a= apiExpr ) | ^( INNERC c= crudTypeExpr ) )*
			loop2:
			while (true) {
				int alt2=4;
				switch ( input.LA(1) ) {
				case INNERT:
					{
					alt2=1;
					}
					break;
				case INNERA:
					{
					alt2=2;
					}
					break;
				case INNERC:
					{
					alt2=3;
					}
					break;
				}
				switch (alt2) {
				case 1 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:26:14: ^( INNERT typeExpr )
					{
					match(input,INNERT,FOLLOW_INNERT_in_hmxdef126); 
					match(input, Token.DOWN, null); 
					pushFollow(FOLLOW_typeExpr_in_hmxdef128);
					typeExpr();
					state._fsp--;

					match(input, Token.UP, null); 

					}
					break;
				case 2 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:27:14: ^( INNERA a= apiExpr )
					{
					match(input,INNERA,FOLLOW_INNERA_in_hmxdef145); 
					match(input, Token.DOWN, null); 
					pushFollow(FOLLOW_apiExpr_in_hmxdef149);
					a=apiExpr();
					state._fsp--;

					 hmxdef_stack.peek().apis.addAll((a!=null?((TTreePython.apiExpr_return)a).fns:null)); 
					match(input, Token.UP, null); 

					}
					break;
				case 3 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:28:14: ^( INNERC c= crudTypeExpr )
					{
					match(input,INNERC,FOLLOW_INNERC_in_hmxdef168); 
					match(input, Token.DOWN, null); 
					pushFollow(FOLLOW_crudTypeExpr_in_hmxdef172);
					c=crudTypeExpr();
					state._fsp--;

					 
					match(input, Token.UP, null); 

					}
					break;

				default :
					break loop2;
				}
			}

			match(input, Token.UP, null); 


			  // And finally here we need to build the typeFile
			  StringTemplate typeFile 
			    = templateLib.getInstanceOf("PythonApiFile",new STAttrMap().put("apis", hmxdef_stack.peek().apis).put("versionMajor", (versionExpr2!=null?((TTreePython_TTreeShared.versionExpr_return)versionExpr2).major:0)).put("versionMinor", (versionExpr2!=null?((TTreePython_TTreeShared.versionExpr_return)versionExpr2).minor:0)).put("versionMicro", (versionExpr2!=null?((TTreePython_TTreeShared.versionExpr_return)versionExpr2).micro:0)));
			  String typeFullFileName = (sdkName == null) ? "raptureAPI.py" : sdkName + "API.py";
			  addApiTemplate(typeFullFileName, "1", typeFile);

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			hmxdef_stack.pop();
		}
		return retval;
	}
	// $ANTLR end "hmxdef"


	public static class typeExpr_return extends TreeRuleReturnScope {
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "typeExpr"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:38:1: typeExpr : ^( TYPEDEF doc= DOC ( beanAnnotation | cacheableAnnotation | extendsAnnotation | deprecatedAnnotation | addressableAnnotation | storableAnnotation | indexedAnnotation )* name= ID typeAspect typeFields ) ;
	public final TTreePython.typeExpr_return typeExpr() throws RecognitionException {
		TTreePython.typeExpr_return retval = new TTreePython.typeExpr_return();
		retval.start = input.LT(1);

		CommonTree doc=null;
		CommonTree name=null;

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:39:2: ( ^( TYPEDEF doc= DOC ( beanAnnotation | cacheableAnnotation | extendsAnnotation | deprecatedAnnotation | addressableAnnotation | storableAnnotation | indexedAnnotation )* name= ID typeAspect typeFields ) )
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:40:2: ^( TYPEDEF doc= DOC ( beanAnnotation | cacheableAnnotation | extendsAnnotation | deprecatedAnnotation | addressableAnnotation | storableAnnotation | indexedAnnotation )* name= ID typeAspect typeFields )
			{
			match(input,TYPEDEF,FOLLOW_TYPEDEF_in_typeExpr208); 
			match(input, Token.DOWN, null); 
			doc=(CommonTree)match(input,DOC,FOLLOW_DOC_in_typeExpr212); 
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:40:20: ( beanAnnotation | cacheableAnnotation | extendsAnnotation | deprecatedAnnotation | addressableAnnotation | storableAnnotation | indexedAnnotation )*
			loop3:
			while (true) {
				int alt3=8;
				switch ( input.LA(1) ) {
				case BEAN:
					{
					alt3=1;
					}
					break;
				case CACHEABLE:
					{
					alt3=2;
					}
					break;
				case EXTENDS:
					{
					alt3=3;
					}
					break;
				case DEPRECATED:
					{
					alt3=4;
					}
					break;
				case ADDRESSABLE:
					{
					alt3=5;
					}
					break;
				case STORABLE:
					{
					alt3=6;
					}
					break;
				case INDEXED:
					{
					alt3=7;
					}
					break;
				}
				switch (alt3) {
				case 1 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:40:21: beanAnnotation
					{
					pushFollow(FOLLOW_beanAnnotation_in_typeExpr215);
					beanAnnotation();
					state._fsp--;

					}
					break;
				case 2 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:40:36: cacheableAnnotation
					{
					pushFollow(FOLLOW_cacheableAnnotation_in_typeExpr217);
					cacheableAnnotation();
					state._fsp--;

					}
					break;
				case 3 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:40:56: extendsAnnotation
					{
					pushFollow(FOLLOW_extendsAnnotation_in_typeExpr219);
					extendsAnnotation();
					state._fsp--;

					}
					break;
				case 4 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:40:74: deprecatedAnnotation
					{
					pushFollow(FOLLOW_deprecatedAnnotation_in_typeExpr221);
					deprecatedAnnotation();
					state._fsp--;

					}
					break;
				case 5 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:40:95: addressableAnnotation
					{
					pushFollow(FOLLOW_addressableAnnotation_in_typeExpr223);
					addressableAnnotation();
					state._fsp--;

					}
					break;
				case 6 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:40:117: storableAnnotation
					{
					pushFollow(FOLLOW_storableAnnotation_in_typeExpr225);
					storableAnnotation();
					state._fsp--;

					}
					break;
				case 7 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:40:136: indexedAnnotation
					{
					pushFollow(FOLLOW_indexedAnnotation_in_typeExpr227);
					indexedAnnotation();
					state._fsp--;

					}
					break;

				default :
					break loop3;
				}
			}

			name=(CommonTree)match(input,ID,FOLLOW_ID_in_typeExpr235); 
			pushFollow(FOLLOW_typeAspect_in_typeExpr237);
			typeAspect();
			state._fsp--;

			pushFollow(FOLLOW_typeFields_in_typeExpr239);
			typeFields();
			state._fsp--;

			match(input, Token.UP, null); 

			 
				
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "typeExpr"


	public static class typeAspect_return extends TreeRuleReturnScope {
		public String name;
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "typeAspect"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:43:1: typeAspect returns [String name] : ^( TYPEASPECT p= PACKAGENAME ) ;
	public final TTreePython.typeAspect_return typeAspect() throws RecognitionException {
		TTreePython.typeAspect_return retval = new TTreePython.typeAspect_return();
		retval.start = input.LT(1);

		CommonTree p=null;

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:44:5: ( ^( TYPEASPECT p= PACKAGENAME ) )
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:45:5: ^( TYPEASPECT p= PACKAGENAME )
			{
			match(input,TYPEASPECT,FOLLOW_TYPEASPECT_in_typeAspect261); 
			match(input, Token.DOWN, null); 
			p=(CommonTree)match(input,PACKAGENAME,FOLLOW_PACKAGENAME_in_typeAspect265); 
			match(input, Token.UP, null); 

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "typeAspect"


	public static class typeFields_return extends TreeRuleReturnScope {
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "typeFields"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:48:1: typeFields : ^( TYPEFIELDS ( typeFieldDef )* ) ;
	public final TTreePython.typeFields_return typeFields() throws RecognitionException {
		TTreePython.typeFields_return retval = new TTreePython.typeFields_return();
		retval.start = input.LT(1);



		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:50:3: ( ^( TYPEFIELDS ( typeFieldDef )* ) )
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:51:5: ^( TYPEFIELDS ( typeFieldDef )* )
			{
			match(input,TYPEFIELDS,FOLLOW_TYPEFIELDS_in_typeFields285); 
			if ( input.LA(1)==Token.DOWN ) {
				match(input, Token.DOWN, null); 
				// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:51:18: ( typeFieldDef )*
				loop4:
				while (true) {
					int alt4=2;
					int LA4_0 = input.LA(1);
					if ( (LA4_0==TYPEMEMBER) ) {
						alt4=1;
					}

					switch (alt4) {
					case 1 :
						// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:51:19: typeFieldDef
						{
						pushFollow(FOLLOW_typeFieldDef_in_typeFields288);
						typeFieldDef();
						state._fsp--;

						}
						break;

					default :
						break loop4;
					}
				}

				match(input, Token.UP, null); 
			}

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "typeFields"


	public static class typeFieldDef_return extends TreeRuleReturnScope {
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "typeFieldDef"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:57:1: typeFieldDef : ^( TYPEMEMBER ^( TYPE vartype ) ^( NAME n= ID ) ^( FIELD_CONSTRUCTOR ( fieldConstructor )? ) ) ;
	public final TTreePython.typeFieldDef_return typeFieldDef() throws RecognitionException {
		TTreePython.typeFieldDef_return retval = new TTreePython.typeFieldDef_return();
		retval.start = input.LT(1);

		CommonTree n=null;

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:57:13: ( ^( TYPEMEMBER ^( TYPE vartype ) ^( NAME n= ID ) ^( FIELD_CONSTRUCTOR ( fieldConstructor )? ) ) )
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:58:5: ^( TYPEMEMBER ^( TYPE vartype ) ^( NAME n= ID ) ^( FIELD_CONSTRUCTOR ( fieldConstructor )? ) )
			{
			match(input,TYPEMEMBER,FOLLOW_TYPEMEMBER_in_typeFieldDef311); 
			match(input, Token.DOWN, null); 
			match(input,TYPE,FOLLOW_TYPE_in_typeFieldDef314); 
			match(input, Token.DOWN, null); 
			pushFollow(FOLLOW_vartype_in_typeFieldDef316);
			vartype();
			state._fsp--;

			match(input, Token.UP, null); 

			match(input,NAME,FOLLOW_NAME_in_typeFieldDef320); 
			match(input, Token.DOWN, null); 
			n=(CommonTree)match(input,ID,FOLLOW_ID_in_typeFieldDef324); 
			match(input, Token.UP, null); 

			match(input,FIELD_CONSTRUCTOR,FOLLOW_FIELD_CONSTRUCTOR_in_typeFieldDef328); 
			if ( input.LA(1)==Token.DOWN ) {
				match(input, Token.DOWN, null); 
				// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:58:67: ( fieldConstructor )?
				int alt5=2;
				int LA5_0 = input.LA(1);
				if ( ((LA5_0 >= ADDRESSABLE && LA5_0 <= 139)) ) {
					alt5=1;
				}
				switch (alt5) {
					case 1 :
						// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:58:67: fieldConstructor
						{
						pushFollow(FOLLOW_fieldConstructor_in_typeFieldDef330);
						fieldConstructor();
						state._fsp--;

						}
						break;

				}

				match(input, Token.UP, null); 
			}

			match(input, Token.UP, null); 

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "typeFieldDef"


	public static class vartype_return extends TreeRuleReturnScope {
		public String pythonType;
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "vartype"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:64:1: vartype returns [String pythonType] : ( ^( RAW INTTYPE ) | ^( RAW LONGTYPE ) | ^( RAW OBJECTTYPE ) | ^( RAW LONGCTYPE ) | ^( RAW DATETYPE ) | ^( RAW BOOLTYPE ) | ^( RAW DOUBLETYPE ) | ^( RAW STRINGTYPE ) | ^( RAW BYTEARRAYTYPE ) | ^( RAW VOIDTYPE ) | ^( LISTTYPE v= vartype ) | ^( SETTYPE v= vartype ) | ^( MAPTYPE k= vartype v= vartype ) | ^( COMPLEX typeid= ID ) );
	public final TTreePython.vartype_return vartype() throws RecognitionException {
		TTreePython.vartype_return retval = new TTreePython.vartype_return();
		retval.start = input.LT(1);

		CommonTree typeid=null;
		TreeRuleReturnScope v =null;
		TreeRuleReturnScope k =null;

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:64:36: ( ^( RAW INTTYPE ) | ^( RAW LONGTYPE ) | ^( RAW OBJECTTYPE ) | ^( RAW LONGCTYPE ) | ^( RAW DATETYPE ) | ^( RAW BOOLTYPE ) | ^( RAW DOUBLETYPE ) | ^( RAW STRINGTYPE ) | ^( RAW BYTEARRAYTYPE ) | ^( RAW VOIDTYPE ) | ^( LISTTYPE v= vartype ) | ^( SETTYPE v= vartype ) | ^( MAPTYPE k= vartype v= vartype ) | ^( COMPLEX typeid= ID ) )
			int alt6=14;
			switch ( input.LA(1) ) {
			case RAW:
				{
				int LA6_1 = input.LA(2);
				if ( (LA6_1==DOWN) ) {
					switch ( input.LA(3) ) {
					case INTTYPE:
						{
						alt6=1;
						}
						break;
					case LONGTYPE:
						{
						alt6=2;
						}
						break;
					case OBJECTTYPE:
						{
						alt6=3;
						}
						break;
					case LONGCTYPE:
						{
						alt6=4;
						}
						break;
					case DATETYPE:
						{
						alt6=5;
						}
						break;
					case BOOLTYPE:
						{
						alt6=6;
						}
						break;
					case DOUBLETYPE:
						{
						alt6=7;
						}
						break;
					case STRINGTYPE:
						{
						alt6=8;
						}
						break;
					case BYTEARRAYTYPE:
						{
						alt6=9;
						}
						break;
					case VOIDTYPE:
						{
						alt6=10;
						}
						break;
					default:
						int nvaeMark = input.mark();
						try {
							for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) {
								input.consume();
							}
							NoViableAltException nvae =
								new NoViableAltException("", 6, 6, input);
							throw nvae;
						} finally {
							input.rewind(nvaeMark);
						}
					}
				}

				else {
					int nvaeMark = input.mark();
					try {
						input.consume();
						NoViableAltException nvae =
							new NoViableAltException("", 6, 1, input);
						throw nvae;
					} finally {
						input.rewind(nvaeMark);
					}
				}

				}
				break;
			case LISTTYPE:
				{
				alt6=11;
				}
				break;
			case SETTYPE:
				{
				alt6=12;
				}
				break;
			case MAPTYPE:
				{
				alt6=13;
				}
				break;
			case COMPLEX:
				{
				alt6=14;
				}
				break;
			default:
				NoViableAltException nvae =
					new NoViableAltException("", 6, 0, input);
				throw nvae;
			}
			switch (alt6) {
				case 1 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:65:5: ^( RAW INTTYPE )
					{
					match(input,RAW,FOLLOW_RAW_in_vartype353); 
					match(input, Token.DOWN, null); 
					match(input,INTTYPE,FOLLOW_INTTYPE_in_vartype355); 
					match(input, Token.UP, null); 

					 retval.pythonType = "int"; 
					}
					break;
				case 2 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:66:7: ^( RAW LONGTYPE )
					{
					match(input,RAW,FOLLOW_RAW_in_vartype367); 
					match(input, Token.DOWN, null); 
					match(input,LONGTYPE,FOLLOW_LONGTYPE_in_vartype369); 
					match(input, Token.UP, null); 

					 retval.pythonType = "long"; 
					}
					break;
				case 3 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:67:7: ^( RAW OBJECTTYPE )
					{
					match(input,RAW,FOLLOW_RAW_in_vartype381); 
					match(input, Token.DOWN, null); 
					match(input,OBJECTTYPE,FOLLOW_OBJECTTYPE_in_vartype383); 
					match(input, Token.UP, null); 

					 retval.pythonType = "interface{}";
					}
					break;
				case 4 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:68:7: ^( RAW LONGCTYPE )
					{
					match(input,RAW,FOLLOW_RAW_in_vartype395); 
					match(input, Token.DOWN, null); 
					match(input,LONGCTYPE,FOLLOW_LONGCTYPE_in_vartype397); 
					match(input, Token.UP, null); 

					 retval.pythonType = "long"; 
					}
					break;
				case 5 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:69:7: ^( RAW DATETYPE )
					{
					match(input,RAW,FOLLOW_RAW_in_vartype409); 
					match(input, Token.DOWN, null); 
					match(input,DATETYPE,FOLLOW_DATETYPE_in_vartype411); 
					match(input, Token.UP, null); 

					 retval.pythonType = "date"; 
					}
					break;
				case 6 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:70:7: ^( RAW BOOLTYPE )
					{
					match(input,RAW,FOLLOW_RAW_in_vartype423); 
					match(input, Token.DOWN, null); 
					match(input,BOOLTYPE,FOLLOW_BOOLTYPE_in_vartype425); 
					match(input, Token.UP, null); 

					 retval.pythonType = "bool"; 
					}
					break;
				case 7 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:71:7: ^( RAW DOUBLETYPE )
					{
					match(input,RAW,FOLLOW_RAW_in_vartype437); 
					match(input, Token.DOWN, null); 
					match(input,DOUBLETYPE,FOLLOW_DOUBLETYPE_in_vartype439); 
					match(input, Token.UP, null); 

					 retval.pythonType = "double"; 
					}
					break;
				case 8 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:72:7: ^( RAW STRINGTYPE )
					{
					match(input,RAW,FOLLOW_RAW_in_vartype451); 
					match(input, Token.DOWN, null); 
					match(input,STRINGTYPE,FOLLOW_STRINGTYPE_in_vartype453); 
					match(input, Token.UP, null); 

					 retval.pythonType = "str"; 
					}
					break;
				case 9 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:73:7: ^( RAW BYTEARRAYTYPE )
					{
					match(input,RAW,FOLLOW_RAW_in_vartype465); 
					match(input, Token.DOWN, null); 
					match(input,BYTEARRAYTYPE,FOLLOW_BYTEARRAYTYPE_in_vartype467); 
					match(input, Token.UP, null); 

					 retval.pythonType = "bytearray"; 
					}
					break;
				case 10 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:74:7: ^( RAW VOIDTYPE )
					{
					match(input,RAW,FOLLOW_RAW_in_vartype479); 
					match(input, Token.DOWN, null); 
					match(input,VOIDTYPE,FOLLOW_VOIDTYPE_in_vartype481); 
					match(input, Token.UP, null); 

					 retval.pythonType = ""; 
					}
					break;
				case 11 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:75:7: ^( LISTTYPE v= vartype )
					{
					match(input,LISTTYPE,FOLLOW_LISTTYPE_in_vartype493); 
					match(input, Token.DOWN, null); 
					pushFollow(FOLLOW_vartype_in_vartype497);
					v=vartype();
					state._fsp--;

					match(input, Token.UP, null); 

					 retval.pythonType = "list"; 
					}
					break;
				case 12 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:76:7: ^( SETTYPE v= vartype )
					{
					match(input,SETTYPE,FOLLOW_SETTYPE_in_vartype509); 
					match(input, Token.DOWN, null); 
					pushFollow(FOLLOW_vartype_in_vartype513);
					v=vartype();
					state._fsp--;

					match(input, Token.UP, null); 

					 retval.pythonType = "list"; 
					}
					break;
				case 13 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:77:7: ^( MAPTYPE k= vartype v= vartype )
					{
					match(input,MAPTYPE,FOLLOW_MAPTYPE_in_vartype525); 
					match(input, Token.DOWN, null); 
					pushFollow(FOLLOW_vartype_in_vartype529);
					k=vartype();
					state._fsp--;

					pushFollow(FOLLOW_vartype_in_vartype533);
					v=vartype();
					state._fsp--;

					match(input, Token.UP, null); 

					 retval.pythonType = "dict"; 
					}
					break;
				case 14 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:78:7: ^( COMPLEX typeid= ID )
					{
					match(input,COMPLEX,FOLLOW_COMPLEX_in_vartype546); 
					match(input, Token.DOWN, null); 
					typeid=(CommonTree)match(input,ID,FOLLOW_ID_in_vartype550); 
					match(input, Token.UP, null); 

					 retval.pythonType = (typeid!=null?typeid.getText():null); 
					}
					break;

			}
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "vartype"


	protected static class apiExpr_scope {
		String apiName;
	}
	protected Stack apiExpr_stack = new Stack();

	public static class apiExpr_return extends TreeRuleReturnScope {
		public List fns;
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "apiExpr"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:80:1: apiExpr returns [List fns] : ^( APISEC DOC (deprecated= deprecatedAspect )? apiType= ID (a= apilist ) ) ;
	public final TTreePython.apiExpr_return apiExpr() throws RecognitionException {
		apiExpr_stack.push(new apiExpr_scope());
		TTreePython.apiExpr_return retval = new TTreePython.apiExpr_return();
		retval.start = input.LT(1);

		CommonTree apiType=null;
		TreeRuleReturnScope deprecated =null;
		TreeRuleReturnScope a =null;


		     retval.fns = new ArrayList();

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:86:4: ( ^( APISEC DOC (deprecated= deprecatedAspect )? apiType= ID (a= apilist ) ) )
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:87:4: ^( APISEC DOC (deprecated= deprecatedAspect )? apiType= ID (a= apilist ) )
			{
			match(input,APISEC,FOLLOW_APISEC_in_apiExpr595); 
			match(input, Token.DOWN, null); 
			match(input,DOC,FOLLOW_DOC_in_apiExpr597); 
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:87:27: (deprecated= deprecatedAspect )?
			int alt7=2;
			int LA7_0 = input.LA(1);
			if ( (LA7_0==DEPRECATED) ) {
				alt7=1;
			}
			switch (alt7) {
				case 1 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:87:27: deprecated= deprecatedAspect
					{
					pushFollow(FOLLOW_deprecatedAspect_in_apiExpr601);
					deprecated=deprecatedAspect();
					state._fsp--;

					}
					break;

			}

			apiType=(CommonTree)match(input,ID,FOLLOW_ID_in_apiExpr606); 
			 apiExpr_stack.peek().apiName = (apiType!=null?apiType.getText():null); 
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:87:96: (a= apilist )
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:87:97: a= apilist
			{
			pushFollow(FOLLOW_apilist_in_apiExpr613);
			a=apilist();
			state._fsp--;

			}

			match(input, Token.UP, null); 


						    retval.fns = (a!=null?((TTreePython.apilist_return)a).fns:null);
			                      
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			apiExpr_stack.pop();
		}
		return retval;
	}
	// $ANTLR end "apiExpr"


	protected static class crudTypeExpr_scope {
		String crudTypeName;
		BeanAnnotation bean;
		AddressableAnnotation addressable;
		StorableAnnotation storable;
		ExtendsAnnotation extend;
		DeprecatedAnnotation deprecated;
	}
	protected Stack crudTypeExpr_stack = new Stack();

	public static class crudTypeExpr_return extends TreeRuleReturnScope {
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "crudTypeExpr"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:91:1: crudTypeExpr : ^( CRUDTYPEDEF doc= DOC ( addressableAnnotation | storableAnnotation | extendsAnnotation | deprecatedAnnotation | beanAnnotation )* ( crudPackageAnnotation )? name= ID crudTypeInfo typeFields ) ;
	public final TTreePython.crudTypeExpr_return crudTypeExpr() throws RecognitionException {
		crudTypeExpr_stack.push(new crudTypeExpr_scope());
		TTreePython.crudTypeExpr_return retval = new TTreePython.crudTypeExpr_return();
		retval.start = input.LT(1);

		CommonTree doc=null;
		CommonTree name=null;
		TreeRuleReturnScope addressableAnnotation3 =null;
		TreeRuleReturnScope storableAnnotation4 =null;
		TreeRuleReturnScope extendsAnnotation5 =null;
		TreeRuleReturnScope deprecatedAnnotation6 =null;
		TreeRuleReturnScope beanAnnotation7 =null;

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:98:7: ( ^( CRUDTYPEDEF doc= DOC ( addressableAnnotation | storableAnnotation | extendsAnnotation | deprecatedAnnotation | beanAnnotation )* ( crudPackageAnnotation )? name= ID crudTypeInfo typeFields ) )
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:99:5: ^( CRUDTYPEDEF doc= DOC ( addressableAnnotation | storableAnnotation | extendsAnnotation | deprecatedAnnotation | beanAnnotation )* ( crudPackageAnnotation )? name= ID crudTypeInfo typeFields )
			{
			match(input,CRUDTYPEDEF,FOLLOW_CRUDTYPEDEF_in_crudTypeExpr634); 
			match(input, Token.DOWN, null); 
			doc=(CommonTree)match(input,DOC,FOLLOW_DOC_in_crudTypeExpr638); 
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:100:9: ( addressableAnnotation | storableAnnotation | extendsAnnotation | deprecatedAnnotation | beanAnnotation )*
			loop8:
			while (true) {
				int alt8=6;
				switch ( input.LA(1) ) {
				case ADDRESSABLE:
					{
					alt8=1;
					}
					break;
				case STORABLE:
					{
					alt8=2;
					}
					break;
				case EXTENDS:
					{
					alt8=3;
					}
					break;
				case DEPRECATED:
					{
					alt8=4;
					}
					break;
				case BEAN:
					{
					alt8=5;
					}
					break;
				}
				switch (alt8) {
				case 1 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:101:13: addressableAnnotation
					{
					pushFollow(FOLLOW_addressableAnnotation_in_crudTypeExpr662);
					addressableAnnotation3=addressableAnnotation();
					state._fsp--;


					                crudTypeExpr_stack.peek().addressable = (addressableAnnotation3!=null?((TTreePython_TTreeShared.addressableAnnotation_return)addressableAnnotation3).result:null);
					            
					}
					break;
				case 2 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:104:13: storableAnnotation
					{
					pushFollow(FOLLOW_storableAnnotation_in_crudTypeExpr678);
					storableAnnotation4=storableAnnotation();
					state._fsp--;


					                crudTypeExpr_stack.peek().storable = (storableAnnotation4!=null?((TTreePython_TTreeShared.storableAnnotation_return)storableAnnotation4).result:null);
					            
					}
					break;
				case 3 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:107:13: extendsAnnotation
					{
					pushFollow(FOLLOW_extendsAnnotation_in_crudTypeExpr694);
					extendsAnnotation5=extendsAnnotation();
					state._fsp--;


					                crudTypeExpr_stack.peek().extend = (extendsAnnotation5!=null?((TTreePython_TTreeShared.extendsAnnotation_return)extendsAnnotation5).result:null);
					            
					}
					break;
				case 4 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:110:13: deprecatedAnnotation
					{
					pushFollow(FOLLOW_deprecatedAnnotation_in_crudTypeExpr710);
					deprecatedAnnotation6=deprecatedAnnotation();
					state._fsp--;


					                crudTypeExpr_stack.peek().deprecated = (deprecatedAnnotation6!=null?((TTreePython_TTreeShared.deprecatedAnnotation_return)deprecatedAnnotation6).result:null);
					            
					}
					break;
				case 5 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:113:13: beanAnnotation
					{
					pushFollow(FOLLOW_beanAnnotation_in_crudTypeExpr726);
					beanAnnotation7=beanAnnotation();
					state._fsp--;


					                crudTypeExpr_stack.peek().bean = (beanAnnotation7!=null?((TTreePython_TTreeShared.beanAnnotation_return)beanAnnotation7).result:null);
					            
					}
					break;

				default :
					break loop8;
				}
			}

			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:117:9: ( crudPackageAnnotation )?
			int alt9=2;
			int LA9_0 = input.LA(1);
			if ( (LA9_0==CRUDPACKAGEANNOTATION) ) {
				alt9=1;
			}
			switch (alt9) {
				case 1 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:117:9: crudPackageAnnotation
					{
					pushFollow(FOLLOW_crudPackageAnnotation_in_crudTypeExpr749);
					crudPackageAnnotation();
					state._fsp--;

					}
					break;

			}

			name=(CommonTree)match(input,ID,FOLLOW_ID_in_crudTypeExpr754); 
			 crudTypeExpr_stack.peek().crudTypeName = (name!=null?name.getText():null); 
			pushFollow(FOLLOW_crudTypeInfo_in_crudTypeExpr758);
			crudTypeInfo();
			state._fsp--;

			pushFollow(FOLLOW_typeFields_in_crudTypeExpr760);
			typeFields();
			state._fsp--;

			match(input, Token.UP, null); 


			    // We need to generate
			    // (2) A special API subsection for this type (with get, put, delete, getChildren type calls) (so that should be registerd in the same way as an API)
			    // (4) Potentially a nice client set of classes to make it easier to interact with this type

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			crudTypeExpr_stack.pop();
		}
		return retval;
	}
	// $ANTLR end "crudTypeExpr"


	public static class crudPackageAnnotation_return extends TreeRuleReturnScope {
		public String pkg;
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "crudPackageAnnotation"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:124:1: crudPackageAnnotation returns [String pkg] : ^( CRUDPACKAGEANNOTATION p= PACKAGENAME ) ;
	public final TTreePython.crudPackageAnnotation_return crudPackageAnnotation() throws RecognitionException {
		TTreePython.crudPackageAnnotation_return retval = new TTreePython.crudPackageAnnotation_return();
		retval.start = input.LT(1);

		CommonTree p=null;

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:124:43: ( ^( CRUDPACKAGEANNOTATION p= PACKAGENAME ) )
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:125:5: ^( CRUDPACKAGEANNOTATION p= PACKAGENAME )
			{
			match(input,CRUDPACKAGEANNOTATION,FOLLOW_CRUDPACKAGEANNOTATION_in_crudPackageAnnotation780); 
			match(input, Token.DOWN, null); 
			p=(CommonTree)match(input,PACKAGENAME,FOLLOW_PACKAGENAME_in_crudPackageAnnotation784); 
			match(input, Token.UP, null); 

			 retval.pkg = (p!=null?p.getText():null); 
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "crudPackageAnnotation"


	public static class crudTypeInfo_return extends TreeRuleReturnScope {
		public List storageAdders;
		public List builderAdders;
		public List builderEntries;
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "crudTypeInfo"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:128:1: crudTypeInfo returns [List storageAdders, List builderAdders, List builderEntries] : ^( CRUDINFO ( crudDirective )* ) ;
	public final TTreePython.crudTypeInfo_return crudTypeInfo() throws RecognitionException {
		TTreePython.crudTypeInfo_return retval = new TTreePython.crudTypeInfo_return();
		retval.start = input.LT(1);

		 retval.storageAdders = new ArrayList(); retval.builderAdders = new ArrayList(); retval.builderEntries = new ArrayList(); 
		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:130:5: ( ^( CRUDINFO ( crudDirective )* ) )
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:130:7: ^( CRUDINFO ( crudDirective )* )
			{
			match(input,CRUDINFO,FOLLOW_CRUDINFO_in_crudTypeInfo812); 
			if ( input.LA(1)==Token.DOWN ) {
				match(input, Token.DOWN, null); 
				// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:130:18: ( crudDirective )*
				loop10:
				while (true) {
					int alt10=2;
					int LA10_0 = input.LA(1);
					if ( (LA10_0==CRUDINFOENTRY) ) {
						alt10=1;
					}

					switch (alt10) {
					case 1 :
						// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:130:19: crudDirective
						{
						pushFollow(FOLLOW_crudDirective_in_crudTypeInfo815);
						crudDirective();
						state._fsp--;

						 
						}
						break;

					default :
						break loop10;
					}
				}

				match(input, Token.UP, null); 
			}

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "crudTypeInfo"


	public static class crudDirective_return extends TreeRuleReturnScope {
		public StringTemplate storageAdder;
		public StringTemplate storageBuilder;
		public StringTemplate builderAdder;
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "crudDirective"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:132:1: crudDirective returns [StringTemplate storageAdder, StringTemplate storageBuilder, StringTemplate builderAdder] : ^( CRUDINFOENTRY n= ID ) ;
	public final TTreePython.crudDirective_return crudDirective() throws RecognitionException {
		TTreePython.crudDirective_return retval = new TTreePython.crudDirective_return();
		retval.start = input.LT(1);

		CommonTree n=null;

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:132:113: ( ^( CRUDINFOENTRY n= ID ) )
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:132:115: ^( CRUDINFOENTRY n= ID )
			{
			match(input,CRUDINFOENTRY,FOLLOW_CRUDINFOENTRY_in_crudDirective833); 
			match(input, Token.DOWN, null); 
			n=(CommonTree)match(input,ID,FOLLOW_ID_in_crudDirective837); 
			match(input, Token.UP, null); 

			 
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "crudDirective"


	public static class apilist_return extends TreeRuleReturnScope {
		public List fns;
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "apilist"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:138:1: apilist returns [List fns] : (a= apistmt )+ ;
	public final TTreePython.apilist_return apilist() throws RecognitionException {
		TTreePython.apilist_return retval = new TTreePython.apilist_return();
		retval.start = input.LT(1);

		TreeRuleReturnScope a =null;


			retval.fns = new ArrayList();
			
		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:142:3: ( (a= apistmt )+ )
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:142:3: (a= apistmt )+
			{
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:142:3: (a= apistmt )+
			int cnt11=0;
			loop11:
			while (true) {
				int alt11=2;
				int LA11_0 = input.LA(1);
				if ( (LA11_0==APIENTRY) ) {
					alt11=1;
				}

				switch (alt11) {
				case 1 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:142:4: a= apistmt
					{
					pushFollow(FOLLOW_apistmt_in_apilist862);
					a=apistmt();
					state._fsp--;


							retval.fns.add((a!=null?((TTreePython.apistmt_return)a).apiFunc:null));
					   
					}
					break;

				default :
					if ( cnt11 >= 1 ) break loop11;
					EarlyExitException eee = new EarlyExitException(11, input);
					throw eee;
				}
				cnt11++;
			}

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "apilist"


	public static class deprecatedAspect_return extends TreeRuleReturnScope {
		public String reason;
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "deprecatedAspect"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:146:1: deprecatedAspect returns [String reason] : ( ( DEPRECATED ID ) | ( DEPRECATED STRING ) );
	public final TTreePython.deprecatedAspect_return deprecatedAspect() throws RecognitionException {
		TTreePython.deprecatedAspect_return retval = new TTreePython.deprecatedAspect_return();
		retval.start = input.LT(1);

		CommonTree ID8=null;
		CommonTree STRING9=null;

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:148:5: ( ( DEPRECATED ID ) | ( DEPRECATED STRING ) )
			int alt12=2;
			int LA12_0 = input.LA(1);
			if ( (LA12_0==DEPRECATED) ) {
				int LA12_1 = input.LA(2);
				if ( (LA12_1==ID) ) {
					alt12=1;
				}
				else if ( (LA12_1==STRING) ) {
					alt12=2;
				}

				else {
					int nvaeMark = input.mark();
					try {
						input.consume();
						NoViableAltException nvae =
							new NoViableAltException("", 12, 1, input);
						throw nvae;
					} finally {
						input.rewind(nvaeMark);
					}
				}

			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 12, 0, input);
				throw nvae;
			}

			switch (alt12) {
				case 1 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:148:7: ( DEPRECATED ID )
					{
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:148:7: ( DEPRECATED ID )
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:148:9: DEPRECATED ID
					{
					match(input,DEPRECATED,FOLLOW_DEPRECATED_in_deprecatedAspect890); 
					ID8=(CommonTree)match(input,ID,FOLLOW_ID_in_deprecatedAspect892); 
					 retval.reason = (ID8!=null?ID8.getText():null); 
					}

					}
					break;
				case 2 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:149:7: ( DEPRECATED STRING )
					{
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:149:7: ( DEPRECATED STRING )
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:149:9: DEPRECATED STRING
					{
					match(input,DEPRECATED,FOLLOW_DEPRECATED_in_deprecatedAspect907); 
					STRING9=(CommonTree)match(input,STRING,FOLLOW_STRING_in_deprecatedAspect909); 
					 retval.reason = (STRING9!=null?STRING9.getText():null).substring(1, (STRING9!=null?STRING9.getText():null).length() -1); 
					}

					}
					break;

			}
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "deprecatedAspect"


	public static class visibility_return extends TreeRuleReturnScope {
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "visibility"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:152:1: visibility : ( PRIVATEVIS | PUBLICVIS );
	public final TTreePython.visibility_return visibility() throws RecognitionException {
		TTreePython.visibility_return retval = new TTreePython.visibility_return();
		retval.start = input.LT(1);

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:152:12: ( PRIVATEVIS | PUBLICVIS )
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:
			{
			if ( (input.LA(1) >= PRIVATEVIS && input.LA(1) <= PUBLICVIS) ) {
				input.consume();
				state.errorRecovery=false;
			}
			else {
				MismatchedSetException mse = new MismatchedSetException(null,input);
				throw mse;
			}
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "visibility"


	public static class apistmt_return extends TreeRuleReturnScope {
		public StringTemplate apiFunc;
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "apistmt"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:158:1: apistmt returns [StringTemplate apiFunc] : ^( APIENTRY DOC ^( ENTITLEASPECT (rent= REGULARENTITLE )+ (k= ID v= ID )* ) (deprecated= deprecatedAspect )? ^( VISIBILITY visibility ) ^( RETTYPE vartype ) ^( FNNAME name= ID ) p= paramList ) ;
	public final TTreePython.apistmt_return apistmt() throws RecognitionException {
		TTreePython.apistmt_return retval = new TTreePython.apistmt_return();
		retval.start = input.LT(1);

		CommonTree rent=null;
		CommonTree k=null;
		CommonTree v=null;
		CommonTree name=null;
		CommonTree DOC10=null;
		TreeRuleReturnScope deprecated =null;
		TreeRuleReturnScope p =null;
		TreeRuleReturnScope vartype11 =null;

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:159:3: ( ^( APIENTRY DOC ^( ENTITLEASPECT (rent= REGULARENTITLE )+ (k= ID v= ID )* ) (deprecated= deprecatedAspect )? ^( VISIBILITY visibility ) ^( RETTYPE vartype ) ^( FNNAME name= ID ) p= paramList ) )
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:159:3: ^( APIENTRY DOC ^( ENTITLEASPECT (rent= REGULARENTITLE )+ (k= ID v= ID )* ) (deprecated= deprecatedAspect )? ^( VISIBILITY visibility ) ^( RETTYPE vartype ) ^( FNNAME name= ID ) p= paramList )
			{
			match(input,APIENTRY,FOLLOW_APIENTRY_in_apistmt949); 
			match(input, Token.DOWN, null); 
			DOC10=(CommonTree)match(input,DOC,FOLLOW_DOC_in_apistmt951); 
			match(input,ENTITLEASPECT,FOLLOW_ENTITLEASPECT_in_apistmt955); 
			match(input, Token.DOWN, null); 
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:159:35: (rent= REGULARENTITLE )+
			int cnt13=0;
			loop13:
			while (true) {
				int alt13=2;
				int LA13_0 = input.LA(1);
				if ( (LA13_0==REGULARENTITLE) ) {
					alt13=1;
				}

				switch (alt13) {
				case 1 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:159:36: rent= REGULARENTITLE
					{
					rent=(CommonTree)match(input,REGULARENTITLE,FOLLOW_REGULARENTITLE_in_apistmt960); 
					}
					break;

				default :
					if ( cnt13 >= 1 ) break loop13;
					EarlyExitException eee = new EarlyExitException(13, input);
					throw eee;
				}
				cnt13++;
			}

			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:159:58: (k= ID v= ID )*
			loop14:
			while (true) {
				int alt14=2;
				int LA14_0 = input.LA(1);
				if ( (LA14_0==ID) ) {
					alt14=1;
				}

				switch (alt14) {
				case 1 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:159:59: k= ID v= ID
					{
					k=(CommonTree)match(input,ID,FOLLOW_ID_in_apistmt967); 
					v=(CommonTree)match(input,ID,FOLLOW_ID_in_apistmt971); 
					}
					break;

				default :
					break loop14;
				}
			}

			match(input, Token.UP, null); 

			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:159:82: (deprecated= deprecatedAspect )?
			int alt15=2;
			int LA15_0 = input.LA(1);
			if ( (LA15_0==DEPRECATED) ) {
				alt15=1;
			}
			switch (alt15) {
				case 1 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:159:82: deprecated= deprecatedAspect
					{
					pushFollow(FOLLOW_deprecatedAspect_in_apistmt978);
					deprecated=deprecatedAspect();
					state._fsp--;

					}
					break;

			}

			match(input,VISIBILITY,FOLLOW_VISIBILITY_in_apistmt982); 
			match(input, Token.DOWN, null); 
			pushFollow(FOLLOW_visibility_in_apistmt984);
			visibility();
			state._fsp--;

			match(input, Token.UP, null); 

			match(input,RETTYPE,FOLLOW_RETTYPE_in_apistmt988); 
			match(input, Token.DOWN, null); 
			pushFollow(FOLLOW_vartype_in_apistmt990);
			vartype11=vartype();
			state._fsp--;

			match(input, Token.UP, null); 

			match(input,FNNAME,FOLLOW_FNNAME_in_apistmt994); 
			match(input, Token.DOWN, null); 
			name=(CommonTree)match(input,ID,FOLLOW_ID_in_apistmt998); 
			match(input, Token.UP, null); 

			pushFollow(FOLLOW_paramList_in_apistmt1003);
			p=paramList();
			state._fsp--;

			match(input, Token.UP, null); 


			      // Formatting for params and version in comment string
			      String d = DOC10.getText();
			      d = d.substring(1,d.length()-1);
			      if(d.length() > 0){
			          d = formatDoc(d);
			      }

			      retval.apiFunc = templateLib.getInstanceOf("PythonApiFn",new STAttrMap().put("sdkName", sdkName).put("apitype", apiExpr_stack.peek().apiName).put("name", (name!=null?name.getText():null)).put("apiParams", (p!=null?((TTreePython.paramList_return)p).apiParams:null)).put("setterParams", (p!=null?((TTreePython.paramList_return)p).setterParams:null)).put("ret",  (vartype11!=null?((TTreePython.vartype_return)vartype11).pythonType:null)).put("comment",  d ).put("deprecated", (deprecated!=null?((TTreePython.deprecatedAspect_return)deprecated).reason:null)));
					
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "apistmt"


	public static class paramList_return extends TreeRuleReturnScope {
		public List apiParams;
		public List setterParams;
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "paramList"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:170:1: paramList returns [List apiParams, List setterParams] : ^( PARAMS (a= param )* ) ;
	public final TTreePython.paramList_return paramList() throws RecognitionException {
		TTreePython.paramList_return retval = new TTreePython.paramList_return();
		retval.start = input.LT(1);

		TreeRuleReturnScope a =null;


			retval.apiParams = new ArrayList();
			retval.setterParams = new ArrayList();

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:175:2: ( ^( PARAMS (a= param )* ) )
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:176:2: ^( PARAMS (a= param )* )
			{
			match(input,PARAMS,FOLLOW_PARAMS_in_paramList1025); 
			if ( input.LA(1)==Token.DOWN ) {
				match(input, Token.DOWN, null); 
				// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:176:11: (a= param )*
				loop16:
				while (true) {
					int alt16=2;
					int LA16_0 = input.LA(1);
					if ( (LA16_0==PARAM) ) {
						alt16=1;
					}

					switch (alt16) {
					case 1 :
						// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:176:12: a= param
						{
						pushFollow(FOLLOW_param_in_paramList1030);
						a=param();
						state._fsp--;

						 
						 	retval.apiParams.add((a!=null?((TTreePython.param_return)a).apiParam:null)); 
						 	retval.setterParams.add((a!=null?((TTreePython.param_return)a).setterParam:null));
						 	
						}
						break;

					default :
						break loop16;
					}
				}

				match(input, Token.UP, null); 
			}

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "paramList"


	public static class param_return extends TreeRuleReturnScope {
		public StringTemplate apiParam;
		public StringTemplate setterParam;
		public StringTemplate st;
		public Object getTemplate() { return st; }
		public String toString() { return st==null?null:st.toString(); }
	};


	// $ANTLR start "param"
	// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:185:1: param returns [StringTemplate apiParam, StringTemplate setterParam] : ^( PARAM ^( TYPE t= vartype ) ^( NAME n= ID ) (b= BANG )? ) ;
	public final TTreePython.param_return param() throws RecognitionException {
		TTreePython.param_return retval = new TTreePython.param_return();
		retval.start = input.LT(1);

		CommonTree n=null;
		CommonTree b=null;
		TreeRuleReturnScope t =null;

		try {
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:185:68: ( ^( PARAM ^( TYPE t= vartype ) ^( NAME n= ID ) (b= BANG )? ) )
			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:185:70: ^( PARAM ^( TYPE t= vartype ) ^( NAME n= ID ) (b= BANG )? )
			{
			match(input,PARAM,FOLLOW_PARAM_in_param1056); 
			match(input, Token.DOWN, null); 
			match(input,TYPE,FOLLOW_TYPE_in_param1059); 
			match(input, Token.DOWN, null); 
			pushFollow(FOLLOW_vartype_in_param1063);
			t=vartype();
			state._fsp--;

			match(input, Token.UP, null); 

			match(input,NAME,FOLLOW_NAME_in_param1067); 
			match(input, Token.DOWN, null); 
			n=(CommonTree)match(input,ID,FOLLOW_ID_in_param1071); 
			match(input, Token.UP, null); 

			// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:185:110: (b= BANG )?
			int alt17=2;
			int LA17_0 = input.LA(1);
			if ( (LA17_0==BANG) ) {
				alt17=1;
			}
			switch (alt17) {
				case 1 :
					// /Users/amkimian/Development/cloud/Rapture/Libs/CodeGen/CodeGenLib/src/main/antlr3/com/incapture/rapgen/TTreePython.g:185:110: b= BANG
					{
					b=(CommonTree)match(input,BANG,FOLLOW_BANG_in_param1076); 
					}
					break;

			}

			match(input, Token.UP, null); 


			//   boolean val = (b!=null?b.getText():null) == null ? false : true;
			   String nonReservedName = ensureNotReserved((n!=null?n.getText():null));
			   retval.apiParam = templateLib.getInstanceOf("PythonApiParam",new STAttrMap().put("type", (t!=null?((TTreePython.vartype_return)t).pythonType:null)).put("name", nonReservedName));
			   retval.setterParam = templateLib.getInstanceOf("PythonApiSetter",new STAttrMap().put("type", (t!=null?((TTreePython.vartype_return)t).pythonType:null)).put("paramName", (n!=null?n.getText():null)).put("name", nonReservedName));
				 
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
	// $ANTLR end "param"

	// Delegated rules
	public TTreePython_TTreeShared.extendsAnnotation_return extendsAnnotation() throws RecognitionException { return gTTreeShared.extendsAnnotation(); }

	public TTreePython_TTreeShared.deprecatedAnnotation_return deprecatedAnnotation() throws RecognitionException { return gTTreeShared.deprecatedAnnotation(); }

	public TTreePython_TTreeShared.beanAnnotation_return beanAnnotation() throws RecognitionException { return gTTreeShared.beanAnnotation(); }

	public TTreePython_TTreeShared.sdkExpr_return sdkExpr() throws RecognitionException { return gTTreeShared.sdkExpr(); }

	public TTreePython_TTreeShared.cacheableAnnotation_return cacheableAnnotation() throws RecognitionException { return gTTreeShared.cacheableAnnotation(); }

	public TTreePython_TTreeShared.addressableAnnotation_return addressableAnnotation() throws RecognitionException { return gTTreeShared.addressableAnnotation(); }

	public TTreePython_TTreeShared.storableAnnotation_return storableAnnotation() throws RecognitionException { return gTTreeShared.storableAnnotation(); }

	public TTreePython_TTreeShared.minVerExpr_return minVerExpr() throws RecognitionException { return gTTreeShared.minVerExpr(); }

	public TTreePython_TTreeShared.fieldConstructor_return fieldConstructor() throws RecognitionException { return gTTreeShared.fieldConstructor(); }

	public TTreePython_TTreeShared.versionExpr_return versionExpr() throws RecognitionException { return gTTreeShared.versionExpr(); }

	public TTreePython_TTreeShared.indexedAnnotation_return indexedAnnotation() throws RecognitionException { return gTTreeShared.indexedAnnotation(); }



	public static final BitSet FOLLOW_MAIN_in_hmxdef100 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_sdkExpr_in_hmxdef102 = new BitSet(new long[]{0x0000000000000000L,0x0000400000000000L});
	public static final BitSet FOLLOW_versionExpr_in_hmxdef107 = new BitSet(new long[]{0x0000000000000000L,0x0000000000800000L});
	public static final BitSet FOLLOW_minVerExpr_in_hmxdef109 = new BitSet(new long[]{0x0000000000000008L,0x00000000000E0000L});
	public static final BitSet FOLLOW_INNERT_in_hmxdef126 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_typeExpr_in_hmxdef128 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_INNERA_in_hmxdef145 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_apiExpr_in_hmxdef149 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_INNERC_in_hmxdef168 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_crudTypeExpr_in_hmxdef172 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_TYPEDEF_in_typeExpr208 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_DOC_in_typeExpr212 = new BitSet(new long[]{0x02000000A4080910L});
	public static final BitSet FOLLOW_beanAnnotation_in_typeExpr215 = new BitSet(new long[]{0x02000000A4080910L});
	public static final BitSet FOLLOW_cacheableAnnotation_in_typeExpr217 = new BitSet(new long[]{0x02000000A4080910L});
	public static final BitSet FOLLOW_extendsAnnotation_in_typeExpr219 = new BitSet(new long[]{0x02000000A4080910L});
	public static final BitSet FOLLOW_deprecatedAnnotation_in_typeExpr221 = new BitSet(new long[]{0x02000000A4080910L});
	public static final BitSet FOLLOW_addressableAnnotation_in_typeExpr223 = new BitSet(new long[]{0x02000000A4080910L});
	public static final BitSet FOLLOW_storableAnnotation_in_typeExpr225 = new BitSet(new long[]{0x02000000A4080910L});
	public static final BitSet FOLLOW_indexedAnnotation_in_typeExpr227 = new BitSet(new long[]{0x02000000A4080910L});
	public static final BitSet FOLLOW_ID_in_typeExpr235 = new BitSet(new long[]{0x0000000000000000L,0x0000040000000000L});
	public static final BitSet FOLLOW_typeAspect_in_typeExpr237 = new BitSet(new long[]{0x0000000000000000L,0x0000100000000000L});
	public static final BitSet FOLLOW_typeFields_in_typeExpr239 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_TYPEASPECT_in_typeAspect261 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_PACKAGENAME_in_typeAspect265 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_TYPEFIELDS_in_typeFields285 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_typeFieldDef_in_typeFields288 = new BitSet(new long[]{0x0000000000000008L,0x0000200000000000L});
	public static final BitSet FOLLOW_TYPEMEMBER_in_typeFieldDef311 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_TYPE_in_typeFieldDef314 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_vartype_in_typeFieldDef316 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_NAME_in_typeFieldDef320 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_ID_in_typeFieldDef324 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_FIELD_CONSTRUCTOR_in_typeFieldDef328 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_fieldConstructor_in_typeFieldDef330 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_RAW_in_vartype353 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_INTTYPE_in_vartype355 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_RAW_in_vartype367 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_LONGTYPE_in_vartype369 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_RAW_in_vartype381 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_OBJECTTYPE_in_vartype383 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_RAW_in_vartype395 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_LONGCTYPE_in_vartype397 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_RAW_in_vartype409 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_DATETYPE_in_vartype411 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_RAW_in_vartype423 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_BOOLTYPE_in_vartype425 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_RAW_in_vartype437 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_DOUBLETYPE_in_vartype439 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_RAW_in_vartype451 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_STRINGTYPE_in_vartype453 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_RAW_in_vartype465 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_BYTEARRAYTYPE_in_vartype467 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_RAW_in_vartype479 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_VOIDTYPE_in_vartype481 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_LISTTYPE_in_vartype493 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_vartype_in_vartype497 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_SETTYPE_in_vartype509 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_vartype_in_vartype513 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_MAPTYPE_in_vartype525 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_vartype_in_vartype529 = new BitSet(new long[]{0x0080010800000000L,0x0000000020000020L});
	public static final BitSet FOLLOW_vartype_in_vartype533 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_COMPLEX_in_vartype546 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_ID_in_vartype550 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_APISEC_in_apiExpr595 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_DOC_in_apiExpr597 = new BitSet(new long[]{0x0000000020080000L});
	public static final BitSet FOLLOW_deprecatedAspect_in_apiExpr601 = new BitSet(new long[]{0x0000000020000000L});
	public static final BitSet FOLLOW_ID_in_apiExpr606 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000004L});
	public static final BitSet FOLLOW_apilist_in_apiExpr613 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_CRUDTYPEDEF_in_crudTypeExpr634 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_DOC_in_crudTypeExpr638 = new BitSet(new long[]{0x0200000024080110L,0x0000000000000100L});
	public static final BitSet FOLLOW_addressableAnnotation_in_crudTypeExpr662 = new BitSet(new long[]{0x0200000024080110L,0x0000000000000100L});
	public static final BitSet FOLLOW_storableAnnotation_in_crudTypeExpr678 = new BitSet(new long[]{0x0200000024080110L,0x0000000000000100L});
	public static final BitSet FOLLOW_extendsAnnotation_in_crudTypeExpr694 = new BitSet(new long[]{0x0200000024080110L,0x0000000000000100L});
	public static final BitSet FOLLOW_deprecatedAnnotation_in_crudTypeExpr710 = new BitSet(new long[]{0x0200000024080110L,0x0000000000000100L});
	public static final BitSet FOLLOW_beanAnnotation_in_crudTypeExpr726 = new BitSet(new long[]{0x0200000024080110L,0x0000000000000100L});
	public static final BitSet FOLLOW_crudPackageAnnotation_in_crudTypeExpr749 = new BitSet(new long[]{0x0000000020000000L});
	public static final BitSet FOLLOW_ID_in_crudTypeExpr754 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000040L});
	public static final BitSet FOLLOW_crudTypeInfo_in_crudTypeExpr758 = new BitSet(new long[]{0x0000000000000000L,0x0000100000000000L});
	public static final BitSet FOLLOW_typeFields_in_crudTypeExpr760 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_CRUDPACKAGEANNOTATION_in_crudPackageAnnotation780 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_PACKAGENAME_in_crudPackageAnnotation784 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_CRUDINFO_in_crudTypeInfo812 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_crudDirective_in_crudTypeInfo815 = new BitSet(new long[]{0x0000000000000008L,0x0000000000000080L});
	public static final BitSet FOLLOW_CRUDINFOENTRY_in_crudDirective833 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_ID_in_crudDirective837 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_apistmt_in_apilist862 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000004L});
	public static final BitSet FOLLOW_DEPRECATED_in_deprecatedAspect890 = new BitSet(new long[]{0x0000000020000000L});
	public static final BitSet FOLLOW_ID_in_deprecatedAspect892 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_DEPRECATED_in_deprecatedAspect907 = new BitSet(new long[]{0x1000000000000000L});
	public static final BitSet FOLLOW_STRING_in_deprecatedAspect909 = new BitSet(new long[]{0x0000000000000002L});
	public static final BitSet FOLLOW_APIENTRY_in_apistmt949 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_DOC_in_apistmt951 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000400L});
	public static final BitSet FOLLOW_ENTITLEASPECT_in_apistmt955 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_REGULARENTITLE_in_apistmt960 = new BitSet(new long[]{0x0004000020000008L});
	public static final BitSet FOLLOW_ID_in_apistmt967 = new BitSet(new long[]{0x0000000020000000L});
	public static final BitSet FOLLOW_ID_in_apistmt971 = new BitSet(new long[]{0x0000000020000008L});
	public static final BitSet FOLLOW_deprecatedAspect_in_apistmt978 = new BitSet(new long[]{0x0000000000000000L,0x0000800000000000L});
	public static final BitSet FOLLOW_VISIBILITY_in_apistmt982 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_visibility_in_apistmt984 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_RETTYPE_in_apistmt988 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_vartype_in_apistmt990 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_FNNAME_in_apistmt994 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_ID_in_apistmt998 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_paramList_in_apistmt1003 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_PARAMS_in_paramList1025 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_param_in_paramList1030 = new BitSet(new long[]{0x0000000000000008L,0x0000000002000000L});
	public static final BitSet FOLLOW_PARAM_in_param1056 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_TYPE_in_param1059 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_vartype_in_param1063 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_NAME_in_param1067 = new BitSet(new long[]{0x0000000000000004L});
	public static final BitSet FOLLOW_ID_in_param1071 = new BitSet(new long[]{0x0000000000000008L});
	public static final BitSet FOLLOW_BANG_in_param1076 = new BitSet(new long[]{0x0000000000000008L});
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy