Skip to content

Instantly share code, notes, and snippets.

View SineSwiper's full-sized avatar

SineSwiper SineSwiper

View GitHub Profile
@SineSwiper
SineSwiper / gist:3785581
Created September 26, 2012 02:06
Pegex AST expansion example
#############################################################################
#
# QUERY:
# DEALLOCATE [PREPARE] <plan_name>
#
#############################################################################
DeallocateStmt : DEALLOCATE PREPARE? (
name { @->[0] }
| ALL { NULL }
) {
@SineSwiper
SineSwiper / gist:3552700
Created August 31, 2012 13:32
multi rule declaration
sunday_morning: Im waking up | ( cant even focus on a coffee_cup )
coffee_cup: dont even know whos bed Im in
# Parser problems
lyric:
where
do
I
start
where
@SineSwiper
SineSwiper / eyapp2pegex.pgx
Created August 30, 2012 18:29
Weird comment bugs
# "Atoms"
E_CODE : /(
<C_LCURLY>
(:
[^ <C_LCURLY><C_RCURLY> ]+ | # Most stuff
(?1) # Nesting braces
)*
<C_RCURLY>
)/
E_PERCODE : / <PERCENT><E_CODE> ~ / # bit of a hack, as it swallows the % from %}\n