/* Generated by Nim Compiler v0.12.0 */
/*   (c) 2015 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 64

#include "nimbase.h"
#include <string.h>
#include <stdio.h>
typedef struct Tnode225809 Tnode225809;
typedef struct Tparsers253035 Tparsers253035;
typedef struct Tparser241205 Tparser241205;
typedef struct Tlexer216185 Tlexer216185;
typedef struct Tbaselexer214024 Tbaselexer214024;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Tllstream213204 Tllstream213204;
typedef struct Tlineinfo190352 Tlineinfo190352;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Ttoken216181 Ttoken216181;
typedef struct Tident198021 Tident198021;
typedef struct Ttype225847 Ttype225847;
typedef struct Tsym225841 Tsym225841;
typedef struct Tnodeseq225803 Tnodeseq225803;
typedef struct Tidobj198015 Tidobj198015;
typedef struct Ttypeseq225843 Ttypeseq225843;
typedef struct Tloc225823 Tloc225823;
typedef struct Ropeobj176009 Ropeobj176009;
typedef struct Tscope225835 Tscope225835;
typedef struct TY225944 TY225944;
typedef struct Tstrtable225813 Tstrtable225813;
typedef struct Tsymseq225811 Tsymseq225811;
typedef struct Tlib225827 Tlib225827;
typedef struct Tinstantiation225831 Tinstantiation225831;
typedef struct Tlistentry140022 Tlistentry140022;
typedef struct TY225932 TY225932;
typedef N_NIMCALL_PTR(void, TY3889) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3894) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3889 marker;
TY3894 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tbaselexer214024  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Tllstream213204* stream;
NI linenumber;
NI sentinel;
NI linestart;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (Tlineinfo190352 info, NU16 msg, NimStringDesc* arg, void* ClEnv);
void* ClEnv;
} Terrorhandler216183;
struct  Tlexer216185  {
  Tbaselexer214024 Sup;
NI32 fileidx;
NI indentahead;
NI currlineindent;
NIM_BOOL strongspaces;
Terrorhandler216183 errorhandler;
};
struct  Ttoken216181  {
NU8 toktype;
NI indent;
Tident198021* ident;
NI64 inumber;
NF fnumber;
NU8 base;
NI8 strongspacea;
NI8 strongspaceb;
NimStringDesc* literal;
NI line;
NI col;
};
struct  Tparser241205  {
NI currind;
NIM_BOOL firsttok;
NIM_BOOL strongspaces;
Tlexer216185 lex;
Ttoken216181 tok;
NI inpragma;
NI insemistmtlist;
};
struct  Tparsers253035  {
NU8 skin;
Tparser241205 parser;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tlineinfo190352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tnode225809  {
Ttype225847* typ;
Tlineinfo190352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym225841* sym;
} S4;
struct {Tident198021* ident;
} S5;
struct {Tnodeseq225803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
typedef NimStringDesc* TY253028[4];
typedef NimStringDesc* TY253022[4];
struct  Tidobj198015  {
  TNimObject Sup;
NI id;
};
struct  Tident198021  {
  Tidobj198015 Sup;
NimStringDesc* s;
Tident198021* next;
NI h;
};
typedef NimStringDesc* TY253724[1];
struct  Tllstream213204  {
  TNimObject Sup;
NU8 kind;
FILE* f;
NimStringDesc* s;
NI rd;
NI wr;
NI lineoffset;
};
struct  Tloc225823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype225847* t;
Ropeobj176009* r;
Ropeobj176009* heaproot;
};
struct  Ttype225847  {
  Tidobj198015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq225843* sons;
Tnode225809* n;
Tsym225841* owner;
Tsym225841* sym;
Tsym225841* destructor;
Tsym225841* deepcopy;
Tsym225841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc225823 loc;
};
struct  Tstrtable225813  {
NI counter;
Tsymseq225811* data;
};
struct  Tsym225841  {
  Tidobj198015 Sup;
NU8 kind;
union{
struct {Ttypeseq225843* typeinstcache;
Tscope225835* typscope;
} S1;
struct {TY225944* procinstcache;
Tsym225841* gcunsafetyreason;
} S2;
struct {TY225944* usedgenerics;
Tstrtable225813 tab;
} S3;
struct {Tsym225841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype225847* typ;
Tident198021* name;
Tlineinfo190352 info;
Tsym225841* owner;
NU32 flags;
Tnode225809* ast;
NU32 options;
NI position;
NI offset;
Tloc225823 loc;
Tlib225827* annex;
Tnode225809* constraint;
};
struct  Ropeobj176009  {
  TNimObject Sup;
Ropeobj176009* left;
Ropeobj176009* right;
NI length;
NimStringDesc* data;
};
struct  Tscope225835  {
NI depthlevel;
Tstrtable225813 symbols;
Tnodeseq225803* usingsyms;
Tscope225835* parent;
};
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tlib225827  {
  Tlistentry140022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj176009* name;
Tnode225809* path;
};
struct  Tinstantiation225831  {
Tsym225841* sym;
Ttypeseq225843* concretetypes;
TY225932* usedby;
NI compilesid;
};
struct Tnodeseq225803 {
  TGenericSeq Sup;
  Tnode225809* data[SEQ_DECL_SIZE];
};
struct Ttypeseq225843 {
  TGenericSeq Sup;
  Ttype225847* data[SEQ_DECL_SIZE];
};
struct TY225944 {
  TGenericSeq Sup;
  Tinstantiation225831* data[SEQ_DECL_SIZE];
};
struct Tsymseq225811 {
  TGenericSeq Sup;
  Tsym225841* data[SEQ_DECL_SIZE];
};
struct TY225932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, objectInit)(void* dest, TNimType* typ);
N_NIMCALL(NimStringDesc*, tofullpathconsiderdirty_191807)(NI32 fileidx);
N_NIMCALL(NIM_BOOL, open_16803)(FILE** f, NimStringDesc* filename, NU8 mode, NI bufsize);
N_NIMCALL(void, rawmessage_194636)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, openparsers_253047)(Tparsers253035* p, NI32 fileidx, Tllstream213204* inputstream);
N_NIMCALL(Tnode225809*, parsepipe_253170)(NimStringDesc* filename, Tllstream213204* inputstream);
N_NIMCALL(Tllstream213204*, llstreamopen_213256)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_NIMCALL(NIM_BOOL, llstreamreadline_213610)(Tllstream213204* s, NimStringDesc** line);
N_NIMCALL(NI, utf8bom_253122)(NimStringDesc* s);
N_NIMCALL(NIM_BOOL, containsshebang_253132)(NimStringDesc* s, NI i);
N_NIMCALL(void, message_196161)(Tlineinfo190352 info, NU16 msg, NimStringDesc* arg);
static N_INLINE(Tlineinfo190352, newlineinfo_191278)(NimStringDesc* filename, NI line, NI col);
N_NIMCALL(Tlineinfo190352, newlineinfo_191266)(NI32 fileinfoidx, NI line, NI col);
N_NIMCALL(NI32, fileinfoidx_191253)(NimStringDesc* filename);
N_NIMCALL(void, openparser_241424)(Tparser241205* p, NimStringDesc* filename, Tllstream213204* inputstream, NIM_BOOL strongspaces);
N_NIMCALL(Tllstream213204*, llstreamopen_213220)(NimStringDesc* data);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI start);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI first);
N_NIMCALL(Tnode225809*, parseall_241216)(Tparser241205* p);
N_NIMCALL(void, closeparser_241223)(Tparser241205* p);
N_NIMCALL(void, llstreamclose_213310)(Tllstream213204* s);
N_NIMCALL(Tllstream213204*, evalpipe_253732)(Tparsers253035* p, Tnode225809* n, NimStringDesc* filename, Tllstream213204* start);
N_NIMCALL(NIM_BOOL, identeq_198484)(Tident198021* id, NimStringDesc* name);
N_NIMCALL(Tllstream213204*, applyfilter_253689)(Tparsers253035* p, Tnode225809* n, NimStringDesc* filename, Tllstream213204* stdin_253695);
N_NIMCALL(Tident198021*, getcallee_253647)(Tnode225809* n);
N_NIMCALL(NimStringDesc*, rendertree_247059)(Tnode225809* n, NU8 renderflags);
N_NIMCALL(NU8, getfilter_253260)(Tident198021* ident);
N_NIMCALL(NU8, getparser_253447)(Tident198021* ident);
N_NIMCALL(Tllstream213204*, filtertmpl_252009)(Tllstream213204* stdin_252011, NimStringDesc* filename, Tnode225809* call);
N_NIMCALL(Tllstream213204*, filterstrip_251012)(Tllstream213204* stdin_251014, NimStringDesc* filename, Tnode225809* call);
N_NIMCALL(Tllstream213204*, filterreplace_251004)(Tllstream213204* stdin_251006, NimStringDesc* filename, Tnode225809* call);
N_NIMCALL(void, rawmessage_193675)(NU16 msg, NimStringDesc** args, NI argsLen0);
N_NIMCALL(void, msgwriteln_191915)(NimStringDesc* s, NU8 flags);
N_NIMCALL(void, openparser_241409)(Tparser241205* p, NI32 fileidx, Tllstream213204* inputstream, NIM_BOOL strongspaces);
N_NIMCALL(Tllstream213204*, llstreamopen_213238)(FILE* f);
N_NIMCALL(Tnode225809*, parseall_253063)(Tparsers253035* p);
N_NIMCALL(Tnode225809*, parseall_246009)(Tparser241205* p);
N_NIMCALL(void, internalerror_196191)(NimStringDesc* errmsg);
N_NIMCALL(void, closeparsers_253056)(Tparsers253035* p);
N_NIMCALL(Tnode225809*, parsetoplevelstmt_241230)(Tparser241205* p);
N_NIMCALL(Tnode225809*, parsetoplevelstmt_246020)(Tparser241205* p);
STRING_LITERAL(TMP1200, "use \'#?\' instead; \'#!\'", 22);
STRING_LITERAL(TMP1370, "|", 1);
STRING_LITERAL(TMP1480, "none", 4);
STRING_LITERAL(TMP1481, "stdtmpl", 7);
STRING_LITERAL(TMP1482, "replace", 7);
STRING_LITERAL(TMP1483, "strip", 5);
NIM_CONST TY253028 filternames_253025 = {((NimStringDesc*) &TMP1480),
((NimStringDesc*) &TMP1481),
((NimStringDesc*) &TMP1482),
((NimStringDesc*) &TMP1483)}
;
STRING_LITERAL(TMP1484, "standard", 8);
STRING_LITERAL(TMP1485, "strongspaces", 12);
STRING_LITERAL(TMP1486, "braces", 6);
STRING_LITERAL(TMP1487, "endx", 4);
NIM_CONST TY253022 parsernames_253019 = {((NimStringDesc*) &TMP1484),
((NimStringDesc*) &TMP1485),
((NimStringDesc*) &TMP1486),
((NimStringDesc*) &TMP1487)}
;
STRING_LITERAL(TMP1519, "parser to implement", 19);
TNimType NTI253035; /* TParsers */
TNimType NTI253007; /* TParserKind */
extern TNimType NTI241205; /* TParser */
extern Tnode225809* emptynode_226807;
extern NU64 gnotes_191395;

N_NIMCALL(NI, utf8bom_253122)(NimStringDesc* s) {
	NI result;
	result = 0;
	{
		NIM_BOOL LOC3;
		NIM_BOOL LOC4;
		LOC3 = 0;
		LOC4 = 0;
		LOC4 = ((NU8)(s->data[((NI) 0)]) == (NU8)(239));
		if (!(LOC4)) goto LA5;
		LOC4 = ((NU8)(s->data[((NI) 1)]) == (NU8)(187));
		LA5: ;
		LOC3 = LOC4;
		if (!(LOC3)) goto LA6;
		LOC3 = ((NU8)(s->data[((NI) 2)]) == (NU8)(191));
		LA6: ;
		if (!LOC3) goto LA7;
		result = ((NI) 3);
	}
	goto LA1;
	LA7: ;
	{
		result = ((NI) 0);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NIM_BOOL, containsshebang_253132)(NimStringDesc* s, NI i) {
	NIM_BOOL result;
	result = 0;
	{
		NIM_BOOL LOC3;
		NI j;
		LOC3 = 0;
		LOC3 = ((NU8)(s->data[i]) == (NU8)(35));
		if (!(LOC3)) goto LA4;
		LOC3 = ((NU8)(s->data[(NI)(i + ((NI) 1))]) == (NU8)(33));
		LA4: ;
		if (!LOC3) goto LA5;
		j = (NI)(i + ((NI) 2));
		{
			while (1) {
				if (!(((NU8)(s->data[j])) == ((NU8)(32)) || ((NU8)(s->data[j])) == ((NU8)(9)) || ((NU8)(s->data[j])) == ((NU8)(11)) || ((NU8)(s->data[j])) == ((NU8)(13)) || ((NU8)(s->data[j])) == ((NU8)(10)) || ((NU8)(s->data[j])) == ((NU8)(12)))) goto LA8;
				j += ((NI) 1);
			} LA8: ;
		}
		result = ((NU8)(s->data[j]) == (NU8)(47));
	}
	LA5: ;
	return result;
}

static N_INLINE(Tlineinfo190352, newlineinfo_191278)(NimStringDesc* filename, NI line, NI col) {
	Tlineinfo190352 result;
	NI32 LOC1;
	memset((void*)(&result), 0, sizeof(result));
	LOC1 = 0;
	LOC1 = fileinfoidx_191253(filename);
	result = newlineinfo_191266(LOC1, line, col);
	return result;
}

N_NIMCALL(Tnode225809*, parsepipe_253170)(NimStringDesc* filename, Tllstream213204* inputstream) {
	Tnode225809* result;
	Tllstream213204* s;
	result = 0;
	result = emptynode_226807;
	s = llstreamopen_213256(filename, ((NU8) 0));
	{
		NimStringDesc* line;
		NIM_BOOL LOC5;
		NI i;
		NI linenumber;
		if (!!((s == NIM_NIL))) goto LA3;
		line = rawNewString(((NI) 80));
		LOC5 = 0;
		LOC5 = llstreamreadline_213610(s, (&line));
		i = utf8bom_253122(line);
		linenumber = ((NI) 1);
		{
			NIM_BOOL LOC8;
			NIM_BOOL LOC11;
			LOC8 = 0;
			LOC8 = containsshebang_253132(line, i);
			if (!LOC8) goto LA9;
			LOC11 = 0;
			LOC11 = llstreamreadline_213610(s, (&line));
			i = ((NI) 0);
			linenumber += ((NI) 1);
		}
		LA9: ;
		{
			NIM_BOOL LOC14;
			Tparser241205 q;
			NimStringDesc* LOC25;
			Tllstream213204* LOC26;
			LOC14 = 0;
			LOC14 = ((NU8)(line->data[i]) == (NU8)(35));
			if (!(LOC14)) goto LA15;
			LOC14 = (((NU8)(line->data[(NI)(i + ((NI) 1))])) == ((NU8)(63)) || ((NU8)(line->data[(NI)(i + ((NI) 1))])) == ((NU8)(33)));
			LA15: ;
			if (!LOC14) goto LA16;
			{
				Tlineinfo190352 LOC22;
				if (!((NU8)(line->data[(NI)(i + ((NI) 1))]) == (NU8)(33))) goto LA20;
				LOC22 = newlineinfo_191278(filename, linenumber, ((NI) 1));
				message_196161(LOC22, ((NU16) 241), ((NimStringDesc*) &TMP1200));
			}
			LA20: ;
			i += ((NI) 2);
			{
				while (1) {
					if (!(((NU8)(line->data[i])) == ((NU8)(32)) || ((NU8)(line->data[i])) == ((NU8)(9)) || ((NU8)(line->data[i])) == ((NU8)(11)) || ((NU8)(line->data[i])) == ((NU8)(13)) || ((NU8)(line->data[i])) == ((NU8)(10)) || ((NU8)(line->data[i])) == ((NU8)(12)))) goto LA24;
					i += ((NI) 1);
				} LA24: ;
			}
			memset((void*)(&q), 0, sizeof(q));
			objectInit((&q), (&NTI241205));
			LOC25 = 0;
			LOC25 = copyStr(line, i);
			LOC26 = 0;
			LOC26 = llstreamopen_213220(LOC25);
			openparser_241424((&q), filename, LOC26, NIM_FALSE);
			result = parseall_241216((&q));
			closeparser_241223((&q));
		}
		LA16: ;
		llstreamclose_213310(s);
	}
	LA3: ;
	return result;
}

N_NIMCALL(Tident198021*, getcallee_253647)(Tnode225809* n) {
	Tident198021* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = ((*n).kind == ((NU8) 27) || (*n).kind == ((NU8) 29) || (*n).kind == ((NU8) 30) || (*n).kind == ((NU8) 31) || (*n).kind == ((NU8) 26) || (*n).kind == ((NU8) 28) || (*n).kind == ((NU8) 32));
		if (!(LOC3)) goto LA4;
		LOC3 = ((*(*n).kindU.S6.sons->data[((NI) 0)]).kind == ((NU8) 2));
		LA4: ;
		if (!LOC3) goto LA5;
		result = (*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S5.ident;
	}
	goto LA1;
	LA5: ;
	{
		if (!((*n).kind == ((NU8) 2))) goto LA8;
		result = (*n).kindU.S5.ident;
	}
	goto LA1;
	LA8: ;
	{
		NimStringDesc* LOC11;
		LOC11 = 0;
		LOC11 = rendertree_247059(n, 0);
		rawmessage_194636(((NU16) 167), LOC11);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NU8, getfilter_253260)(Tident198021* ident) {
	NU8 result;
{	result = 0;
	{
		NU8 i_253423;
		NI res_253429;
		i_253423 = 0;
		res_253429 = ((NI) 0);
		{
			while (1) {
				if (!(res_253429 <= ((NI) 3))) goto LA3;
				i_253423 = ((NU8) (res_253429));
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = identeq_198484(ident, filternames_253025[(i_253423)- 0]);
					if (!LOC6) goto LA7;
					result = i_253423;
					goto BeforeRet;
				}
				LA7: ;
				res_253429 += ((NI) 1);
			} LA3: ;
		}
	}
	result = ((NU8) 0);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NU8, getparser_253447)(Tident198021* ident) {
	NU8 result;
{	result = 0;
	{
		NU8 i_253623;
		NI res_253629;
		i_253623 = 0;
		res_253629 = ((NI) 0);
		{
			while (1) {
				if (!(res_253629 <= ((NI) 3))) goto LA3;
				i_253623 = ((NU8) (res_253629));
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = identeq_198484(ident, parsernames_253019[(i_253623)- 0]);
					if (!LOC6) goto LA7;
					result = i_253623;
					goto BeforeRet;
				}
				LA7: ;
				res_253629 += ((NI) 1);
			} LA3: ;
		}
	}
	rawmessage_194636(((NU16) 31), (*ident).s);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tllstream213204*, applyfilter_253689)(Tparsers253035* p, Tnode225809* n, NimStringDesc* filename, Tllstream213204* stdin_253695) {
	Tllstream213204* result;
	Tident198021* ident;
	NU8 f;
	result = 0;
	ident = getcallee_253647(n);
	f = getfilter_253260(ident);
	switch (f) {
	case ((NU8) 0):
	{
		(*p).skin = getparser_253447(ident);
		result = stdin_253695;
	}
	break;
	case ((NU8) 1):
	{
		result = filtertmpl_252009(stdin_253695, filename, n);
	}
	break;
	case ((NU8) 3):
	{
		result = filterstrip_251012(stdin_253695, filename, n);
	}
	break;
	case ((NU8) 2):
	{
		result = filterreplace_251004(stdin_253695, filename, n);
	}
	break;
	}
	{
		if (!!((f == ((NU8) 0)))) goto LA7;
		{
			TY253724 LOC13;
			TY253724 LOC14;
			if (!((gnotes_191395 &(IL64(1)<<(((((NU16) 277)- 237))&IL64(63))))!=0)) goto LA11;
			memset((void*)LOC13, 0, sizeof(LOC13));
			rawmessage_193675(((NU16) 277), LOC13, 0);
			msgwriteln_191915((*result).s, 0);
			memset((void*)LOC14, 0, sizeof(LOC14));
			rawmessage_193675(((NU16) 278), LOC14, 0);
		}
		LA11: ;
	}
	LA7: ;
	return result;
}

N_NIMCALL(Tllstream213204*, evalpipe_253732)(Tparsers253035* p, Tnode225809* n, NimStringDesc* filename, Tllstream213204* start) {
	Tllstream213204* result;
{	result = 0;
	result = start;
	{
		if (!((*n).kind == ((NU8) 1))) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	{
		NIM_BOOL LOC7;
		NIM_BOOL LOC8;
		LOC7 = 0;
		LOC8 = 0;
		LOC8 = ((*n).kind == ((NU8) 29));
		if (!(LOC8)) goto LA9;
		LOC8 = ((*(*n).kindU.S6.sons->data[((NI) 0)]).kind == ((NU8) 2));
		LA9: ;
		LOC7 = LOC8;
		if (!(LOC7)) goto LA10;
		LOC7 = identeq_198484((*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S5.ident, ((NimStringDesc*) &TMP1370));
		LA10: ;
		if (!LOC7) goto LA11;
		{
			NI i_253782;
			NI res_253808;
			i_253782 = 0;
			res_253808 = ((NI) 1);
			{
				while (1) {
					if (!(res_253808 <= ((NI) 2))) goto LA15;
					i_253782 = res_253808;
					{
						if (!((*(*n).kindU.S6.sons->data[i_253782]).kind == ((NU8) 29))) goto LA18;
						result = evalpipe_253732(p, (*n).kindU.S6.sons->data[i_253782], filename, result);
					}
					goto LA16;
					LA18: ;
					{
						result = applyfilter_253689(p, (*n).kindU.S6.sons->data[i_253782], filename, result);
					}
					LA16: ;
					res_253808 += ((NI) 1);
				} LA15: ;
			}
		}
	}
	goto LA5;
	LA11: ;
	{
		if (!((*n).kind == ((NU8) 115))) goto LA22;
		result = evalpipe_253732(p, (*n).kindU.S6.sons->data[((NI) 0)], filename, result);
	}
	goto LA5;
	LA22: ;
	{
		result = applyfilter_253689(p, n, filename, result);
	}
	LA5: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, openparsers_253047)(Tparsers253035* p, NI32 fileidx, Tllstream213204* inputstream) {
	Tllstream213204* s;
	NimStringDesc* filename;
	Tnode225809* pipe;
	s = 0;
	(*p).skin = ((NU8) 0);
	filename = tofullpathconsiderdirty_191807(fileidx);
	pipe = parsepipe_253170(filename, inputstream);
	{
		if (!!((pipe == NIM_NIL))) goto LA3;
		s = evalpipe_253732(p, pipe, filename, inputstream);
	}
	goto LA1;
	LA3: ;
	{
		s = inputstream;
	}
	LA1: ;
	switch ((*p).skin) {
	case ((NU8) 0):
	case ((NU8) 2):
	case ((NU8) 3):
	{
		openparser_241409((&(*p).parser), fileidx, s, NIM_FALSE);
	}
	break;
	case ((NU8) 1):
	{
		openparser_241409((&(*p).parser), fileidx, s, NIM_TRUE);
	}
	break;
	}
}

N_NIMCALL(Tnode225809*, parseall_253063)(Tparsers253035* p) {
	Tnode225809* result;
	result = 0;
	switch ((*p).skin) {
	case ((NU8) 0):
	case ((NU8) 1):
	{
		result = parseall_241216((&(*p).parser));
	}
	break;
	case ((NU8) 2):
	{
		result = parseall_246009((&(*p).parser));
	}
	break;
	case ((NU8) 3):
	{
		internalerror_196191(((NimStringDesc*) &TMP1519));
		result = emptynode_226807;
	}
	break;
	}
	return result;
}

N_NIMCALL(void, closeparsers_253056)(Tparsers253035* p) {
	closeparser_241223((&(*p).parser));
}

N_NIMCALL(Tnode225809*, parsefile_253041)(NI32 fileidx) {
	Tnode225809* result;
	Tparsers253035 p;
	FILE* f;
	NimStringDesc* filename;
	Tllstream213204* LOC6;
{	result = 0;
	memset((void*)(&p), 0, sizeof(p));
	objectInit((&p), (&NTI253035));
	f = 0;
	filename = tofullpathconsiderdirty_191807(fileidx);
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = open_16803(&f, filename, ((NU8) 0), ((NI) -1));
		if (!!(LOC3)) goto LA4;
		rawmessage_194636(((NU16) 3), filename);
		goto BeforeRet;
	}
	LA4: ;
	LOC6 = 0;
	LOC6 = llstreamopen_213238(f);
	openparsers_253047((&p), fileidx, LOC6);
	result = parseall_253063((&p));
	closeparsers_253056((&p));
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tnode225809*, parsetoplevelstmt_253070)(Tparsers253035* p) {
	Tnode225809* result;
	result = 0;
	switch ((*p).skin) {
	case ((NU8) 0):
	case ((NU8) 1):
	{
		result = parsetoplevelstmt_241230((&(*p).parser));
	}
	break;
	case ((NU8) 2):
	{
		result = parsetoplevelstmt_246020((&(*p).parser));
	}
	break;
	case ((NU8) 3):
	{
		internalerror_196191(((NimStringDesc*) &TMP1519));
		result = emptynode_226807;
	}
	break;
	}
	return result;
}
NIM_EXTERNC N_NOINLINE(void, compiler_syntaxesInit000)(void) {
}

NIM_EXTERNC N_NOINLINE(void, compiler_syntaxesDatInit000)(void) {
static TNimNode* TMP1169[2];
static TNimNode* TMP1170[4];
NI TMP1172;
static char* NIM_CONST TMP1171[4] = {
"skinStandard", 
"skinStrongSpaces", 
"skinBraces", 
"skinEndX"};
static TNimNode TMP878[8];
NTI253035.size = sizeof(Tparsers253035);
NTI253035.kind = 18;
NTI253035.base = 0;
TMP1169[0] = &TMP878[1];
NTI253007.size = sizeof(NU8);
NTI253007.kind = 14;
NTI253007.base = 0;
NTI253007.flags = 3;
for (TMP1172 = 0; TMP1172 < 4; TMP1172++) {
TMP878[TMP1172+2].kind = 1;
TMP878[TMP1172+2].offset = TMP1172;
TMP878[TMP1172+2].name = TMP1171[TMP1172];
TMP1170[TMP1172] = &TMP878[TMP1172+2];
}
TMP878[6].len = 4; TMP878[6].kind = 2; TMP878[6].sons = &TMP1170[0];
NTI253007.node = &TMP878[6];
TMP878[1].kind = 1;
TMP878[1].offset = offsetof(Tparsers253035, skin);
TMP878[1].typ = (&NTI253007);
TMP878[1].name = "skin";
TMP1169[1] = &TMP878[7];
TMP878[7].kind = 1;
TMP878[7].offset = offsetof(Tparsers253035, parser);
TMP878[7].typ = (&NTI241205);
TMP878[7].name = "parser";
TMP878[0].len = 2; TMP878[0].kind = 2; TMP878[0].sons = &TMP1169[0];
NTI253035.node = &TMP878[0];
}

