dmedinag / c-to-forth-compiler Goto Github PK
View Code? Open in Web Editor NEWFew people use Forth. But this might be useful if you want to!
License: MIT License
Few people use Forth. But this might be useful if you want to!
License: MIT License
A few people do use Forth:
http://github.com/ForthHub
chmod u+x run_tests.sh
ian@ian-HP-Convertible-x360-11-ab1XX:/Downloads/C-to-Forth-compiler-master$ ./run_tests.sh
c2f3.tab.c: In function ‘yyparse’:
c2f3.tab.c:1319:16: warning: implicit declaration of function ‘yylex’ [-Wimplicit-function-declaration]
1319 | yychar = yylex ();
| ^~~~~
c2f3.y:97:99: warning: zero-length gnu_printf format string [-Wformat-zero-length]
97 | parameters: /* no parameters declaration */ { sprintf($$, ""); }
| ^
c2f3.y:131:92: error: expected ‘;’ before ‘}’ token
131 | | funcall { printf("%s\n", $1) }
| ^
| ;
c2f3.y:223:79: warning: zero-length gnu_printf format string [-Wformat-zero-length]
223 | : { sprintf($$, ""); }
| ^
c2f3.y:227:79: warning: zero-length gnu_printf format string [-Wformat-zero-length]
227 | ments: { sprintf($$, ""); }
| ^~
c2f3.tab.c:1954:7: warning: implicit declaration of function ‘yyerror’; did you mean ‘yyerrok’? [-Wimplicit-function-declaration]
1954 | yyerror (YY_("syntax error"));
| ^~~~~~~
| yyerrok
c2f3.y: In function ‘yylex’:
c2f3.y:431:28: warning: implicit declaration of function ‘tolower’ [-Wimplicit-function-declaration]
431 | cadena [i++] = tolower (c) ;
| ^~~~~~~
c2f3.y:5:1: note: include ‘<ctype.h>’ or provide a declaration of ‘tolower’
4 | #include <stdlib.h> // declaraciones para exit ()
+++ |+#include <ctype.h>
5 | #define FF fflush(stdout); // para forzar la impresion inmediata
\033[0;32mResults directory cleaned \033[0m
\033[0;32mNo output after a test means success \033[0m
\033[0;32mStarting basic tests...
\033[0;34mTranslating basic tests: dowhile1.c \033[0m
./run_tests.sh: line 24: ./c2: No such file or directory
\033[0;34mExecuting basic tests: dowhile1.c \033[0m
./run_tests.sh: line 28: ./c2: No such file or directory
\033[0;34mTranslating basic tests: if1.c \033[0m
./run_tests.sh: line 24: ./c2: No such file or directory
\033[0;34mExecuting basic tests: if1.c \033[0m
./run_tests.sh: line 28: ./c2: No such file or directory
\033[0;34mTranslating basic tests: printf1.c \033[0m
./run_tests.sh: line 24: ./c2: No such file or directory
\033[0;34mExecuting basic tests: printf1.c \033[0m
./run_tests.sh: line 28: ./c2: No such file or directory
\033[0;34mTranslating basic tests: puts1.c \033[0m
./run_tests.sh: line 24: ./c2: No such file or directory
\033[0;34mExecuting basic tests: puts1.c \033[0m
./run_tests.sh: line 28: ./c2: No such file or directory
\033[0;32mBasic tests finished.
\033[0;32mStarting advanced tests...
\033[0;34mTranslating advanced tests: factorial.c \033[0m
./run_tests.sh: line 38: ./c2: No such file or directory
\033[0;34mExecuting advanced tests: factorial.c \033[0m
./run_tests.sh: line 42: ./c2: No such file or directory
\033[0;34mTranslating advanced tests: nprimos2.c \033[0m
./run_tests.sh: line 38: ./c2: No such file or directory
\033[0;34mExecuting advanced tests: nprimos2.c \033[0m
./run_tests.sh: line 42: ./c2: No such file or directory
\033[0;34mTranslating advanced tests: nprimos3.c \033[0m
./run_tests.sh: line 38: ./c2: No such file or directory
\033[0;34mExecuting advanced tests: nprimos3.c \033[0m
./run_tests.sh: line 42: ./c2: No such file or directory
\033[0;34mTranslating advanced tests: nprimos4.c \033[0m
./run_tests.sh: line 38: ./c2: No such file or directory
\033[0;34mExecuting advanced tests: nprimos4.c \033[0m
./run_tests.sh: line 42: ./c2: No such file or directory
\033[0;34mTranslating advanced tests: potencias.c \033[0m
./run_tests.sh: line 38: ./c2: No such file or directory
\033[0;34mExecuting advanced tests: potencias.c \033[0m
./run_tests.sh: line 42: ./c2: No such file or directory
\033[0;34mTranslating advanced tests: primos1.c \033[0m
./run_tests.sh: line 38: ./c2: No such file or directory
\033[0;34mExecuting advanced tests: primos1.c \033[0m
./run_tests.sh: line 42: ./c2: No such file or directory
\033[0;34mTranslating advanced tests: primos2.c \033[0m
./run_tests.sh: line 38: ./c2: No such file or directory
\033[0;34mExecuting advanced tests: primos2.c \033[0m
./run_tests.sh: line 42: ./c2: No such file or directory
\033[0;32mAdvanced tests finished.
\033[0;32mStarting custom tests...
\033[0;34mTranslating custom tests: test.c \033[0m
./run_tests.sh: line 50: ./c2: No such file or directory
\033[0;34mExecuting advanced tests: test.c \033[0m
./run_tests.sh: line 53: ./c2: No such file or directory
\033[0;32mCustom tests finished.
ian@ian-HP-Convertible-x360-11-ab1XX:/Downloads/C-to-Forth-compiler-master$ ls/Downloads/C-to-Forth-compiler-master$ gcc .c
a.out c2f3.y README.md run_tests.sh test_basicos test_output
c2f3.tab.c LICENSE report.pdf test_avanzados test.c test_results
ian@ian-HP-Convertible-x360-11-ab1XX:
c2f3.tab.c: In function ‘yyparse’:
c2f3.tab.c:1319:16: warning: implicit declaration of function ‘yylex’ [-Wimplicit-function-declaration]
1319 | yychar = yylex ();
| ^~~~~
c2f3.y:97:99: warning: zero-length gnu_printf format string [-Wformat-zero-length]
97 | parameters: / no parameters declaration */ { sprintf($$, ""); }
| ^
c2f3.y:131:92: error: expected ‘;’ before ‘}’ token
131 | | funcall { printf("%s\n", $1) }
| ^
| ;
c2f3.y:223:79: warning: zero-length gnu_printf format string [-Wformat-zero-length]
223 | : { sprintf($$, ""); }
| ^~
c2f3.y:227:79: warning: zero-length gnu_printf format string [-Wformat-zero-length]
227 | ments: { sprintf($$, ""); }
| ^~
c2f3.tab.c:1954:7: warning: implicit declaration of function ‘yyerror’; did you mean ‘yyerrok’? [-Wimplicit-function-declaration]
1954 | yyerror (YY_("syntax error"));
| ^~~~~~~
| yyerrok
c2f3.y: In function ‘yylex’:
c2f3.y:431:28: warning: implicit declaration of function ‘tolower’ [-Wimplicit-function-declaration]
431 | cadena [i++] = tolower (c) ;
| ^~~~~~~
c2f3.y:5:1: note: include ‘<ctype.h>’ or provide a declaration of ‘tolower’
4 | #include <stdlib.h> // declaraciones para exit ()
+++ |+#include <ctype.h>
5 | #define FF fflush(stdout); // para forzar la impresion inmediata
test.c:11:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
11 | function_ifs () {
| ^~~~~~~~~~~~
test.c: In function ‘function_ifs’:
test.c:16:5: warning: implicit declaration of function ‘puts’ [-Wimplicit-function-declaration]
16 | puts("I regret nothing\n");
| ^~~~
test.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘puts’
+++ |+#include <stdio.h>
1 | /* comentario
test.c: At top level:
test.c:32:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
32 | function_loops () {
| ^~~~~~~~~~~~~~
test.c: In function ‘function_loops’:
test.c:44:9: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
44 | printf ("I should be printed only once. %d\n", valui);
| ^~~~~~
test.c:44:9: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
test.c:44:9: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
test.c:44:9: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
test.c: At top level:
test.c:68:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
68 | function_thisoperators () {
| ^~~~~~~~~~~~~~~~~~~~~~
test.c:76:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
76 | function_arrays (int jeje) {
| ^~~~~~~~~~~~~~~
test.c: In function ‘function_arrays’:
test.c:79:5: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
79 | printf("%d", jeje);
| ^~~~~~
test.c:79:5: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
test.c: At top level:
test.c:84:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
84 | function_matrices () {
| ^~~~~~~~~~~~~~~~~
test.c: In function ‘function_matrices’:
test.c:89:5: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
89 | printf("%d", b);
| ^~~~~~
test.c:89:5: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
test.c: At top level:
test.c:92:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
92 | funcion_con_parametros (int a) {
| ^~~~~~~~~~~~~~~~~~~~~~
test.c:97:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
97 | main () {
| ^~~~
test.c: In function ‘main’:
test.c:102:5: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
102 | printf("%d", another_matrix[0][2]);
| ^~~~~~
test.c:102:5: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
ian@ian-HP-Convertible-x360-11-ab1XX:/Downloads/C-to-Forth-compiler-master$ ls/Downloads/C-to-Forth-compiler-master$ vim c2f3.tab.c
a.out c2f3.y README.md run_tests.sh test_basicos test_output
c2f3.tab.c LICENSE report.pdf test_avanzados test.c test_results
ian@ian-HP-Convertible-x360-11-ab1XX:
ian@ian-HP-Convertible-x360-11-ab1XX:/Downloads/C-to-Forth-compiler-master$ gcc c2f3.tab.c -o c2f3
c2f3.tab.c: In function ‘yyparse’:
c2f3.tab.c:1319:16: warning: implicit declaration of function ‘yylex’ [-Wimplicit-function-declaration]
1319 | yychar = yylex ();
| ^~~~~
c2f3.y:97:99: warning: zero-length gnu_printf format string [-Wformat-zero-length]
97 | parameters: /* no parameters declaration */ { sprintf($$, ""); }
| ^
c2f3.y:131:92: error: expected ‘;’ before ‘}’ token
131 | | funcall { printf("%s\n", $1) }
| ^
| ;
c2f3.y:223:79: warning: zero-length gnu_printf format string [-Wformat-zero-length]
223 | : { sprintf($$, ""); }
| ^
c2f3.y:227:79: warning: zero-length gnu_printf format string [-Wformat-zero-length]
227 | ments: { sprintf($$, ""); }
| ^~
c2f3.tab.c:1954:7: warning: implicit declaration of function ‘yyerror’; did you mean ‘yyerrok’? [-Wimplicit-function-declaration]
1954 | yyerror (YY_("syntax error"));
| ^~~~~~~
| yyerrok
c2f3.y: In function ‘yylex’:
c2f3.y:431:28: warning: implicit declaration of function ‘tolower’ [-Wimplicit-function-declaration]
431 | cadena [i++] = tolower (c) ;
| ^~~~~~~
c2f3.y:5:1: note: include ‘<ctype.h>’ or provide a declaration of ‘tolower’
4 | #include <stdlib.h> // declaraciones para exit ()
+++ |+#include <ctype.h>
5 | #define FF fflush(stdout); // para forzar la impresion inmediata
ian@ian-HP-Convertible-x360-11-ab1XX:/Downloads/C-to-Forth-compiler-master$ ./c2f3/Downloads/C-to-Forth-compiler-master$ vim
bash: ./c2f3: No such file or directory
ian@ian-HP-Convertible-x360-11-ab1XX:
https://github.com/daniRiesgo/C-to-Forth-compiler/blob/master/report.pdf
Is there English version for this report please?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.