/* Generated by Nimrod Compiler v0.9.5 */
/*   (c) 2014 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, i386, gcc */
/* Command for C compiler:
   gcc -c  -w -O3 -fno-strict-aliasing  -I/build/nimrod/src/nimrod/lib -o compiler/nimcache/syntaxes.o compiler/nimcache/syntaxes.c */
#define NIM_INTBITS 32
#include "nimbase.h"

#include <string.h>

#include <stdio.h>
typedef struct tnode188803 tnode188803;
typedef struct tparsers220029 tparsers220029;
typedef struct tparser205203 tparser205203;
typedef struct tlexer180176 tlexer180176;
typedef struct tbaselexer178018 tbaselexer178018;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tllstream176204 tllstream176204;
typedef struct ttoken180174 ttoken180174;
typedef struct tident167019 tident167019;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct ttype188837 ttype188837;
typedef struct tlineinfo163527 tlineinfo163527;
typedef struct tsym188833 tsym188833;
typedef struct tnodeseq188797 tnodeseq188797;
typedef struct tidobj167013 tidobj167013;
typedef struct ttypeseq188835 ttypeseq188835;
typedef struct tloc188817 tloc188817;
typedef struct trope145007 trope145007;
typedef struct tscope188827 tscope188827;
typedef struct TY188933 TY188933;
typedef struct tinstantiation188823 tinstantiation188823;
typedef struct tstrtable188807 tstrtable188807;
typedef struct tsymseq188805 tsymseq188805;
typedef struct tlib188821 tlib188821;
typedef struct TY188922 TY188922;
typedef struct tlistentry118017 tlistentry118017;
typedef N_NIMCALL_PTR(void, TY2289) (void* p, NI op);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY2289 marker;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  tbaselexer178018  {
  TNimObject Sup;
NI Bufpos;
NCSTRING Buf;
NI Buflen;
tllstream176204* Stream;
NI Linenumber;
NI Sentinel;
NI Linestart;
};
struct  tlexer180176  {
  tbaselexer178018 Sup;
NI32 Fileidx;
NI Indentahead;
NI Currlineindent;
NIM_BOOL Strongspaces;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  ttoken180174  {
NU8 Toktype;
NI Indent;
tident167019* Ident;
NI64 Inumber;
NF Fnumber;
NU8 Base;
NI8 Strongspacea;
NI8 Strongspaceb;
NimStringDesc* Literal;
NI Line;
NI Col;
};
struct  tparser205203  {
NI Currind;
NIM_BOOL Firsttok;
NIM_BOOL Strongspaces;
tlexer180176 Lex;
ttoken180174 Tok;
NI Inpragma;
NI Insemistmtlist;
};
struct  tparsers220029  {
NU8 Skin;
tparser205203 Parser;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  tlineinfo163527  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  tnode188803  {
ttype188837* Typ;
tlineinfo163527 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym188833* Sym;
} S4;
struct {tident167019* Ident;
} S5;
struct {tnodeseq188797* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
typedef NimStringDesc* TY220022[4];
typedef NimStringDesc* TY220016[4];
struct  tidobj167013  {
  TNimObject Sup;
NI Id;
};
struct  tident167019  {
  tidobj167013 Sup;
NimStringDesc* S;
tident167019* Next;
NI H;
};
typedef NimStringDesc* TY523288[1];
struct  tllstream176204  {
  TNimObject Sup;
NU8 Kind;
FILE* F;
NimStringDesc* S;
NI Rd;
NI Wr;
NI Lineoffset;
};
struct  tloc188817  {
NU8 K;
NU8 S;
NU8 Flags;
ttype188837* T;
trope145007* R;
trope145007* Heaproot;
NI A;
};
struct  ttype188837  {
  tidobj167013 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq188835* Sons;
tnode188803* N;
tsym188833* Destructor;
tsym188833* Owner;
tsym188833* Sym;
NI64 Size;
NI Align;
tloc188817 Loc;
};
struct  tstrtable188807  {
NI Counter;
tsymseq188805* Data;
};
struct  tsym188833  {
  tidobj167013 Sup;
NU8 Kind;
union {
struct {ttypeseq188835* Typeinstcache;
tscope188827* Typscope;
} S1;
struct {TY188933* Procinstcache;
tscope188827* Scope;
} S2;
struct {TY188933* Usedgenerics;
tstrtable188807 Tab;
} S3;
} kindU;
NU16 Magic;
ttype188837* Typ;
tident167019* Name;
tlineinfo163527 Info;
tsym188833* Owner;
NU32 Flags;
tnode188803* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc188817 Loc;
tlib188821* Annex;
tnode188803* Constraint;
};
struct  trope145007  {
  TNimObject Sup;
trope145007* Left;
trope145007* Right;
NI Length;
NimStringDesc* Data;
};
struct  tscope188827  {
NI Depthlevel;
tstrtable188807 Symbols;
tnodeseq188797* Usingsyms;
tscope188827* Parent;
};
struct  tinstantiation188823  {
tsym188833* Sym;
ttypeseq188835* Concretetypes;
TY188922* Usedby;
};
struct  tlistentry118017  {
  TNimObject Sup;
tlistentry118017* Prev;
tlistentry118017* Next;
};
struct  tlib188821  {
  tlistentry118017 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope145007* Name;
tnode188803* Path;
};
struct tnodeseq188797 {
  TGenericSeq Sup;
  tnode188803* data[SEQ_DECL_SIZE];
};
struct ttypeseq188835 {
  TGenericSeq Sup;
  ttype188837* data[SEQ_DECL_SIZE];
};
struct TY188933 {
  TGenericSeq Sup;
  tinstantiation188823* data[SEQ_DECL_SIZE];
};
struct tsymseq188805 {
  TGenericSeq Sup;
  tsym188833* data[SEQ_DECL_SIZE];
};
struct TY188922 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, objectInit)(void* dest, TNimType* typ);
N_NIMCALL(NimStringDesc*, tofullpath_164788)(NI32 fileidx);
N_NIMCALL(NIM_BOOL, open_10203)(FILE** f, NimStringDesc* filename, NU8 mode, NI bufsize);
N_NIMCALL(void, rawmessage_165386)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, openparsers_220037)(tparsers220029* p, NI32 fileidx, tllstream176204* inputstream);
N_NIMCALL(tnode188803*, parsepipe_220138)(NimStringDesc* filename, tllstream176204* inputstream);
N_NIMCALL(tllstream176204*, llstreamopen_176227)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_NIMCALL(NIM_BOOL, llstreamreadline_176248)(tllstream176204* s, NimStringDesc** line);
N_NIMCALL(NI, utf8bom_220094)(NimStringDesc* s);
N_NIMCALL(NIM_BOOL, containsshebang_220100)(NimStringDesc* s, NI i);
N_NIMCALL(void, openparser_205364)(tparser205203* p, NimStringDesc* filename, tllstream176204* inputstream, NIM_BOOL strongspaces);
N_NIMCALL(tllstream176204*, llstreamopen_176218)(NimStringDesc* data);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI start);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI first);
N_NIMCALL(tnode188803*, parseall_205212)(tparser205203* p);
N_NIMCALL(void, closeparser_205217)(tparser205203* p);
N_NIMCALL(void, llstreamclose_176238)(tllstream176204* s);
N_NIMCALL(tllstream176204*, evalpipe_220461)(tparsers220029* p, tnode188803* n, NimStringDesc* filename, tllstream176204* start);
N_NIMCALL(NIM_BOOL, identeq_167469)(tident167019* id, NimStringDesc* name);
N_NIMCALL(tllstream176204*, applyfilter_220426)(tparsers220029* p, tnode188803* n, NimStringDesc* filename, tllstream176204* stdin_220432);
N_NIMCALL(tident167019*, getcallee_220333)(tnode188803* n);
N_NIMCALL(NimStringDesc*, rendertree_211051)(tnode188803* n, NU8 renderflags);
N_NIMCALL(NU8, getfilter_220219)(tident167019* ident);
N_NIMCALL(NU8, getparser_220276)(tident167019* ident);
N_NIMCALL(tllstream176204*, filtertmpl_219007)(tllstream176204* stdin_219009, NimStringDesc* filename, tnode188803* call);
N_NIMCALL(tllstream176204*, filterstrip_218008)(tllstream176204* stdin_218010, NimStringDesc* filename, tnode188803* call);
N_NIMCALL(tllstream176204*, filterreplace_218002)(tllstream176204* stdin_218004, NimStringDesc* filename, tnode188803* call);
N_NIMCALL(void, rawmessage_165292)(NU16 msg, NimStringDesc** args, NI argsLen0);
N_NIMCALL(void, msgwriteln_164937)(NimStringDesc* s);
N_NIMCALL(void, openparser_205353)(tparser205203* p, NI32 fileidx, tllstream176204* inputstream, NIM_BOOL strongspaces);
N_NIMCALL(tllstream176204*, llstreamopen_176222)(FILE** f);
N_NIMCALL(tnode188803*, parseall_220049)(tparsers220029* p);
N_NIMCALL(tnode188803*, parseall_210006)(tparser205203* p);
N_NIMCALL(void, internalerror_165606)(NimStringDesc* errmsg);
N_NIMCALL(void, closeparsers_220044)(tparsers220029* p);
N_NIMCALL(tnode188803*, parsetoplevelstmt_205222)(tparser205203* p);
N_NIMCALL(tnode188803*, parsetoplevelstmt_210013)(tparser205203* p);
STRING_LITERAL(TMP1573, "|", 1);
STRING_LITERAL(TMP1681, "none", 4);
STRING_LITERAL(TMP1682, "stdtmpl", 7);
STRING_LITERAL(TMP1683, "replace", 7);
STRING_LITERAL(TMP1684, "strip", 5);
NIM_CONST TY220022 filternames_220021 = {((NimStringDesc*) &TMP1681),
((NimStringDesc*) &TMP1682),
((NimStringDesc*) &TMP1683),
((NimStringDesc*) &TMP1684)}
;
STRING_LITERAL(TMP1685, "standard", 8);
STRING_LITERAL(TMP1686, "strongspaces", 12);
STRING_LITERAL(TMP1687, "braces", 6);
STRING_LITERAL(TMP1688, "endx", 4);
NIM_CONST TY220016 parsernames_220015 = {((NimStringDesc*) &TMP1685),
((NimStringDesc*) &TMP1686),
((NimStringDesc*) &TMP1687),
((NimStringDesc*) &TMP1688)}
;
STRING_LITERAL(TMP1719, "parser to implement", 19);
TNimType NTI220029; /* TParsers */
TNimType NTI220005; /* TParserKind */
extern TNimType NTI205203; /* TParser */
extern tnode188803* emptynode_189727;
extern NI gverbosity_137120;

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

N_NIMCALL(NIM_BOOL, containsshebang_220100)(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[(NI32)(i + 1)]) == (NU8)(33));
		LA4: ;
		if (!LOC3) goto LA5;
		j = (NI32)(i + 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 LA7;
			j += 1;
		} LA7: ;
		result = ((NU8)(s->data[j]) == (NU8)(47));
	}
	LA5: ;
	return result;
}

N_NIMCALL(tnode188803*, parsepipe_220138)(NimStringDesc* filename, tllstream176204* inputstream) {
	tnode188803* result;
	tllstream176204* s;
	result = 0;
	result = emptynode_189727;
	s = llstreamopen_176227(filename, ((NU8) 0));
	{
		NimStringDesc* line;
		NIM_BOOL LOC5;
		NI i;
		if (!!((s == NIM_NIL))) goto LA3;
		line = rawNewString(80);
		LOC5 = 0;
		LOC5 = llstreamreadline_176248(s, &line);
		i = utf8bom_220094(line);
		{
			NIM_BOOL LOC8;
			NIM_BOOL LOC11;
			LOC8 = 0;
			LOC8 = containsshebang_220100(line, i);
			if (!LOC8) goto LA9;
			LOC11 = 0;
			LOC11 = llstreamreadline_176248(s, &line);
			i = 0;
		}
		LA9: ;
		{
			NIM_BOOL LOC14;
			tparser205203 q;
			NimStringDesc* LOC19;
			tllstream176204* LOC20;
			LOC14 = 0;
			LOC14 = ((NU8)(line->data[i]) == (NU8)(35));
			if (!(LOC14)) goto LA15;
			LOC14 = ((NU8)(line->data[(NI32)(i + 1)]) == (NU8)(33));
			LA15: ;
			if (!LOC14) goto LA16;
			i += 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 LA18;
				i += 1;
			} LA18: ;
			memset((void*)&q, 0, sizeof(q));
			objectInit(&q, (&NTI205203));
			LOC19 = 0;
			LOC19 = copyStr(line, i);
			LOC20 = 0;
			LOC20 = llstreamopen_176218(LOC19);
			openparser_205364(&q, filename, LOC20, NIM_FALSE);
			result = parseall_205212(&q);
			closeparser_205217(&q);
		}
		LA16: ;
		llstreamclose_176238(s);
	}
	LA3: ;
	return result;
}

N_NIMCALL(tident167019*, getcallee_220333)(tnode188803* n) {
	tident167019* 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[0]).Kind == ((NU8) 2));
		LA4: ;
		if (!LOC3) goto LA5;
		result = (*(*n).kindU.S6.Sons->data[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_211051(n, 0);
		rawmessage_165386(((NU16) 163), LOC11);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NU8, getfilter_220219)(tident167019* ident) {
	NU8 result;
	NU8 i_220267;
	NU8 res_220271;
	result = 0;
	i_220267 = 0;
	res_220271 = ((NU8) 0);
	while (1) {
		if (!(res_220271 <= ((NU8) 3))) goto LA1;
		i_220267 = res_220271;
		{
			NIM_BOOL LOC4;
			LOC4 = 0;
			LOC4 = identeq_167469(ident, filternames_220021[(i_220267)- 0]);
			if (!LOC4) goto LA5;
			result = i_220267;
			goto BeforeRet;
		}
		LA5: ;
		res_220271 += 1;
	} LA1: ;
	result = ((NU8) 0);
	BeforeRet: ;
	return result;
}

N_NIMCALL(NU8, getparser_220276)(tident167019* ident) {
	NU8 result;
	NU8 i_220324;
	NU8 res_220328;
	result = 0;
	i_220324 = 0;
	res_220328 = ((NU8) 0);
	while (1) {
		if (!(res_220328 <= ((NU8) 3))) goto LA1;
		i_220324 = res_220328;
		{
			NIM_BOOL LOC4;
			LOC4 = 0;
			LOC4 = identeq_167469(ident, parsernames_220015[(i_220324)- 0]);
			if (!LOC4) goto LA5;
			result = i_220324;
			goto BeforeRet;
		}
		LA5: ;
		res_220328 += 1;
	} LA1: ;
	rawmessage_165386(((NU16) 30), (*ident).S);
	BeforeRet: ;
	return result;
}

N_NIMCALL(tllstream176204*, applyfilter_220426)(tparsers220029* p, tnode188803* n, NimStringDesc* filename, tllstream176204* stdin_220432) {
	tllstream176204* result;
	tident167019* ident;
	NU8 f;
	result = 0;
	ident = getcallee_220333(n);
	f = getfilter_220219(ident);
	switch (f) {
	case ((NU8) 0):
	{
		(*p).Skin = getparser_220276(ident);
		result = stdin_220432;
	}
	break;
	case ((NU8) 1):
	{
		result = filtertmpl_219007(stdin_220432, filename, n);
	}
	break;
	case ((NU8) 3):
	{
		result = filterstrip_218008(stdin_220432, filename, n);
	}
	break;
	case ((NU8) 2):
	{
		result = filterreplace_218002(stdin_220432, filename, n);
	}
	break;
	}
	{
		if (!!((f == ((NU8) 0)))) goto LA7;
		{
			TY523288 LOC13;
			TY523288 LOC14;
			if (!(2 <= gverbosity_137120)) goto LA11;
			memset((void*)LOC13, 0, sizeof(LOC13));
			rawmessage_165292(((NU16) 266), LOC13, 0);
			msgwriteln_164937((*result).S);
			memset((void*)LOC14, 0, sizeof(LOC14));
			rawmessage_165292(((NU16) 267), LOC14, 0);
		}
		LA11: ;
	}
	LA7: ;
	return result;
}

N_NIMCALL(tllstream176204*, evalpipe_220461)(tparsers220029* p, tnode188803* n, NimStringDesc* filename, tllstream176204* start) {
	tllstream176204* result;
	result = 0;
	result = start;
	{
		if (!((*n).Kind == ((NU8) 1))) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	{
		NIM_BOOL LOC7;
		NIM_BOOL LOC8;
		NI i_220550;
		NI res_220626;
		LOC7 = 0;
		LOC8 = 0;
		LOC8 = ((*n).Kind == ((NU8) 29));
		if (!(LOC8)) goto LA9;
		LOC8 = ((*(*n).kindU.S6.Sons->data[0]).Kind == ((NU8) 2));
		LA9: ;
		LOC7 = LOC8;
		if (!(LOC7)) goto LA10;
		LOC7 = identeq_167469((*(*n).kindU.S6.Sons->data[0]).kindU.S5.Ident, ((NimStringDesc*) &TMP1573));
		LA10: ;
		if (!LOC7) goto LA11;
		i_220550 = 0;
		res_220626 = 1;
		while (1) {
			if (!(res_220626 <= 2)) goto LA13;
			i_220550 = res_220626;
			{
				if (!((*(*n).kindU.S6.Sons->data[i_220550]).Kind == ((NU8) 29))) goto LA16;
				result = evalpipe_220461(p, (*n).kindU.S6.Sons->data[i_220550], filename, result);
			}
			goto LA14;
			LA16: ;
			{
				result = applyfilter_220426(p, (*n).kindU.S6.Sons->data[i_220550], filename, result);
			}
			LA14: ;
			res_220626 += 1;
		} LA13: ;
	}
	goto LA5;
	LA11: ;
	{
		if (!((*n).Kind == ((NU8) 114))) goto LA20;
		result = evalpipe_220461(p, (*n).kindU.S6.Sons->data[0], filename, result);
	}
	goto LA5;
	LA20: ;
	{
		result = applyfilter_220426(p, n, filename, result);
	}
	LA5: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, openparsers_220037)(tparsers220029* p, NI32 fileidx, tllstream176204* inputstream) {
	tllstream176204* s;
	NimStringDesc* filename;
	tnode188803* pipe;
	s = 0;
	(*p).Skin = ((NU8) 0);
	filename = tofullpath_164788(fileidx);
	pipe = parsepipe_220138(filename, inputstream);
	{
		if (!!((pipe == NIM_NIL))) goto LA3;
		s = evalpipe_220461(p, pipe, filename, inputstream);
	}
	goto LA1;
	LA3: ;
	{
		s = inputstream;
	}
	LA1: ;
	switch ((*p).Skin) {
	case ((NU8) 0):
	case ((NU8) 2):
	case ((NU8) 3):
	{
		openparser_205353(&(*p).Parser, fileidx, s, NIM_FALSE);
	}
	break;
	case ((NU8) 1):
	{
		openparser_205353(&(*p).Parser, fileidx, s, NIM_TRUE);
	}
	break;
	}
}

N_NIMCALL(tnode188803*, parseall_220049)(tparsers220029* p) {
	tnode188803* result;
	result = 0;
	switch ((*p).Skin) {
	case ((NU8) 0):
	case ((NU8) 1):
	{
		result = parseall_205212(&(*p).Parser);
	}
	break;
	case ((NU8) 2):
	{
		result = parseall_210006(&(*p).Parser);
	}
	break;
	case ((NU8) 3):
	{
		internalerror_165606(((NimStringDesc*) &TMP1719));
		result = emptynode_189727;
	}
	break;
	}
	return result;
}

N_NIMCALL(void, closeparsers_220044)(tparsers220029* p) {
	closeparser_205217(&(*p).Parser);
}

N_NIMCALL(tnode188803*, parsefile_220033)(NI32 fileidx) {
	tnode188803* result;
	tparsers220029 p;
	FILE* f;
	NimStringDesc* filename;
	tllstream176204* LOC6;
	result = 0;
	memset((void*)&p, 0, sizeof(p));
	objectInit(&p, (&NTI220029));
	f = 0;
	filename = tofullpath_164788(fileidx);
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = open_10203(&f, filename, ((NU8) 0), -1);
		if (!!(LOC3)) goto LA4;
		rawmessage_165386(((NU16) 3), filename);
		goto BeforeRet;
	}
	LA4: ;
	LOC6 = 0;
	LOC6 = llstreamopen_176222(&f);
	openparsers_220037(&p, fileidx, LOC6);
	result = parseall_220049(&p);
	closeparsers_220044(&p);
	BeforeRet: ;
	return result;
}

N_NIMCALL(tnode188803*, parsetoplevelstmt_220054)(tparsers220029* p) {
	tnode188803* result;
	result = 0;
	switch ((*p).Skin) {
	case ((NU8) 0):
	case ((NU8) 1):
	{
		result = parsetoplevelstmt_205222(&(*p).Parser);
	}
	break;
	case ((NU8) 2):
	{
		result = parsetoplevelstmt_210013(&(*p).Parser);
	}
	break;
	case ((NU8) 3):
	{
		internalerror_165606(((NimStringDesc*) &TMP1719));
		result = emptynode_189727;
	}
	break;
	}
	return result;
}
N_NOINLINE(void, syntaxesInit)(void) {
}

N_NOINLINE(void, syntaxesDatInit)(void) {
static TNimNode* TMP1546[2];
static TNimNode* TMP1547[4];
NI TMP1549;
static char* NIM_CONST TMP1548[4] = {
"skinStandard", 
"skinStrongSpaces", 
"skinBraces", 
"skinEndX"};
static TNimNode TMP787[8];
NTI220029.size = sizeof(tparsers220029);
NTI220029.kind = 18;
NTI220029.base = 0;
TMP1546[0] = &TMP787[1];
NTI220005.size = sizeof(NU8);
NTI220005.kind = 14;
NTI220005.base = 0;
NTI220005.flags = 3;
for (TMP1549 = 0; TMP1549 < 4; TMP1549++) {
TMP787[TMP1549+2].kind = 1;
TMP787[TMP1549+2].offset = TMP1549;
TMP787[TMP1549+2].name = TMP1548[TMP1549];
TMP1547[TMP1549] = &TMP787[TMP1549+2];
}
TMP787[6].len = 4; TMP787[6].kind = 2; TMP787[6].sons = &TMP1547[0];
NTI220005.node = &TMP787[6];
TMP787[1].kind = 1;
TMP787[1].offset = offsetof(tparsers220029, Skin);
TMP787[1].typ = (&NTI220005);
TMP787[1].name = "skin";
TMP1546[1] = &TMP787[7];
TMP787[7].kind = 1;
TMP787[7].offset = offsetof(tparsers220029, Parser);
TMP787[7].typ = (&NTI205203);
TMP787[7].name = "parser";
TMP787[0].len = 2; TMP787[0].kind = 2; TMP787[0].sons = &TMP1546[0];
NTI220029.node = &TMP787[0];
}

