/* Automatically generated by the nanoLang compiler ncc. The bolierplate and library code is released under the GNU General Public Licence, version 2 or, at your choice, any later version. Other code is governed by the license of the original source code. */ #include #include #include typedef long long N_Integer; typedef char* N_String; #define NANO_MAKESTR(s) s #define NANO_STRASSIGN(l, r) (l) = (r) #define NANO_STRVAL(s) s /* Global user variables */ /* Function declarations */ N_Integer n_Exit(N_Integer); N_Integer n_StrIsInt(N_String); N_Integer n_StrToInt(N_String); N_Integer n_StrLen(N_String); N_String n_IntToStr(N_Integer); N_String n_StrFront(N_String,N_Integer); N_String n_StrRest(N_String,N_Integer); N_String n_StrCat(N_String,N_String); N_Integer n_StrToASCII(N_String); N_String n_ASCIIToStr(N_Integer); N_Integer n_Euklid(N_Integer,N_Integer); N_Integer n_main(N_String,N_String); /* nanoLang runtime library code */ /* String functions */ N_String n_StrCat(N_String arg1, N_String arg2) { size_t len = strlen(arg1)+strlen(arg2)+1; char *res = malloc(len); strcpy(res, arg1); strcat(res, arg2); return res; } N_Integer n_StrIsInt(N_String str) { char *err=NULL; if(!str[0]) { return 0; } strtoll(str, &err, 10); if(*err == 0) { return 1; } return 0; } N_Integer n_StrToInt(N_String str) { N_Integer res = strtoll(str, NULL, 10); return res; } N_Integer n_Exit(N_Integer ret) { exit(ret); } N_String n_IntToStr(N_Integer val) { char buff[30]; sprintf(buff, "%lld", val); return strdup(buff); } /* User function definitions */ N_Integer n_Euklid(N_Integer n_a,N_Integer n_b) { while((n_a)!=(n_b)) { if((n_a)>(n_b)) { n_a = ((n_a)-(-(-(n_b)))); } else { n_b = ((n_b)-(n_a)); } } return (n_a); } N_Integer n_main(N_String n_arg1,N_String n_arg2) { printf("%s",NANO_STRVAL((n_StrCat((n_IntToStr((n_Euklid((n_StrToInt((n_arg1))),(n_StrToInt((n_arg2))))))),(NANO_MAKESTR("\n")))))); return (0); } /* C main function */ int main(int argc, char* argv[]) { N_String arg1 = NANO_MAKESTR(""); if(1