Next revision | Previous revision |
info:jimpi [2010/05/04 08:18] – created moritz | info:jimpi [2010/05/16 16:15] (current) – update link moritz |
---|
====== JIMPI - Java IMP Interpreter ====== | ====== JIMPI - Java IMP Interpreter ====== |
In the lecture [[http://www.infsec.ethz.ch/education/ss10/fmfp|Formal Methods and Functional Programming]] we were reasoning about a simple language called IMP. The JIMPI project implements a parser, interpreter and bytecode emitter. The source is available as an Eclipse project from [[http://dev.antiguru.de/jimpi.zip]] | In the lecture [[http://www.infsec.ethz.ch/education/ss10/fmfp|Formal Methods and Functional Programming]] we were reasoning about a simple language called IMP. The JIMPI project implements a parser, interpreter and byte code emitter. The source is available from [[http://jimpi.origo.ethz.ch/]]. |
| |
| ===== Language ===== |
| The language grammar: |
| <code> |
| Number: '0'..'9'+; |
| Symbol: 'a'..'z'|'A'..'Z' (a'..'z'|'A'..'Z'|'0'..'9')* |
| |
| File: Procedure* Statement*; |
| Procedure: 'procedure' Symbol '(' (symbol (',' symbol)*)? ';' (symbol (',' symbol)*)? ')' 'begin' Statement* 'end'; |
| Statement: While | Until | For | Scope | Assign | If | Skip; |
| While: 'while' Expression 'do' Statement* 'end'; |
| Until: 'repeat' Statement* 'until' Expression; |
| For: 'for' Assign 'to' Expression 'do' Statement* 'end'; |
| Scope: 'var' Assign 'in' Statement* 'end'; |
| Assign: Symbol ':=' Expression; |
| If: 'if' Expression 'then' Statement* ('else' Statement*)? 'end'; |
| Skip: 'skip'; |
| |
| Expression: '(' Expression BinOp Expression ')' | Number | Symbol | Symbol '(' (Expression (',' Expression)*)? ';' (symbol (',' symbol)*)? ')' |
| BinOp: '+' | '-' | '*' | '=' | '#' | '>' | '>' | '>=' | '<=' | 'and' | 'or'; |
| </code> |
===== License ===== | ===== License ===== |
Jimpi is published under the tems of [[http://www.eclipse.org/legal/epl-v10.html|EPL 1.0]]. | Jimpi is published under the tems of [[http://www.eclipse.org/legal/epl-v10.html|EPL 1.0]]. |
| |