SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Downloaden Sie, um offline zu lesen
“SWP”



       A Generic Language Parser (Gloop?)
(SWP == Semantic Whitespace Parser for want of a better name)

                    Michael Sparks
Parse Anything
    Got bored of seeing “use Prothon”... “no”
●


    Hacking python to add a keyword whilst trivial
●

    wasn't trivial enough
    Got bored of seeing “use prothon's replacement”
●


    Thought it might be a fun thing to try
●


    Got very bored of seeing “use the replacement for
●

    prothon's replacement”
    etc
●
Parse Anything
Parse this:   def displayResult(result,quiet):
                 if not quiet:
                     print quot;The result of parsing your program:quot;
                     print result
                     print
                     if not result:
                        print quot;Rule match/evaluation orderquot;
                        for rule in r:
                           print quot;   quot;, rule
                        end
                     end
                 else:
                     if result is None:
                        print quot;Parse failedquot;
                     else:
                        print quot;Successquot;
                     end
                 end
              end
Parse Anything
              #
Parse this:   # Sample logo like language using the parser
              #

              shape square:
                 pen down
                 repeat 4:
                     forward 10
                     rotate 90
                 end
                 pen up
              end

              repeat (360/5):
                 square()
                 rotate 5
              end
Parse Anything
 Parse this:
#
# Example based on defining grammars   for L-Systems.
#
OBJECT tree L_SYSTEM:
  ROOT G
  RULES:
      G -> T { G } { A G } { B G } {   CG}     (0.00 ..   0.15)
      G -> T { A B G } { B A G } { C   AG}     (0.15 ..   0.30)
      G -> T { A C G } { B B G } { C   BG}     (0.30 ..   0.45)
      G -> T { A A G } { B C G } { C   CG}     (0.45 ..   0.60)
      G -> T { A G } { C G }           (0.70   .. 0.80)
      G -> T { A G } { B G }           (0.80   .. 0.95)
      G -> T { A G }                   (0.95   .. 1.00)
      T -> T                           (0.00   .. 0.75)
  ENDRULES
ENDOBJECT
Parse Anything
Parse this:
#
# An SML-like language using this parser.
#
structure Stk = struct :
    exception EmptyStack_exception
    datatype 'x stack = EmptyStack | push of ('x * 'x stack)
    fun pop(push(x,y)) = y
    fun pop EmptyStack = raise EmptyStack_exception
    fun top(push(x,y)) = x
    fun top EmptyStack = raise EmptyStack_exception
end
Parse Anything, etc
EXPORT OBJECT person:
 PRIVATE:
   flat
   name, telephone
   address::PTR TO LONG
   telephone
 ENDATTRS
ENDOBJECT

PROC compare_address(address1::PTR TO LONG, address2::PTR TO LONG):
   #    Returns *TRUE* if the address2 exists _inside address1
   DEF result=TRUE, f
   FOR f:=0 TO 5:
      IF address2[f]:
          IF Not(((StrLen address2[f])==0) AND ((StrLen address1[f])==0)):
            #        The following line incorrectly(?) says that a
            #        NULL string does not exist inside a NULL string.
            #        The IF above corrects this
            result:=result AND ( ((InStr address1[f],address2[f])<>-1) OR ((StrLe
          ENDIF
      ENDIF
   ENDFOR
ENDPROC result
Parse This?!
OBJECT tree L_SYSTEM:
 ROOT G
  structure Stk = struct :
    exception EmptyStack_exception              if (__name__ == quot;__main__quot;):
    datatype 'x stack = EmptyStack | push of ('x * 'x
                                                   import sys
stack)                                             assign lexonly False
    shape square:                                  assign trace False
      repeat 4:                                   for fields in using query:
        forward 10                                  SELECT fname, lname, t.phone, tsite.name :
        rotate 90                                     FROM tcontact, tsite
      end                                             WHERE table_contact.objid = quot;CONTIDquot;
    end                                               AND table_site.objid = quot;SITEIDquot;
  end                                               ENDSELECT
 RULES:                                           endfor
    G -> T { A G } { C G }       (0.70 .. 0.80) if sys.argv[1]:
    G -> T { A G } { B G }       (0.80 .. 0.95)      assign source open(sys.argv[1]).read()
    G -> T { A G }           (0.95 .. 1.00)        else:
 ENDRULES                                            assign source quot;junkquot;
ENDOBJECT                                          end
                                                end
Parsed!
    ['program', ['block', ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'OBJECT'], ['factorlist', ['factorlist', ['factorlist', ['ID', 'tree']], ['trailedfactor', ['ID',
●

    'L_SYSTEM'], ['blocktrailer', ['block', ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'ROOT'], ['factorlist', ['ID', 'G']]]]], ['statement_list', ['assignment', '=',
    ['explist', ['functioncall', ['ID', 'structure'], ['factorlist', ['ID', 'Stk']]]], ['explist', ['functioncall', ['trailedfactor', ['ID', 'struct'], ['blocktrailer', ['block', ['statement_list',
    ['exprstatement', ['explist', ['functioncall', ['ID', 'exception'], ['factorlist', ['ID', 'EmptyStack_exception']]]]], ['statement_list', ['assignment', '=', ['explist', ['functioncall', ['ID',
    'datatype'], ['factorlist', ['factorlist', ['ID', quot;'xquot;]], ['ID', 'stack']]]], ['explist', ['infixepr', '|', ['ID', 'EmptyStack'], ['explist', ['functioncall', ['ID', 'push'], ['factorlist', ['factorlist', ['ID',
    'of']], ['bracketedexpression', ['bracketedexpression', ['explist', ['infixepr', '*', ['ID', quot;'xquot;], ['explist', ['functioncall', ['ID', quot;'xquot;], ['factorlist', ['ID', 'stack']]]]]]]]]]]]]], ['statement_list',
    ['exprstatement', ['explist', ['functioncall', ['ID', 'shape'], ['factorlist', ['factorlist', ['trailedfactor', ['ID', 'square'], ['blocktrailer', ['block', ['statement_list', ['exprstatement', ['explist',
    ['functioncall', ['ID', 'repeat'], ['factorlist', ['factorlist', ['trailedfactor', ['number', 4], ['blocktrailer', ['block', ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID',
    'forward'], ['factorlist', ['number', 10]]]]], ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'rotate'], ['factorlist', ['number', 90]]]]]]]]]]], ['ID', 'end']]]]]]]]]], ['ID',
    'end']]]]]]]]]]], ['factorlist', ['ID', 'end']]]]], ['statement_list', ['exprstatement', ['explist', ['functioncall', ['trailedfactor', ['ID', 'RULES'], ['blocktrailer', ['block', ['statement_list',
    ['exprstatement', ['explist', ['infixepr', '->', ['ID', 'G'], ['explist', ['functioncall', ['ID', 'T'], ['factorlist', ['factorlist', ['factorlist', ['constructorexpression', ['constructorexpression',
    ['explist', ['functioncall', ['ID', 'A'], ['factorlist', ['ID', 'G']]]]]]], ['constructorexpression', ['constructorexpression', ['explist', ['functioncall', ['ID', 'C'], ['factorlist', ['ID', 'G']]]]]]],
    ['bracketedexpression', ['bracketedexpression', ['explist', ['infixepr', '..', ['dottedfactor', ['number', 0], ['attribute', ['number', 70]]], ['explist', ['expression', ['dottedfactor', ['number',
    0], ['attribute', ['number', 80]]]]]]]]]]]]]]], ['statement_list', ['exprstatement', ['explist', ['infixepr', '->', ['ID', 'G'], ['explist', ['functioncall', ['ID', 'T'], ['factorlist', ['factorlist',
    ['factorlist', ['constructorexpression', ['constructorexpression', ['explist', ['functioncall', ['ID', 'A'], ['factorlist', ['ID', 'G']]]]]]], ['constructorexpression', ['constructorexpression',
    ['explist', ['functioncall', ['ID', 'B'], ['factorlist', ['ID', 'G']]]]]]], ['bracketedexpression', ['bracketedexpression', ['explist', ['infixepr', '..', ['dottedfactor', ['number', 0], ['attribute',
    ['number', 80]]], ['explist', ['expression', ['dottedfactor', ['number', 0], ['attribute', ['number', 95]]]]]]]]]]]]]]], ['statement_list', ['exprstatement', ['explist', ['infixepr', '->', ['ID', 'G'],
    ['explist', ['functioncall', ['ID', 'T'], ['factorlist', ['factorlist', ['constructorexpression', ['constructorexpression', ['explist', ['functioncall', ['ID', 'A'], ['factorlist', ['ID', 'G']]]]]]],
    ['bracketedexpression', ['bracketedexpression', ['explist', ['infixepr', '..', ['dottedfactor', ['number', 0], ['attribute', ['number', 95]]], ['explist', ['expression', ['dottedfactor', ['number',
    1], ['attribute', ['number', 0]]]]]]]]]]]]]]]]]]]]], ['factorlist', ['ID', 'ENDRULES']]]]]]]]]]]], ['ID', 'ENDOBJECT']]]]], ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID',
    'if'], ['factorlist', ['factorlist', ['trailedfactor', ['bracketedexpression', ['bracketedexpression', ['explist', ['infixepr', '==', ['ID', '__name__'], ['explist', ['expression', ['string',
    '__main__']]]]]]], ['blocktrailer', ['block', ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'import'], ['factorlist', ['ID', 'sys']]]]], ['statement_list', ['exprstatement',
    ['explist', ['functioncall', ['ID', 'assign'], ['factorlist', ['factorlist', ['ID', 'lexonly']], ['ID', 'False']]]]], ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'assign'],
    ['factorlist', ['factorlist', ['ID', 'trace']], ['ID', 'False']]]]], ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'for'], ['factorlist', ['factorlist', ['factorlist', ['factorlist',
    ['factorlist', ['ID', 'fields']], ['ID', 'in']], ['ID', 'using']], ['trailedfactor', ['ID', 'query'], ['blocktrailer', ['block', ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID',
    'SELECT'], ['factorlist', ['ID', 'first_name']]], ['explist', ['expression', ['ID', 'last_name']], ['explist', ['expression', ['dottedfactor', ['ID', 'table_contact'], ['attribute', ['ID', 'phone']]]],
    ['explist', ['expression', ['ID', 'e_mail']], ['explist', ['functioncall', ['dottedfactor', ['ID', 'table_site'], ['attribute', ['trailedfactor', ['ID', 'name'], ['blocktrailer', ['block', ['statement_list',
    ['exprstatement', ['explist', ['functioncall', ['ID', 'FROM'], ['factorlist', ['ID', 'table_contact']]], ['explist', ['expression', ['ID', 'table_site']]]]], ['statement_list', ['assignment', '=',
    ['explist', ['functioncall', ['ID', 'WHERE'], ['factorlist', ['dottedfactor', ['ID', 'table_contact'], ['attribute', ['ID', 'objid']]]]]], ['explist', ['expression', ['string',
    '<CASECONTACTID>']]]], ['statement_list', ['assignment', '=', ['explist', ['functioncall', ['ID', 'AND'], ['factorlist', ['dottedfactor', ['ID', 'table_site'], ['attribute', ['ID', 'objid']]]]]],
    ['explist', ['expression', ['string', '<CASESITEID>']]]]]]]]]]]], ['factorlist', ['ID', 'ENDSELECT']]]]]]]]]]]]]], ['ID', 'endfor']]]]], ['statement_list', ['exprstatement', ['explist',
    ['functioncall', ['ID', 'if'], ['factorlist', ['factorlist', ['factorlist', ['dottedfactor', ['ID', 'sys'], ['attribute', ['trailedfactor', ['trailedfactor', ['ID', 'argv'], ['bracketedtrailer', ['explist',
    ['expression', ['number', 1]]]]], ['blocktrailer', ['block', ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'assign'], ['factorlist', ['factorlist', ['factorlist', ['ID',
    'source']], ['ID', 'open']], ['dottedfactor', ['bracketedexpression', ['bracketedexpression', ['explist', ['expression', ['dottedfactor', ['ID', 'sys'], ['attribute', ['trailedfactor', ['ID', 'argv'],
    ['bracketedtrailer', ['explist', ['expression', ['number', 1]]]]]]]]]]], ['methodcall', 'read', ['bracketedexpression', None]]]]]]]]]]]]]], ['trailedfactor', ['ID', 'else'], ['blocktrailer', ['block',
    ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'assign'], ['factorlist', ['factorlist', ['ID', 'source']], ['string', 'junk']]]]]]]]]], ['ID', 'end']]]]]]]]]]]]]], ['ID', 'end']]]]]]]]
Grammar (SLR)
program -> block
block -> BLOCKSTART statement_list BLOCKEND
statement_list -> statement*
statement -> (expression | expression ASSIGNMENT expression | ) EOL
expression -> oldexpression (COMMA expression)*
oldexpression -> (factor [factorlist] | factor INFIXOPERATOR expression )
factorlist -> factor* factor
factor -> ( bracketedexpression | constructorexpression | NUMBER | STRING |
ID
       | factor DOT dotexpression | factor trailer | factor trailertoo )
dotexpression -> (ID bracketedexpression | factor )
bracketedexpression -> BRA [ expression ] KET
constructorexpression -> BRA3 [ expression ] KET3
trailer -> BRA2 expression KET2
trailertoo -> COLON EOL block
Notes
    Just uses a slightly modified PLY (1.5)
●


    All of the examples are parseable by the same
●

    parser – no changes to the lexer or parser.
    Just spits out a syntax tree
●


    Treats everything as a function
●
Everything's a function
    This is a function:
●

    if bar(bibble=>baz):
       bla bla bla
       bingle
       bongle
    else:
       babble babble
       this = bing
    Parsed as: Call function “if” with the arguments:
●

    bar(bibble=>baz), codeblock, “else”, codeblock, “endif”
Where...?
    http:///www.cerenity.org/SWP-0.0.0.tar.gz
●


    http://www.cerenity.org/SWP/
●


    I'd be curious to see someone put a lisp back end
●

    on it :-)
        Actually no, don't do that, someone might use this
    –
        then...

Weitere Àhnliche Inhalte

Was ist angesagt?

Erlang Introduction Bcberlin3
Erlang Introduction Bcberlin3Erlang Introduction Bcberlin3
Erlang Introduction Bcberlin3
guesta3202
 
àž àžČàž©àžČàž‹àž”
àž àžČàž©àžČàž‹àž”àž àžČàž©àžČàž‹àž”
àž àžČàž©àžČàž‹àž”
kramsri
 

Was ist angesagt? (20)

Rたă‚čă‚łăƒŒăƒ—ăšăƒ•ăƒŹăƒŒăƒ ăšç’°ćąƒăš
Rたă‚čă‚łăƒŒăƒ—ăšăƒ•ăƒŹăƒŒăƒ ăšç’°ćąƒăšRたă‚čă‚łăƒŒăƒ—ăšăƒ•ăƒŹăƒŒăƒ ăšç’°ćąƒăš
Rたă‚čă‚łăƒŒăƒ—ăšăƒ•ăƒŹăƒŒăƒ ăšç’°ćąƒăš
 
Functional C++
Functional C++Functional C++
Functional C++
 
Rデバッグあれこれ
RデバッグあれこれRデバッグあれこれ
Rデバッグあれこれ
 
TDC2016POA | Trilha .NET - C# como vocĂȘ nunca viu: conceitos avançados de pro...
TDC2016POA | Trilha .NET - C# como vocĂȘ nunca viu: conceitos avançados de pro...TDC2016POA | Trilha .NET - C# como vocĂȘ nunca viu: conceitos avançados de pro...
TDC2016POA | Trilha .NET - C# como vocĂȘ nunca viu: conceitos avançados de pro...
 
TDC2016POA | Trilha .NET - CQRS e ES na prĂĄtica com RavenDB
TDC2016POA | Trilha .NET - CQRS e ES na prĂĄtica com RavenDBTDC2016POA | Trilha .NET - CQRS e ES na prĂĄtica com RavenDB
TDC2016POA | Trilha .NET - CQRS e ES na prĂĄtica com RavenDB
 
Swift에서 êŒŹëŠŹìžŹê·€ ì‚Źìš©êž° (Tail Recursion)
Swift에서 êŒŹëŠŹìžŹê·€ ì‚Źìš©êž° (Tail Recursion)Swift에서 êŒŹëŠŹìžŹê·€ ì‚Źìš©êž° (Tail Recursion)
Swift에서 êŒŹëŠŹìžŹê·€ ì‚Źìš©êž° (Tail Recursion)
 
The Ring programming language version 1.7 book - Part 35 of 196
The Ring programming language version 1.7 book - Part 35 of 196The Ring programming language version 1.7 book - Part 35 of 196
The Ring programming language version 1.7 book - Part 35 of 196
 
Erlang Introduction Bcberlin3
Erlang Introduction Bcberlin3Erlang Introduction Bcberlin3
Erlang Introduction Bcberlin3
 
Python decorators (äž­æ–‡)
Python decorators (äž­æ–‡)Python decorators (äž­æ–‡)
Python decorators (äž­æ–‡)
 
Programming Java - Lection 04 - Generics and Lambdas - Lavrentyev Fedor
Programming Java - Lection 04 - Generics and Lambdas - Lavrentyev FedorProgramming Java - Lection 04 - Generics and Lambdas - Lavrentyev Fedor
Programming Java - Lection 04 - Generics and Lambdas - Lavrentyev Fedor
 
Postgresql 9.3 overview
Postgresql 9.3 overviewPostgresql 9.3 overview
Postgresql 9.3 overview
 
Implementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 reduxImplementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 redux
 
Groovy kind of test
Groovy kind of testGroovy kind of test
Groovy kind of test
 
Comparative Genomics with GMOD and BioPerl
Comparative Genomics with GMOD and BioPerlComparative Genomics with GMOD and BioPerl
Comparative Genomics with GMOD and BioPerl
 
Why Learn Python?
Why Learn Python?Why Learn Python?
Why Learn Python?
 
Tuga it 2016 - What's New In C# 6
Tuga it 2016 - What's New In C# 6Tuga it 2016 - What's New In C# 6
Tuga it 2016 - What's New In C# 6
 
àž àžČàž©àžČàž‹àž”
àž àžČàž©àžČàž‹àž”àž àžČàž©àžČàž‹àž”
àž àžČàž©àžČàž‹àž”
 
The bones of a nice Python script
The bones of a nice Python scriptThe bones of a nice Python script
The bones of a nice Python script
 
c programming
c programmingc programming
c programming
 
c programming
c programmingc programming
c programming
 

Andere mochten auch

Andere mochten auch (15)

Scaling Streaming - Concepts, Research, Goals
Scaling Streaming - Concepts, Research, GoalsScaling Streaming - Concepts, Research, Goals
Scaling Streaming - Concepts, Research, Goals
 
Open Source at the BBC
Open Source at the BBCOpen Source at the BBC
Open Source at the BBC
 
Open Source at the BBC: When, Why, Why not & How
Open Source at the BBC: When, Why, Why not & HowOpen Source at the BBC: When, Why, Why not & How
Open Source at the BBC: When, Why, Why not & How
 
Building systems with Kamaelia
Building systems with KamaeliaBuilding systems with Kamaelia
Building systems with Kamaelia
 
Free software: How does it work?
Free software: How does it work?Free software: How does it work?
Free software: How does it work?
 
Sharing Data and Services Safely in Concurrent Systems using Kamaelia
Sharing Data and Services Safely in Concurrent Systems using KamaeliaSharing Data and Services Safely in Concurrent Systems using Kamaelia
Sharing Data and Services Safely in Concurrent Systems using Kamaelia
 
Managing Creativity
Managing CreativityManaging Creativity
Managing Creativity
 
The Selfish Programmer
The Selfish ProgrammerThe Selfish Programmer
The Selfish Programmer
 
Kamaelia Grey
Kamaelia GreyKamaelia Grey
Kamaelia Grey
 
Timeshift Everything, Miss Nothing - Mashup your PVR with Kamaelia
Timeshift Everything, Miss Nothing - Mashup your PVR with KamaeliaTimeshift Everything, Miss Nothing - Mashup your PVR with Kamaelia
Timeshift Everything, Miss Nothing - Mashup your PVR with Kamaelia
 
Practical concurrent systems made simple using Kamaelia
Practical concurrent systems made simple using KamaeliaPractical concurrent systems made simple using Kamaelia
Practical concurrent systems made simple using Kamaelia
 
Kamaelia Europython Tutorial
Kamaelia Europython TutorialKamaelia Europython Tutorial
Kamaelia Europython Tutorial
 
Kamaelia Protocol Walkthrough
Kamaelia Protocol WalkthroughKamaelia Protocol Walkthrough
Kamaelia Protocol Walkthrough
 
Kamaelia lightning2010opensource
Kamaelia lightning2010opensourceKamaelia lightning2010opensource
Kamaelia lightning2010opensource
 
Embracing concurrency for fun utility and simpler code
Embracing concurrency for fun utility and simpler codeEmbracing concurrency for fun utility and simpler code
Embracing concurrency for fun utility and simpler code
 

Ähnlich wie SWP - A Generic Language Parser

Hidden Gems of Ruby 1.9
Hidden Gems of Ruby 1.9Hidden Gems of Ruby 1.9
Hidden Gems of Ruby 1.9
Aaron Patterson
 
Ruby Language - A quick tour
Ruby Language - A quick tourRuby Language - A quick tour
Ruby Language - A quick tour
aztack
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
Emil Vladev
 
Good Evils In Perl
Good Evils In PerlGood Evils In Perl
Good Evils In Perl
Kang-min Liu
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
agnonchik
 
珏äșŒèźČ 鹄怇-PythonćŸș瀎
珏äșŒèźČ 鹄怇-PythonćŸș瀎珏äșŒèźČ 鹄怇-PythonćŸș瀎
珏äșŒèźČ 鹄怇-PythonćŸș瀎
anzhong70
 

Ähnlich wie SWP - A Generic Language Parser (20)

Round PEG, Round Hole - Parsing Functionally
Round PEG, Round Hole - Parsing FunctionallyRound PEG, Round Hole - Parsing Functionally
Round PEG, Round Hole - Parsing Functionally
 
Groovy
GroovyGroovy
Groovy
 
7 functions
7  functions7  functions
7 functions
 
Python basic
Python basicPython basic
Python basic
 
GE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python ProgrammingGE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python Programming
 
Hidden Gems of Ruby 1.9
Hidden Gems of Ruby 1.9Hidden Gems of Ruby 1.9
Hidden Gems of Ruby 1.9
 
Hidden treasures of Ruby
Hidden treasures of RubyHidden treasures of Ruby
Hidden treasures of Ruby
 
Ruby Language - A quick tour
Ruby Language - A quick tourRuby Language - A quick tour
Ruby Language - A quick tour
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tour
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tour
 
III MCS python lab (1).pdf
III MCS python lab (1).pdfIII MCS python lab (1).pdf
III MCS python lab (1).pdf
 
Functional Programming with Groovy
Functional Programming with GroovyFunctional Programming with Groovy
Functional Programming with Groovy
 
Good Evils In Perl
Good Evils In PerlGood Evils In Perl
Good Evils In Perl
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Clojure basics
Clojure basicsClojure basics
Clojure basics
 
珏äșŒèźČ PythonćŸș瀎
珏äșŒèźČ PythonćŸș瀎珏äșŒèźČ PythonćŸș瀎
珏äșŒèźČ PythonćŸș瀎
 
珏äșŒèźČ 鹄怇-PythonćŸș瀎
珏äșŒèźČ 鹄怇-PythonćŸș瀎珏äșŒèźČ 鹄怇-PythonćŸș瀎
珏äșŒèźČ 鹄怇-PythonćŸș瀎
 
python codes
python codespython codes
python codes
 

KĂŒrzlich hochgeladen

VIP Call Girl in Mumbai 💧 9920725232 ( Call Me ) Get A New Crush Everyday Wit...
VIP Call Girl in Mumbai 💧 9920725232 ( Call Me ) Get A New Crush Everyday Wit...VIP Call Girl in Mumbai 💧 9920725232 ( Call Me ) Get A New Crush Everyday Wit...
VIP Call Girl in Mumbai 💧 9920725232 ( Call Me ) Get A New Crush Everyday Wit...
dipikadinghjn ( Why You Choose Us? ) Escorts
 
From Luxury Escort Service Kamathipura : 9352852248 Make on-demand Arrangemen...
From Luxury Escort Service Kamathipura : 9352852248 Make on-demand Arrangemen...From Luxury Escort Service Kamathipura : 9352852248 Make on-demand Arrangemen...
From Luxury Escort Service Kamathipura : 9352852248 Make on-demand Arrangemen...
From Luxury Escort : 9352852248 Make on-demand Arrangements Near yOU
 
VIP Independent Call Girls in Andheri đŸŒč 9920725232 ( Call Me ) Mumbai Escorts...
VIP Independent Call Girls in Andheri đŸŒč 9920725232 ( Call Me ) Mumbai Escorts...VIP Independent Call Girls in Andheri đŸŒč 9920725232 ( Call Me ) Mumbai Escorts...
VIP Independent Call Girls in Andheri đŸŒč 9920725232 ( Call Me ) Mumbai Escorts...
dipikadinghjn ( Why You Choose Us? ) Escorts
 
VIP Call Girl in Mira Road 💧 9920725232 ( Call Me ) Get A New Crush Everyday ...
VIP Call Girl in Mira Road 💧 9920725232 ( Call Me ) Get A New Crush Everyday ...VIP Call Girl in Mira Road 💧 9920725232 ( Call Me ) Get A New Crush Everyday ...
VIP Call Girl in Mira Road 💧 9920725232 ( Call Me ) Get A New Crush Everyday ...
dipikadinghjn ( Why You Choose Us? ) Escorts
 
VIP Independent Call Girls in Taloja đŸŒč 9920725232 ( Call Me ) Mumbai Escorts ...
VIP Independent Call Girls in Taloja đŸŒč 9920725232 ( Call Me ) Mumbai Escorts ...VIP Independent Call Girls in Taloja đŸŒč 9920725232 ( Call Me ) Mumbai Escorts ...
VIP Independent Call Girls in Taloja đŸŒč 9920725232 ( Call Me ) Mumbai Escorts ...
dipikadinghjn ( Why You Choose Us? ) Escorts
 
( Jasmin ) Top VIP Escorts Service Dindigul 💧 7737669865 💧 by Dindigul Call G...
( Jasmin ) Top VIP Escorts Service Dindigul 💧 7737669865 💧 by Dindigul Call G...( Jasmin ) Top VIP Escorts Service Dindigul 💧 7737669865 💧 by Dindigul Call G...
( Jasmin ) Top VIP Escorts Service Dindigul 💧 7737669865 💧 by Dindigul Call G...
dipikadinghjn ( Why You Choose Us? ) Escorts
 

KĂŒrzlich hochgeladen (20)

Indore Real Estate Market Trends Report.pdf
Indore Real Estate Market Trends Report.pdfIndore Real Estate Market Trends Report.pdf
Indore Real Estate Market Trends Report.pdf
 
Top Rated Pune Call Girls Lohegaon ⟟ 6297143586 ⟟ Call Me For Genuine Sex Se...
Top Rated  Pune Call Girls Lohegaon ⟟ 6297143586 ⟟ Call Me For Genuine Sex Se...Top Rated  Pune Call Girls Lohegaon ⟟ 6297143586 ⟟ Call Me For Genuine Sex Se...
Top Rated Pune Call Girls Lohegaon ⟟ 6297143586 ⟟ Call Me For Genuine Sex Se...
 
VIP Call Girl in Mumbai 💧 9920725232 ( Call Me ) Get A New Crush Everyday Wit...
VIP Call Girl in Mumbai 💧 9920725232 ( Call Me ) Get A New Crush Everyday Wit...VIP Call Girl in Mumbai 💧 9920725232 ( Call Me ) Get A New Crush Everyday Wit...
VIP Call Girl in Mumbai 💧 9920725232 ( Call Me ) Get A New Crush Everyday Wit...
 
Top Rated Pune Call Girls Sinhagad Road ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated  Pune Call Girls Sinhagad Road ⟟ 6297143586 ⟟ Call Me For Genuine S...Top Rated  Pune Call Girls Sinhagad Road ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated Pune Call Girls Sinhagad Road ⟟ 6297143586 ⟟ Call Me For Genuine S...
 
From Luxury Escort Service Kamathipura : 9352852248 Make on-demand Arrangemen...
From Luxury Escort Service Kamathipura : 9352852248 Make on-demand Arrangemen...From Luxury Escort Service Kamathipura : 9352852248 Make on-demand Arrangemen...
From Luxury Escort Service Kamathipura : 9352852248 Make on-demand Arrangemen...
 
VIP Independent Call Girls in Andheri đŸŒč 9920725232 ( Call Me ) Mumbai Escorts...
VIP Independent Call Girls in Andheri đŸŒč 9920725232 ( Call Me ) Mumbai Escorts...VIP Independent Call Girls in Andheri đŸŒč 9920725232 ( Call Me ) Mumbai Escorts...
VIP Independent Call Girls in Andheri đŸŒč 9920725232 ( Call Me ) Mumbai Escorts...
 
Webinar on E-Invoicing for Fintech Belgium
Webinar on E-Invoicing for Fintech BelgiumWebinar on E-Invoicing for Fintech Belgium
Webinar on E-Invoicing for Fintech Belgium
 
VIP Call Girl in Mira Road 💧 9920725232 ( Call Me ) Get A New Crush Everyday ...
VIP Call Girl in Mira Road 💧 9920725232 ( Call Me ) Get A New Crush Everyday ...VIP Call Girl in Mira Road 💧 9920725232 ( Call Me ) Get A New Crush Everyday ...
VIP Call Girl in Mira Road 💧 9920725232 ( Call Me ) Get A New Crush Everyday ...
 
Call Girls Koregaon Park Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Koregaon Park Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Koregaon Park Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Koregaon Park Call Me 7737669865 Budget Friendly No Advance Booking
 
Business Principles, Tools, and Techniques in Participating in Various Types...
Business Principles, Tools, and Techniques  in Participating in Various Types...Business Principles, Tools, and Techniques  in Participating in Various Types...
Business Principles, Tools, and Techniques in Participating in Various Types...
 
VIP Independent Call Girls in Taloja đŸŒč 9920725232 ( Call Me ) Mumbai Escorts ...
VIP Independent Call Girls in Taloja đŸŒč 9920725232 ( Call Me ) Mumbai Escorts ...VIP Independent Call Girls in Taloja đŸŒč 9920725232 ( Call Me ) Mumbai Escorts ...
VIP Independent Call Girls in Taloja đŸŒč 9920725232 ( Call Me ) Mumbai Escorts ...
 
Booking open Available Pune Call Girls Talegaon Dabhade 6297143586 Call Hot ...
Booking open Available Pune Call Girls Talegaon Dabhade  6297143586 Call Hot ...Booking open Available Pune Call Girls Talegaon Dabhade  6297143586 Call Hot ...
Booking open Available Pune Call Girls Talegaon Dabhade 6297143586 Call Hot ...
 
Diva-Thane European Call Girls Number-9833754194-Diva Busty Professional Call...
Diva-Thane European Call Girls Number-9833754194-Diva Busty Professional Call...Diva-Thane European Call Girls Number-9833754194-Diva Busty Professional Call...
Diva-Thane European Call Girls Number-9833754194-Diva Busty Professional Call...
 
Top Rated Pune Call Girls Dighi ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Dighi ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Dighi ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Dighi ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...
Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...
Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...
 
( Jasmin ) Top VIP Escorts Service Dindigul 💧 7737669865 💧 by Dindigul Call G...
( Jasmin ) Top VIP Escorts Service Dindigul 💧 7737669865 💧 by Dindigul Call G...( Jasmin ) Top VIP Escorts Service Dindigul 💧 7737669865 💧 by Dindigul Call G...
( Jasmin ) Top VIP Escorts Service Dindigul 💧 7737669865 💧 by Dindigul Call G...
 
Enjoy Night⚡Call Girls Patel Nagar Delhi >àŒ’8448380779 Escort Service
Enjoy Night⚡Call Girls Patel Nagar Delhi >àŒ’8448380779 Escort ServiceEnjoy Night⚡Call Girls Patel Nagar Delhi >àŒ’8448380779 Escort Service
Enjoy Night⚡Call Girls Patel Nagar Delhi >àŒ’8448380779 Escort Service
 
Stock Market Brief Deck (Under Pressure).pdf
Stock Market Brief Deck (Under Pressure).pdfStock Market Brief Deck (Under Pressure).pdf
Stock Market Brief Deck (Under Pressure).pdf
 
(INDIRA) Call Girl Srinagar Call Now 8617697112 Srinagar Escorts 24x7
(INDIRA) Call Girl Srinagar Call Now 8617697112 Srinagar Escorts 24x7(INDIRA) Call Girl Srinagar Call Now 8617697112 Srinagar Escorts 24x7
(INDIRA) Call Girl Srinagar Call Now 8617697112 Srinagar Escorts 24x7
 
Booking open Available Pune Call Girls Wadgaon Sheri 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Wadgaon Sheri  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Wadgaon Sheri  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Wadgaon Sheri 6297143586 Call Hot Ind...
 

SWP - A Generic Language Parser

  • 1. “SWP” A Generic Language Parser (Gloop?) (SWP == Semantic Whitespace Parser for want of a better name) Michael Sparks
  • 2. Parse Anything Got bored of seeing “use Prothon”... “no” ● Hacking python to add a keyword whilst trivial ● wasn't trivial enough Got bored of seeing “use prothon's replacement” ● Thought it might be a fun thing to try ● Got very bored of seeing “use the replacement for ● prothon's replacement” etc ●
  • 3. Parse Anything Parse this: def displayResult(result,quiet): if not quiet: print quot;The result of parsing your program:quot; print result print if not result: print quot;Rule match/evaluation orderquot; for rule in r: print quot; quot;, rule end end else: if result is None: print quot;Parse failedquot; else: print quot;Successquot; end end end
  • 4. Parse Anything # Parse this: # Sample logo like language using the parser # shape square: pen down repeat 4: forward 10 rotate 90 end pen up end repeat (360/5): square() rotate 5 end
  • 5. Parse Anything Parse this: # # Example based on defining grammars for L-Systems. # OBJECT tree L_SYSTEM: ROOT G RULES: G -> T { G } { A G } { B G } { CG} (0.00 .. 0.15) G -> T { A B G } { B A G } { C AG} (0.15 .. 0.30) G -> T { A C G } { B B G } { C BG} (0.30 .. 0.45) G -> T { A A G } { B C G } { C CG} (0.45 .. 0.60) G -> T { A G } { C G } (0.70 .. 0.80) G -> T { A G } { B G } (0.80 .. 0.95) G -> T { A G } (0.95 .. 1.00) T -> T (0.00 .. 0.75) ENDRULES ENDOBJECT
  • 6. Parse Anything Parse this: # # An SML-like language using this parser. # structure Stk = struct : exception EmptyStack_exception datatype 'x stack = EmptyStack | push of ('x * 'x stack) fun pop(push(x,y)) = y fun pop EmptyStack = raise EmptyStack_exception fun top(push(x,y)) = x fun top EmptyStack = raise EmptyStack_exception end
  • 7. Parse Anything, etc EXPORT OBJECT person: PRIVATE: flat name, telephone address::PTR TO LONG telephone ENDATTRS ENDOBJECT PROC compare_address(address1::PTR TO LONG, address2::PTR TO LONG): # Returns *TRUE* if the address2 exists _inside address1 DEF result=TRUE, f FOR f:=0 TO 5: IF address2[f]: IF Not(((StrLen address2[f])==0) AND ((StrLen address1[f])==0)): # The following line incorrectly(?) says that a # NULL string does not exist inside a NULL string. # The IF above corrects this result:=result AND ( ((InStr address1[f],address2[f])<>-1) OR ((StrLe ENDIF ENDIF ENDFOR ENDPROC result
  • 8. Parse This?! OBJECT tree L_SYSTEM: ROOT G structure Stk = struct : exception EmptyStack_exception if (__name__ == quot;__main__quot;): datatype 'x stack = EmptyStack | push of ('x * 'x import sys stack) assign lexonly False shape square: assign trace False repeat 4: for fields in using query: forward 10 SELECT fname, lname, t.phone, tsite.name : rotate 90 FROM tcontact, tsite end WHERE table_contact.objid = quot;CONTIDquot; end AND table_site.objid = quot;SITEIDquot; end ENDSELECT RULES: endfor G -> T { A G } { C G } (0.70 .. 0.80) if sys.argv[1]: G -> T { A G } { B G } (0.80 .. 0.95) assign source open(sys.argv[1]).read() G -> T { A G } (0.95 .. 1.00) else: ENDRULES assign source quot;junkquot; ENDOBJECT end end
  • 9. Parsed! ['program', ['block', ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'OBJECT'], ['factorlist', ['factorlist', ['factorlist', ['ID', 'tree']], ['trailedfactor', ['ID', ● 'L_SYSTEM'], ['blocktrailer', ['block', ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'ROOT'], ['factorlist', ['ID', 'G']]]]], ['statement_list', ['assignment', '=', ['explist', ['functioncall', ['ID', 'structure'], ['factorlist', ['ID', 'Stk']]]], ['explist', ['functioncall', ['trailedfactor', ['ID', 'struct'], ['blocktrailer', ['block', ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'exception'], ['factorlist', ['ID', 'EmptyStack_exception']]]]], ['statement_list', ['assignment', '=', ['explist', ['functioncall', ['ID', 'datatype'], ['factorlist', ['factorlist', ['ID', quot;'xquot;]], ['ID', 'stack']]]], ['explist', ['infixepr', '|', ['ID', 'EmptyStack'], ['explist', ['functioncall', ['ID', 'push'], ['factorlist', ['factorlist', ['ID', 'of']], ['bracketedexpression', ['bracketedexpression', ['explist', ['infixepr', '*', ['ID', quot;'xquot;], ['explist', ['functioncall', ['ID', quot;'xquot;], ['factorlist', ['ID', 'stack']]]]]]]]]]]]]], ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'shape'], ['factorlist', ['factorlist', ['trailedfactor', ['ID', 'square'], ['blocktrailer', ['block', ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'repeat'], ['factorlist', ['factorlist', ['trailedfactor', ['number', 4], ['blocktrailer', ['block', ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'forward'], ['factorlist', ['number', 10]]]]], ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'rotate'], ['factorlist', ['number', 90]]]]]]]]]]], ['ID', 'end']]]]]]]]]], ['ID', 'end']]]]]]]]]]], ['factorlist', ['ID', 'end']]]]], ['statement_list', ['exprstatement', ['explist', ['functioncall', ['trailedfactor', ['ID', 'RULES'], ['blocktrailer', ['block', ['statement_list', ['exprstatement', ['explist', ['infixepr', '->', ['ID', 'G'], ['explist', ['functioncall', ['ID', 'T'], ['factorlist', ['factorlist', ['factorlist', ['constructorexpression', ['constructorexpression', ['explist', ['functioncall', ['ID', 'A'], ['factorlist', ['ID', 'G']]]]]]], ['constructorexpression', ['constructorexpression', ['explist', ['functioncall', ['ID', 'C'], ['factorlist', ['ID', 'G']]]]]]], ['bracketedexpression', ['bracketedexpression', ['explist', ['infixepr', '..', ['dottedfactor', ['number', 0], ['attribute', ['number', 70]]], ['explist', ['expression', ['dottedfactor', ['number', 0], ['attribute', ['number', 80]]]]]]]]]]]]]]], ['statement_list', ['exprstatement', ['explist', ['infixepr', '->', ['ID', 'G'], ['explist', ['functioncall', ['ID', 'T'], ['factorlist', ['factorlist', ['factorlist', ['constructorexpression', ['constructorexpression', ['explist', ['functioncall', ['ID', 'A'], ['factorlist', ['ID', 'G']]]]]]], ['constructorexpression', ['constructorexpression', ['explist', ['functioncall', ['ID', 'B'], ['factorlist', ['ID', 'G']]]]]]], ['bracketedexpression', ['bracketedexpression', ['explist', ['infixepr', '..', ['dottedfactor', ['number', 0], ['attribute', ['number', 80]]], ['explist', ['expression', ['dottedfactor', ['number', 0], ['attribute', ['number', 95]]]]]]]]]]]]]]], ['statement_list', ['exprstatement', ['explist', ['infixepr', '->', ['ID', 'G'], ['explist', ['functioncall', ['ID', 'T'], ['factorlist', ['factorlist', ['constructorexpression', ['constructorexpression', ['explist', ['functioncall', ['ID', 'A'], ['factorlist', ['ID', 'G']]]]]]], ['bracketedexpression', ['bracketedexpression', ['explist', ['infixepr', '..', ['dottedfactor', ['number', 0], ['attribute', ['number', 95]]], ['explist', ['expression', ['dottedfactor', ['number', 1], ['attribute', ['number', 0]]]]]]]]]]]]]]]]]]]]], ['factorlist', ['ID', 'ENDRULES']]]]]]]]]]]], ['ID', 'ENDOBJECT']]]]], ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'if'], ['factorlist', ['factorlist', ['trailedfactor', ['bracketedexpression', ['bracketedexpression', ['explist', ['infixepr', '==', ['ID', '__name__'], ['explist', ['expression', ['string', '__main__']]]]]]], ['blocktrailer', ['block', ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'import'], ['factorlist', ['ID', 'sys']]]]], ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'assign'], ['factorlist', ['factorlist', ['ID', 'lexonly']], ['ID', 'False']]]]], ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'assign'], ['factorlist', ['factorlist', ['ID', 'trace']], ['ID', 'False']]]]], ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'for'], ['factorlist', ['factorlist', ['factorlist', ['factorlist', ['factorlist', ['ID', 'fields']], ['ID', 'in']], ['ID', 'using']], ['trailedfactor', ['ID', 'query'], ['blocktrailer', ['block', ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'SELECT'], ['factorlist', ['ID', 'first_name']]], ['explist', ['expression', ['ID', 'last_name']], ['explist', ['expression', ['dottedfactor', ['ID', 'table_contact'], ['attribute', ['ID', 'phone']]]], ['explist', ['expression', ['ID', 'e_mail']], ['explist', ['functioncall', ['dottedfactor', ['ID', 'table_site'], ['attribute', ['trailedfactor', ['ID', 'name'], ['blocktrailer', ['block', ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'FROM'], ['factorlist', ['ID', 'table_contact']]], ['explist', ['expression', ['ID', 'table_site']]]]], ['statement_list', ['assignment', '=', ['explist', ['functioncall', ['ID', 'WHERE'], ['factorlist', ['dottedfactor', ['ID', 'table_contact'], ['attribute', ['ID', 'objid']]]]]], ['explist', ['expression', ['string', '<CASECONTACTID>']]]], ['statement_list', ['assignment', '=', ['explist', ['functioncall', ['ID', 'AND'], ['factorlist', ['dottedfactor', ['ID', 'table_site'], ['attribute', ['ID', 'objid']]]]]], ['explist', ['expression', ['string', '<CASESITEID>']]]]]]]]]]]], ['factorlist', ['ID', 'ENDSELECT']]]]]]]]]]]]]], ['ID', 'endfor']]]]], ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'if'], ['factorlist', ['factorlist', ['factorlist', ['dottedfactor', ['ID', 'sys'], ['attribute', ['trailedfactor', ['trailedfactor', ['ID', 'argv'], ['bracketedtrailer', ['explist', ['expression', ['number', 1]]]]], ['blocktrailer', ['block', ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'assign'], ['factorlist', ['factorlist', ['factorlist', ['ID', 'source']], ['ID', 'open']], ['dottedfactor', ['bracketedexpression', ['bracketedexpression', ['explist', ['expression', ['dottedfactor', ['ID', 'sys'], ['attribute', ['trailedfactor', ['ID', 'argv'], ['bracketedtrailer', ['explist', ['expression', ['number', 1]]]]]]]]]]], ['methodcall', 'read', ['bracketedexpression', None]]]]]]]]]]]]]], ['trailedfactor', ['ID', 'else'], ['blocktrailer', ['block', ['statement_list', ['exprstatement', ['explist', ['functioncall', ['ID', 'assign'], ['factorlist', ['factorlist', ['ID', 'source']], ['string', 'junk']]]]]]]]]], ['ID', 'end']]]]]]]]]]]]]], ['ID', 'end']]]]]]]]
  • 10. Grammar (SLR) program -> block block -> BLOCKSTART statement_list BLOCKEND statement_list -> statement* statement -> (expression | expression ASSIGNMENT expression | ) EOL expression -> oldexpression (COMMA expression)* oldexpression -> (factor [factorlist] | factor INFIXOPERATOR expression ) factorlist -> factor* factor factor -> ( bracketedexpression | constructorexpression | NUMBER | STRING | ID | factor DOT dotexpression | factor trailer | factor trailertoo ) dotexpression -> (ID bracketedexpression | factor ) bracketedexpression -> BRA [ expression ] KET constructorexpression -> BRA3 [ expression ] KET3 trailer -> BRA2 expression KET2 trailertoo -> COLON EOL block
  • 11. Notes Just uses a slightly modified PLY (1.5) ● All of the examples are parseable by the same ● parser – no changes to the lexer or parser. Just spits out a syntax tree ● Treats everything as a function ●
  • 12. Everything's a function This is a function: ● if bar(bibble=>baz): bla bla bla bingle bongle else: babble babble this = bing Parsed as: Call function “if” with the arguments: ● bar(bibble=>baz), codeblock, “else”, codeblock, “endif”
  • 13. Where...? http:///www.cerenity.org/SWP-0.0.0.tar.gz ● http://www.cerenity.org/SWP/ ● I'd be curious to see someone put a lisp back end ● on it :-) Actually no, don't do that, someone might use this – then...