Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close
PMLogo
======

PMLogo is a very simple implementation of a logo-like language interpreter used
to draw images with low-level primitives.

It is written in Python2 and use Pygame.


Language
========

This language (the PMLogo language?) is designed to be handled by a LL(1)
parser. Its syntax can therefore seem quite cumbersome, but nevermind. ;-)

The language is a not-so-well-thought-work-in-progress, so there will first be
only examples, but no grammar.

program
parameters
    screen_width 400
    screen_height 300
modules
code
do
    call color 0 0 0 .
    call rect 0 0 screen_width screen_height .
    set size = 0
    if call <= screen_width screen_height .
    do
        set size = screen_width
    else
        set size = screen_height
    done

    set i = 0
    set step = 10
    while call < i size .
    do
        set light = call / call * i 255 . 255 .
        call color light light light .
        call rect i i step step .
        set i = call + i step .
        call sleep 500 .
    done
done

Recent activity

Pierre-Marie de Rodat

Commits by Pierre-Marie de Rodat were pushed to pmderodat/PMLogo

63b6df9 - Fixed 'if' and 'else' AST nodes building in the parsing. Both are now built with Instructions AST nodes instead of just lists of Instruction AST ...
Pierre-Marie de Rodat

Commits by Pierre-Marie de Rodat were pushed to pmderodat/PMLogo

0fd0d22 - Finished identifiers parsing. The set and the parameter statements parsing used to yield id tokens instead of id AST nodes. This is now fixed.
Pierre-Marie de Rodat

Commits by Pierre-Marie de Rodat were pushed to pmderodat/PMLogo

ee89deb - Fixed the function calling parsing. The function calling parsing used to take an identifier as the called function and used to badly build the AST. ...
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.