This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -L http://tinyurl.com/DanielVim | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
male(terah). | |
male(abraham). | |
male(nahor). | |
male(haran). | |
male(isaac). | |
male(ismael). | |
male(jacob). | |
female(sarah). | |
female(hagar). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH RECURSIVE | |
xaxis(x) AS (VALUES(-2.0) UNION ALL SELECT x+0.05 FROM xaxis WHERE x<1.2), | |
yaxis(y) AS (VALUES(-1.0) UNION ALL SELECT y+0.1 FROM yaxis WHERE y<1.0), | |
m(iter, cx, cy, x, y) AS ( | |
SELECT 0, x, y, 0.0, 0.0 FROM xaxis, yaxis | |
UNION ALL | |
SELECT iter+1, cx, cy, x*x-y*y + cx, 2.0*x*y + cy FROM m | |
WHERE (x*x + y*y) < 4.0 AND iter<28 | |
), | |
m2(iter, cx, cy) AS ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@grammar::dql | |
############### top markers used by the parser for different contexts | |
start_query | |
= | |
@:top_goal end_marker $ | |
; | |
start_consult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let dqlParser2 = peg("top_level", stack: ParseStack): | |
top_level <- goal * end_marker | |
S <- *Space | |
end_marker <- "." | |
goal <- S * predicate * S * *( separator * S * goal) * *(unary_op) | |
unary_op <- S * "|>" * S * "UN" * S | |
separator <- "," | |
predicate <- named_predicate | selection_stuff | group | |
selection_stuff <- "SEL" | |
group <- "GROUP" |
OlderNewer