420 karma · joined March 31, 2015
WWW SQL Designer, your online SQL diagramming tool
- Convert tree-sitter grammar.json to EBNF https://meimporta.eu/tree-sitter/json2ebnf.html
- An alternative syntax to write tree-sitter grammars https://mingodad.github.io/lua-wasm-playground/ (select "Tree-sitter-ebnf-generator" from "Examples" then click "Run" to see the tree-sitter grammar for the content in "Input Text (arg[1])")
- An Yacc/Lex online editor/tester with several example grammars https://mingodad.github.io/parsertl-playground/playground/
Any feedback is welcome !
See also parsertl-playground[1] for online edit/test grammars.
[0]https://github.com/BenHanson/gram_grep
[1]https://mingodad.github.io/parsertl-playground/playground/
Any feedback is welcome !
Just added several ruby grammars here https://github.com/mingodad/plgh/tree/main/ruby they are converted (mainly using https://www.bottlecaps.de/convert/) to an EBNF understood by https://bottlecaps.de/rr/ui to generate navigable railroad diagrams.
Copy and paste the EBNF on https://www.bottlecaps.de/rr/ui on the tab "Edit Grammar" the click on the tab "View Diagram" to see/download a navigable railroad diagram.
Maybe the general idea is valuable but the implementation ?
"If any spaces or parentheses appear in the type name, they will be substituted by an underscore. Thus unsigned int will become unsigned_int the type BitInt(27) becomes BitInt_27_ ."
Because "unsigned_int" (or any combination of the base types with an underscore) can already be used on user code.
The first step is build as 32 bits as clean as possible then attempt to update to be able to also build for 64 bits.
Actually it's already working on Ubuntu 18.04 see the build here https://github.com/mingodad/cyclone/actions .
One of the main reasons to do it is to preserve for historical purposes .
There is also this other repositories that seems to try something similar:
https://github.com/moon-chilled/cyclonic https://github.com/catb0t/cyclone https://github.com/pippijn/cyclone https://github.com/iphydf/cyclone
I would appreciate if someone have or know where to find the missing versions based on http://www.softwarepreservation.org/projects/c_plus_plus/ind... and the readme at https://github.com/junchih/cfront/blob/master/cfront_3/READM... the missing versions are:
CFRONT 3.0
CFRONT 3.0.1
CFRONT 3.0.2
With then and the change log the understanding of the source code would be a bit easier.
====
select "23 % 3", 23 % 3;
select "12.3 % 3", 12.3 % 3;
select "12 % 2.5", 12 % 2.5;
select "23 / 3", 23 / 3;
select "12.3 / 3", 12.3 / 3;
select "12 / 2.5", 12 / 2.5;
create table ta(a text, b integer, c float);
select 'insert declared types == value types';
insert into ta(a,b,c) values('a', 1, 2.0);
select 'insert declared types != value types text';
insert into ta(a,b,c) values('b', '1', '2.0');
select 'insert declared types != value types';
insert into ta(a,b,c) values('c', 1.0, 2);
select 'update declared types == value types';
update ta set a = 'a' ,b = 1, c = 2.0 where a = 'a';
select 'update declared types != value types text';
update ta set a = 'a' ,b = '1', c = '2.0' where a = 'a';
select 'update declared types != value types';
update ta set a = 'a' ,b = 1.0, c = 2 where a = 'a';
select 'update one value declared types != value types';
update ta set b = 1.0 where a = 'a';
select 'update one value declared types != value types';
update ta set a = 49 where a = 'b';
====
Output default sqlite:
====
23 % 3|2
12.3 % 3|0.0
12 % 2.5|0.0
23 / 3|7
12.3 / 3|4.1
12 / 2.5|4.8
insert declared types == value types
insert declared types != value types text
insert declared types != value types
update declared types == value types
update declared types != value types text
update declared types != value types
update one value declared types != value types
update one value declared types != value types
====
Output of sqlite with "pedantic":
====
23 % 3|2
FP Remainder received non integer values 3.000000 :: 12.300000
12.3 % 3|0.0
FP Remainder received non integer values 2.500000 :: 12.000000
12 % 2.5|0.0
23 / 3|7
FP Division received non integer values 3.000000 :: 12.300000
12.3 / 3|4.1
FP Division received non integer values 2.500000 :: 12.000000
12 / 2.5|4.8
insert declared types == value types
insert declared types != value types text
Affinity applied on make record 1 : 1 : D
Affinity applied on make record 2 : 1 : E
insert declared types != value types
Affinity applied on make record 1 : 2 : D
update declared types == value types
update declared types != value types text
Affinity applied on make record 1 : 1 : D
Affinity applied on make record 2 : 1 : E
update declared types != value types
Affinity applied on make record 1 : 2 : D
update one value declared types != value types
Affinity applied on make record 1 : 2 : D
update one value declared types != value types
Affinity applied on make record 0 : 3 : B
====
I was shocked when I got the results shown here and thought of times in the past were I copied and pasted formulas (and sometimes did some small changes to be accepted by the language I was using) without thinking that any language would interpret it differently without warning.
Other good worth replies in my opinion:
amichal https://news.ycombinator.com/item?id=28100036
hinkley https://news.ycombinator.com/item?id=28101243
hansvm https://news.ycombinator.com/item?id=28100156
I believe that most of us are acting in good faith most of the time and we need some common examples/tests like basic math expressions that we could use to check/evaluate any/most implementations in programming languages to try prevent or minimize divergences like the ones shown here by a random generated expression that has no other meaning than a uncommon valid? test case to show an issue.
====
EXPR = (((((((788.0)(8.46))))+8342.01.803-1.0))4186.4(15.0))(((22.0/((7530.0/((2.0)(((((25.0))-421))))))*597.0)+7283.8-9.60+167.0))+(8871.0)
SQUILU = 8259816920615.1
LUA = 8259816920615.1
JAVASCRIPT = 8259816920615.111
SQLITE = 8259816920615.11
POSTGRESQL = 8259816920615.11377654520912550160000
MYSQL = 8259816920615.113
AMPL = 8.25982e+12
PHP = 8259816920615.1
RUBY = 8259816920615.111
PYTHON = 8.25981692062e+12
====
FORTRAN = 8.51528699E+12
====
Program Hello
Print *, (((((((788)*(8.46))))+8342*1.803-1))*4186.4*(15))*(((22/((7530/((2)*(((((25))-421))))))*597)+7283.8-9.60+167))+(8871)
End Program Hello
====
====
EXPR = (((((((788)*(8.46))))+8342*1.803-1))*4186.4*(15))*(((22/((7530/((2)*(((((25))-421))))))*597)+7283.8-9.60+167))+(8871)
SQUILU = 8515287402650.3
SQLITE = 8515287402650.34
POSTGRESQL = 8515287402650.347200
D = 8.51529e+12
JAVA = 8.515287402650345E12
MYSQL = 8259816920501.086
JAVASCRIPT = 8259816920615.111
PHP = 8259816920615.1
LUA = 8259816920615.1
AMPL = 8.25982e+12
GAMS = 8.25982E+12
RUBY = 7701542593121.873
PYTHON = 7.70154259312e+12
====
=====
EXPR = (((((((788)*(8.46))))+8342*1.803-1))*4186.4*(15))*(((22%284/((7530/((2)*(((((25))-421))))))*597%2663)+7283.8-9.60+167%((3))))+(8871)
D = 8.29038e+12
JAVA = 8.290383058308305E12
MYSQL = 8034912576159.046
POSTGRESQL = 8290383058308.307200
SQLITE = 8290383058308.3
SQUILU = 8291561284461.3
JAVASCRIPT = 8034912576273.071
PHP = 8035491468054
AMPL = 8.03491e+12
GAMS = 8.03491E+12
PYTHON = 1.11064580608e+13
RUBY = 11106458060797.121
LUA = 11664732388290
====