Skip to content

Instantly share code, notes, and snippets.

@JAChapmanII
Created December 22, 2012 20:44
Show Gist options
  • Select an option

  • Save JAChapmanII/4360985 to your computer and use it in GitHub Desktop.

Select an option

Save JAChapmanII/4360985 to your computer and use it in GitHub Desktop.
pbrane AST generation
./eval "!thing o (2 + 3) 1 + 2; {(\$t = 5)}; \$x = (!c 1 {!o}) + 5;"
1: !thing o (2 + 3) 1 + 2; {($t = 5)}; $x = (!c 1 {!o}) + 5;
; ! thing o ( ; 2 + 3 ; ) 1 + 2 ; ; { ; ( ; $ t = 5 ; ) ; } ; ; $ x = ( ; ! c 1 { ; ! o ; } ; ) + 5 ;
^~~~~~~~^
; ! thing o ( ; 2 + 3 ; ) 1 + 2 ; ; { ; ( ; $ t = 5 ; ) ; } ; ; $ x = ( ; ! c 1 { ; ! o ; } ; ) + 5 ;
^~~~~~~~~~~~^
; ! thing o ( ; 2 + 3 ; ) 1 + 2 ; ; { ; ( ; $ t = 5 ; ) ; } ; ; $ x = ( ; ! c 1 { ; ! o ; } ; ) + 5 ;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
; ! thing o ( ; 2 + 3 ; ) 1 + 2 ; ; { ; ( ; $ t = 5 ; ) ; } ; ; $ x = ( ; ! c 1 { ; ! o ; } ; ) + 5 ;
^~~~~~~~~~^
; ! thing o ( ; 2 + 3 ; ) 1 + 2 ; ; { ; ( ; $ t = 5 ; ) ; } ; ; $ x = ( ; ! c 1 { ; ! o ; } ; ) + 5 ;
^~~~~~~~~~~~~~^
; ! thing o ( ; 2 + 3 ; ) 1 + 2 ; ; { ; ( ; $ t = 5 ; ) ; } ; ; $ x = ( ; ! c 1 { ; ! o ; } ; ) + 5 ;
^~~~~~~~~~~~~~~~~~^
; ! thing o ( ; 2 + 3 ; ) 1 + 2 ; ; { ; ( ; $ t = 5 ; ) ; } ; ; $ x = ( ; ! c 1 { ; ! o ; } ; ) + 5 ;
^~~~~~~~~~~~~~~~~~~~~~^
; ! thing o ( ; 2 + 3 ; ) 1 + 2 ; ; { ; ( ; $ t = 5 ; ) ; } ; ; $ x = ( ; ! c 1 { ; ! o ; } ; ) + 5 ;
^~~~~~~~~~~~~~~~~~~~~~~~~~^
; ! thing o ( ; 2 + 3 ; ) 1 + 2 ; ; { ; ( ; $ t = 5 ; ) ; } ; ; $ x = ( ; ! c 1 { ; ! o ; } ; ) + 5 ;
^~~~~~^
; ! thing o ( ; 2 + 3 ; ) 1 + 2 ; ; { ; ( ; $ t = 5 ; ) ; } ; ; $ x = ( ; ! c 1 { ; ! o ; } ; ) + 5 ;
^~~~~~~~~~^
; ! thing o ( ; 2 + 3 ; ) 1 + 2 ; ; { ; ( ; $ t = 5 ; ) ; } ; ; $ x = ( ; ! c 1 { ; ! o ; } ; ) + 5 ;
^~~~~~~~~~~~~~~~~~~~^
; ! thing o ( ; 2 + 3 ; ) 1 + 2 ; ; { ; ( ; $ t = 5 ; ) ; } ; ; $ x = ( ; ! c 1 { ; ! o ; } ; ) + 5 ;
^~~~~~~~~~~~~~~~~~~~~~~~^
; ! thing o ( ; 2 + 3 ; ) 1 + 2 ; ; { ; ( ; $ t = 5 ; ) ; } ; ; $ x = ( ; ! c 1 { ; ! o ; } ; ) + 5 ;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
final:
!
name: thing
arg: o
a: +
l: 2
r: 3
a: +
l: 1
r: 2
=
l: $
r: t
r: 5
=
l: $
r: x
r: +
l: !
name: c
arg: 1
a: !
name: o
r: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment