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

#include "nimbase.h"
#include <string.h>
#include <stdio.h>
typedef struct Tnode224809 Tnode224809;
typedef struct Tparsers252035 Tparsers252035;
typedef struct Tparser240205 Tparser240205;
typedef struct Tlexer215185 Tlexer215185;
typedef struct Tbaselexer213024 Tbaselexer213024;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Tllstream212204 Tllstream212204;
typedef struct Tlineinfo189352 Tlineinfo189352;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Ttoken215181 Ttoken215181;
typedef struct Tident197021 Tident197021;
typedef struct Ttype224847 Ttype224847;
typedef struct Tsym224841 Tsym224841;
typedef struct Tnodeseq224803 Tnodeseq224803;
typedef struct Tidobj197015 Tidobj197015;
typedef struct Ttypeseq224843 Ttypeseq224843;
typedef struct Tloc224823 Tloc224823;
typedef struct Ropeobj175009 Ropeobj175009;
typedef struct Tscope224835 Tscope224835;
typedef struct TY224944 TY224944;
typedef struct Tstrtable224813 Tstrtable224813;
typedef struct Tsymseq224811 Tsymseq224811;
typedef struct Tlib224827 Tlib224827;
typedef struct Tinstantiation224831 Tinstantiation224831;
typedef struct Tlistentry140022 Tlistentry140022;
typedef struct TY224932 TY224932;
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  Tbaselexer213024  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Tllstream212204* 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) (Tlineinfo189352 info, NU16 msg, NimStringDesc* arg, void* ClEnv);
void* ClEnv;
} Terrorhandler215183;
struct  Tlexer215185  {
  Tbaselexer213024 Sup;
NI32 fileidx;
NI indentahead;
NI currlineindent;
NIM_BOOL strongspaces;
Terrorhandler215183 errorhandler;
};
struct  Ttoken215181  {
NU8 toktype;
NI indent;
Tident197021* ident;
NI64 inumber;
NF fnumber;
NU8 base;
NI8 strongspacea;
NI8 strongspaceb;
NimStringDesc* literal;
NI line;
NI col;
};
struct  Tparser240205  {
NI currind;
NIM_BOOL firsttok;
NIM_BOOL strongspaces;
Tlexer215185 lex;
Ttoken215181 tok;
NI inpragma;
NI insemistmtlist;
};
struct  Tparsers252035  {
NU8 skin;
Tparser240205 parser;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tlineinfo189352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tnode224809  {
Ttype224847* typ;
Tlineinfo189352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym224841* sym;
} S4;
struct {Tident197021* ident;
} S5;
struct {Tnodeseq224803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
typedef NimStringDesc* TY252028[4];
typedef NimStringDesc* TY252022[4];
struct  Tidobj197015  {
  TNimObject Sup;
NI id;
};
struct  Tident197021  {
  Tidobj197015 Sup;
NimStringDesc* s;
Tident197021* next;
NI h;
};
typedef NimStringDesc* TY252724[1];
struct  Tllstream212204  {
  TNimObject Sup;
NU8 kind;
FILE* f;
NimStringDesc* s;
NI rd;
NI wr;
NI lineoffset;
};
struct  Tloc224823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype224847* t;
Ropeobj175009* r;
Ropeobj175009* heaproot;
};
struct  Ttype224847  {
  Tidobj197015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq224843* sons;
Tnode224809* n;
Tsym224841* owner;
Tsym224841* sym;
Tsym224841* destructor;
Tsym224841* deepcopy;
Tsym224841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc224823 loc;
};
struct  Tstrtable224813  {
NI counter;
Tsymseq224811* data;
};
struct  Tsym224841  {
  Tidobj197015 Sup;
NU8 kind;
union{
struct {Ttypeseq224843* typeinstcache;
Tscope224835* typscope;
} S1;
struct {TY224944* procinstcache;
Tsym224841* gcunsafetyreason;
} S2;
struct {TY224944* usedgenerics;
Tstrtable224813 tab;
} S3;
struct {Tsym224841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype224847* typ;
Tident197021* name;
Tlineinfo189352 info;
Tsym224841* owner;
NU32 flags;
Tnode224809* ast;
NU32 options;
NI position;
NI offset;
Tloc224823 loc;
Tlib224827* annex;
Tnode224809* constraint;
};
struct  Ropeobj175009  {
  TNimObject Sup;
Ropeobj175009* left;
Ropeobj175009* right;
NI length;
NimStringDesc* data;
};
struct  Tscope224835  {
NI depthlevel;
Tstrtable224813 symbols;
Tnodeseq224803* usingsyms;
Tscope224835* parent;
};
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tlib224827  {
  Tlistentry140022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj175009* name;
Tnode224809* path;
};
struct  Tinstantiation224831  {
Tsym224841* sym;
Ttypeseq224843* concretetypes;
TY224932* usedby;
NI compilesid;
};
struct Tnodeseq224803 {
  TGenericSeq Sup;
  Tnode224809* data[SEQ_DECL_SIZE];
};
struct Ttypeseq224843 {
  TGenericSeq Sup;
  Ttype224847* data[SEQ_DECL_SIZE];
};
struct TY224944 {
  TGenericSeq Sup;
  Tinstantiation224831* data[SEQ_DECL_SIZE];
};
struct Tsymseq224811 {
  TGenericSeq Sup;
  Tsym224841* data[SEQ_DECL_SIZE];
};
struct TY224932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, objectInit)(void* dest, TNimType* typ);
N_NIMCALL(NimStringDesc*, tofullpathconsiderdirty_190807)(NI32 fileidx);
N_NIMCALL(NIM_BOOL, open_16803)(FILE** f, NimStringDesc* filename, NU8 mode, NI bufsize);
N_NIMCALL(void, rawmessage_193636)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, openparsers_252047)(Tparsers252035* p, NI32 fileidx, Tllstream212204* inputstream);
N_NIMCALL(Tnode224809*, parsepipe_252170)(NimStringDesc* filename, Tllstream212204* inputstream);
N_NIMCALL(Tllstream212204*, llstreamopen_212256)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_NIMCALL(NIM_BOOL, llstreamreadline_212610)(Tllstream212204* s, NimStringDesc** line);
N_NIMCALL(NI, utf8bom_252122)(NimStringDesc* s);
N_NIMCALL(NIM_BOOL, containsshebang_252132)(NimStringDesc* s, NI i);
N_NIMCALL(void, message_195161)(Tlineinfo189352 info, NU16 msg, NimStringDesc* arg);
static N_INLINE(Tlineinfo189352, newlineinfo_190279)(NimStringDesc* filename, NI line, NI col);
N_NIMCALL(Tlineinfo189352, newlineinfo_190267)(NI32 fileinfoidx, NI line, NI col);
N_NIMCALL(NI32, fileinfoidx_190254)(NimStringDesc* filename);
N_NIMCALL(void, openparser_240424)(Tparser240205* p, NimStringDesc* filename, Tllstream212204* inputstream, NIM_BOOL strongspaces);
N_NIMCALL(Tllstream212204*, llstreamopen_212220)(NimStringDesc* data);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI start);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI first);
N_NIMCALL(Tnode224809*, parseall_240216)(Tparser240205* p);
N_NIMCALL(void, closeparser_240223)(Tparser240205* p);
N_NIMCALL(void, llstreamclose_212310)(Tllstream212204* s);
N_NIMCALL(Tllstream212204*, evalpipe_252732)(Tparsers252035* p, Tnode224809* n, NimStringDesc* filename, Tllstream212204* start);
N_NIMCALL(NIM_BOOL, identeq_197484)(Tident197021* id, NimStringDesc* name);
N_NIMCALL(Tllstream212204*, applyfilter_252689)(Tparsers252035* p, Tnode224809* n, NimStringDesc* filename, Tllstream212204* stdin_252695);
N_NIMCALL(Tident197021*, getcallee_252647)(Tnode224809* n);
N_NIMCALL(NimStringDesc*, rendertree_246059)(Tnode224809* n, NU8 renderflags);
N_NIMCALL(NU8, getfilter_252260)(Tident197021* ident);
N_NIMCALL(NU8, getparser_252447)(Tident197021* ident);
N_NIMCALL(Tllstream212204*, filtertmpl_251009)(Tllstream212204* stdin_251011, NimStringDesc* filename, Tnode224809* call);
N_NIMCALL(Tllstream212204*, filterstrip_250012)(Tllstream212204* stdin_250014, NimStringDesc* filename, Tnode224809* call);
N_NIMCALL(Tllstream212204*, filterreplace_250004)(Tllstream212204* stdin_250006, NimStringDesc* filename, Tnode224809* call);
N_NIMCALL(void, rawmessage_192675)(NU16 msg, NimStringDesc** args, NI argsLen0);
N_NIMCALL(void, msgwriteln_190915)(NimStringDesc* s, NU8 flags);
N_NIMCALL(void, openparser_240409)(Tparser240205* p, NI32 fileidx, Tllstream212204* inputstream, NIM_BOOL strongspaces);
N_NIMCALL(Tllstream212204*, llstreamopen_212238)(FILE* f);
N_NIMCALL(Tnode224809*, parseall_252063)(Tparsers252035* p);
N_NIMCALL(Tnode224809*, parseall_245009)(Tparser240205* p);
N_NIMCALL(void, internalerror_195191)(NimStringDesc* errmsg);
N_NIMCALL(void, closeparsers_252056)(Tparsers252035* p);
N_NIMCALL(Tnode224809*, parsetoplevelstmt_240230)(Tparser240205* p);
N_NIMCALL(Tnode224809*, parsetoplevelstmt_245020)(Tparser240205* p);
STRING_LITERAL(TMP1199, "use \'#?\' instead; \'#!\'", 22);
STRING_LITERAL(TMP1369, "|", 1);
STRING_LITERAL(TMP1479, "none", 4);
STRING_LITERAL(TMP1480, "stdtmpl", 7);
STRING_LITERAL(TMP1481, "replace", 7);
STRING_LITERAL(TMP1482, "strip", 5);
NIM_CONST TY252028 filternames_252025 = {((NimStringDesc*) &TMP1479),
((NimStringDesc*) &TMP1480),
((NimStringDesc*) &TMP1481),
((NimStringDesc*) &TMP1482)}
;
STRING_LITERAL(TMP1483, "standard", 8);
STRING_LITERAL(TMP1484, "strongspaces", 12);
STRING_LITERAL(TMP1485, "braces", 6);
STRING_LITERAL(TMP1486, "endx", 4);
NIM_CONST TY252022 parsernames_252019 = {((NimStringDesc*) &TMP1483),
((NimStringDesc*) &TMP1484),
((NimStringDesc*) &TMP1485),
((NimStringDesc*) &TMP1486)}
;
STRING_LITERAL(TMP1518, "parser to implement", 19);
TNimType NTI252035; /* TParsers */
TNimType NTI252007; /* TParserKind */
extern TNimType NTI240205; /* TParser */
extern Tnode224809* emptynode_225807;
extern NU64 gnotes_190398;

N_NIMCALL(NI, utf8bom_252122)(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_252132)(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(Tlineinfo189352, newlineinfo_190279)(NimStringDesc* filename, NI line, NI col) {
	Tlineinfo189352 result;
	NI32 LOC1;
	memset((void*)(&result), 0, sizeof(result));
	LOC1 = 0;
	LOC1 = fileinfoidx_190254(filename);
	result = newlineinfo_190267(LOC1, line, col);
	return result;
}

N_NIMCALL(Tnode224809*, parsepipe_252170)(NimStringDesc* filename, Tllstream212204* inputstream) {
	Tnode224809* result;
	Tllstream212204* s;
	result = 0;
	result = emptynode_225807;
	s = llstreamopen_212256(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_212610(s, (&line));
		i = utf8bom_252122(line);
		linenumber = ((NI) 1);
		{
			NIM_BOOL LOC8;
			NIM_BOOL LOC11;
			LOC8 = 0;
			LOC8 = containsshebang_252132(line, i);
			if (!LOC8) goto LA9;
			LOC11 = 0;
			LOC11 = llstreamreadline_212610(s, (&line));
			i = ((NI) 0);
			linenumber += ((NI) 1);
		}
		LA9: ;
		{
			NIM_BOOL LOC14;
			Tparser240205 q;
			NimStringDesc* LOC25;
			Tllstream212204* 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;
			{
				Tlineinfo189352 LOC22;
				if (!((NU8)(line->data[(NI)(i + ((NI) 1))]) == (NU8)(33))) goto LA20;
				LOC22 = newlineinfo_190279(filename, linenumber, ((NI) 1));
				message_195161(LOC22, ((NU16) 241), ((NimStringDesc*) &TMP1199));
			}
			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), (&NTI240205));
			LOC25 = 0;
			LOC25 = copyStr(line, i);
			LOC26 = 0;
			LOC26 = llstreamopen_212220(LOC25);
			openparser_240424((&q), filename, LOC26, NIM_FALSE);
			result = parseall_240216((&q));
			closeparser_240223((&q));
		}
		LA16: ;
		llstreamclose_212310(s);
	}
	LA3: ;
	return result;
}

N_NIMCALL(Tident197021*, getcallee_252647)(Tnode224809* n) {
	Tident197021* 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_246059(n, 0);
		rawmessage_193636(((NU16) 167), LOC11);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NU8, getfilter_252260)(Tident197021* ident) {
	NU8 result;
{	result = 0;
	{
		NU8 i_252423;
		NI res_252429;
		i_252423 = 0;
		res_252429 = ((NI) 0);
		{
			while (1) {
				if (!(res_252429 <= ((NI) 3))) goto LA3;
				i_252423 = ((NU8) (res_252429));
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = identeq_197484(ident, filternames_252025[(i_252423)- 0]);
					if (!LOC6) goto LA7;
					result = i_252423;
					goto BeforeRet;
				}
				LA7: ;
				res_252429 += ((NI) 1);
			} LA3: ;
		}
	}
	result = ((NU8) 0);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NU8, getparser_252447)(Tident197021* ident) {
	NU8 result;
{	result = 0;
	{
		NU8 i_252623;
		NI res_252629;
		i_252623 = 0;
		res_252629 = ((NI) 0);
		{
			while (1) {
				if (!(res_252629 <= ((NI) 3))) goto LA3;
				i_252623 = ((NU8) (res_252629));
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = identeq_197484(ident, parsernames_252019[(i_252623)- 0]);
					if (!LOC6) goto LA7;
					result = i_252623;
					goto BeforeRet;
				}
				LA7: ;
				res_252629 += ((NI) 1);
			} LA3: ;
		}
	}
	rawmessage_193636(((NU16) 31), (*ident).s);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tllstream212204*, applyfilter_252689)(Tparsers252035* p, Tnode224809* n, NimStringDesc* filename, Tllstream212204* stdin_252695) {
	Tllstream212204* result;
	Tident197021* ident;
	NU8 f;
	result = 0;
	ident = getcallee_252647(n);
	f = getfilter_252260(ident);
	switch (f) {
	case ((NU8) 0):
	{
		(*p).skin = getparser_252447(ident);
		result = stdin_252695;
	}
	break;
	case ((NU8) 1):
	{
		result = filtertmpl_251009(stdin_252695, filename, n);
	}
	break;
	case ((NU8) 3):
	{
		result = filterstrip_250012(stdin_252695, filename, n);
	}
	break;
	case ((NU8) 2):
	{
		result = filterreplace_250004(stdin_252695, filename, n);
	}
	break;
	}
	{
		if (!!((f == ((NU8) 0)))) goto LA7;
		{
			TY252724 LOC13;
			TY252724 LOC14;
			if (!((gnotes_190398 &(IL64(1)<<(((((NU16) 277)- 237))&IL64(63))))!=0)) goto LA11;
			memset((void*)LOC13, 0, sizeof(LOC13));
			rawmessage_192675(((NU16) 277), LOC13, 0);
			msgwriteln_190915((*result).s, 0);
			memset((void*)LOC14, 0, sizeof(LOC14));
			rawmessage_192675(((NU16) 278), LOC14, 0);
		}
		LA11: ;
	}
	LA7: ;
	return result;
}

N_NIMCALL(Tllstream212204*, evalpipe_252732)(Tparsers252035* p, Tnode224809* n, NimStringDesc* filename, Tllstream212204* start) {
	Tllstream212204* 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_197484((*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S5.ident, ((NimStringDesc*) &TMP1369));
		LA10: ;
		if (!LOC7) goto LA11;
		{
			NI i_252782;
			NI res_252808;
			i_252782 = 0;
			res_252808 = ((NI) 1);
			{
				while (1) {
					if (!(res_252808 <= ((NI) 2))) goto LA15;
					i_252782 = res_252808;
					{
						if (!((*(*n).kindU.S6.sons->data[i_252782]).kind == ((NU8) 29))) goto LA18;
						result = evalpipe_252732(p, (*n).kindU.S6.sons->data[i_252782], filename, result);
					}
					goto LA16;
					LA18: ;
					{
						result = applyfilter_252689(p, (*n).kindU.S6.sons->data[i_252782], filename, result);
					}
					LA16: ;
					res_252808 += ((NI) 1);
				} LA15: ;
			}
		}
	}
	goto LA5;
	LA11: ;
	{
		if (!((*n).kind == ((NU8) 115))) goto LA22;
		result = evalpipe_252732(p, (*n).kindU.S6.sons->data[((NI) 0)], filename, result);
	}
	goto LA5;
	LA22: ;
	{
		result = applyfilter_252689(p, n, filename, result);
	}
	LA5: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, openparsers_252047)(Tparsers252035* p, NI32 fileidx, Tllstream212204* inputstream) {
	Tllstream212204* s;
	NimStringDesc* filename;
	Tnode224809* pipe;
	s = 0;
	(*p).skin = ((NU8) 0);
	filename = tofullpathconsiderdirty_190807(fileidx);
	pipe = parsepipe_252170(filename, inputstream);
	{
		if (!!((pipe == NIM_NIL))) goto LA3;
		s = evalpipe_252732(p, pipe, filename, inputstream);
	}
	goto LA1;
	LA3: ;
	{
		s = inputstream;
	}
	LA1: ;
	switch ((*p).skin) {
	case ((NU8) 0):
	case ((NU8) 2):
	case ((NU8) 3):
	{
		openparser_240409((&(*p).parser), fileidx, s, NIM_FALSE);
	}
	break;
	case ((NU8) 1):
	{
		openparser_240409((&(*p).parser), fileidx, s, NIM_TRUE);
	}
	break;
	}
}

N_NIMCALL(Tnode224809*, parseall_252063)(Tparsers252035* p) {
	Tnode224809* result;
	result = 0;
	switch ((*p).skin) {
	case ((NU8) 0):
	case ((NU8) 1):
	{
		result = parseall_240216((&(*p).parser));
	}
	break;
	case ((NU8) 2):
	{
		result = parseall_245009((&(*p).parser));
	}
	break;
	case ((NU8) 3):
	{
		internalerror_195191(((NimStringDesc*) &TMP1518));
		result = emptynode_225807;
	}
	break;
	}
	return result;
}

N_NIMCALL(void, closeparsers_252056)(Tparsers252035* p) {
	closeparser_240223((&(*p).parser));
}

N_NIMCALL(Tnode224809*, parsefile_252041)(NI32 fileidx) {
	Tnode224809* result;
	Tparsers252035 p;
	FILE* f;
	NimStringDesc* filename;
	Tllstream212204* LOC6;
{	result = 0;
	memset((void*)(&p), 0, sizeof(p));
	objectInit((&p), (&NTI252035));
	f = 0;
	filename = tofullpathconsiderdirty_190807(fileidx);
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = open_16803(&f, filename, ((NU8) 0), ((NI) -1));
		if (!!(LOC3)) goto LA4;
		rawmessage_193636(((NU16) 3), filename);
		goto BeforeRet;
	}
	LA4: ;
	LOC6 = 0;
	LOC6 = llstreamopen_212238(f);
	openparsers_252047((&p), fileidx, LOC6);
	result = parseall_252063((&p));
	closeparsers_252056((&p));
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tnode224809*, parsetoplevelstmt_252070)(Tparsers252035* p) {
	Tnode224809* result;
	result = 0;
	switch ((*p).skin) {
	case ((NU8) 0):
	case ((NU8) 1):
	{
		result = parsetoplevelstmt_240230((&(*p).parser));
	}
	break;
	case ((NU8) 2):
	{
		result = parsetoplevelstmt_245020((&(*p).parser));
	}
	break;
	case ((NU8) 3):
	{
		internalerror_195191(((NimStringDesc*) &TMP1518));
		result = emptynode_225807;
	}
	break;
	}
	return result;
}
NIM_EXTERNC N_NOINLINE(void, compiler_syntaxesInit000)(void) {
}

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

