Articles tagged "python"

How Python parses white space
Published on 2017-06-17
One of the most distinct and remarkable things about Python's syntax is its use of white space. Python uses white space for two things: newlines are used to terminate logical lines, and changes in indentation are used to delimit blocks. Both of these behaviors are somewhat contextual.
Tagged: compilers python

How to build a parser by hand
Published on 2014-02-13
Building a hand-written parser is actually not much harder than using a tool. You can easily build something simple, efficient, and flexible, but perhaps not that elegant. I'll show how I built a parser for a simple template language I use to generate HTML for this blog.
Tagged: parsers python web

New and improved blog software
Published on 2014-02-05
If you're a regular reader, you might notice a few changes around here! I just launched a modernization of my blogging software.
Tagged: python web

A simple interpreter from scratch in Python (part 4)
Published on 2011-05-12, edited on 2014-04-12
We will build the last component of the interpreter, the evaluator, by modelling the program environment and by coding how each statement and expression should be executed.
Tagged: compilers imp python

A simple interpreter from scratch in Python (part 3)
Published on 2011-05-09, edited on 2014-04-12
We create an abstract syntax tree for our toy language and write a parser using our parser combinator library.
Tagged: compilers imp parsers python

A simple interpreter from scratch in Python (part 2)
Published on 2011-03-29, edited on 2014-04-12
In this article, we will write a small parser combinator library. The combinator library is language agnostic, so you could use it to write a parser for any language.
Tagged: compilers imp parsers python

A simple interpreter from scratch in Python (part 1)
Published on 2011-02-06, edited on 2014-04-12
In the first part in this series, we build the lexer, the first component of an interpreter for our toy language, IMP.
Tagged: compilers imp python

How to use HTTP cookies in Python
Published on 2009-02-08
Tagged: python web

New Blogging System with Python/MySQL
Published on 2008-01-01
Tagged: python web