User Tools

Site Tools


info:jimpi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
info:jimpi [2010/05/04 10:29] – grammar moritzinfo:jimpi [2010/05/16 18:15] (current) – update link moritz
Line 1: Line 1:
 ====== 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 ===== ===== Language =====
Line 10: Line 10:
 File: Procedure* Statement*; File: Procedure* Statement*;
 Procedure: 'procedure' Symbol '(' (symbol (',' symbol)*)? ';' (symbol (',' symbol)*)? ')' 'begin' Statement* 'end'; Procedure: 'procedure' Symbol '(' (symbol (',' symbol)*)? ';' (symbol (',' symbol)*)? ')' 'begin' Statement* 'end';
-Statement: While | Until | For | Scope | Assign;+Statement: While | Until | For | Scope | Assign | If | Skip;
 While: 'while' Expression 'do' Statement* 'end'; While: 'while' Expression 'do' Statement* 'end';
 Until: 'repeat' Statement* 'until' Expression; Until: 'repeat' Statement* 'until' Expression;
Line 16: Line 16:
 Scope: 'var' Assign 'in' Statement* 'end'; Scope: 'var' Assign 'in' Statement* 'end';
 Assign: Symbol ':=' Expression; Assign: Symbol ':=' Expression;
 +If: 'if' Expression 'then' Statement* ('else' Statement*)? 'end';
 +Skip: 'skip';
  
-Expression: '(' Expression BinOp Expression ')' | Number | Symbol+Expression: '(' Expression BinOp Expression ')' | Number | Symbol | Symbol '(' (Expression (',' Expression)*)? ';' (symbol (',' symbol)*)? ')'
 BinOp: '+' | '-' | '*' | '=' | '#' | '>' | '>' | '>=' | '<=' | 'and' | 'or'; BinOp: '+' | '-' | '*' | '=' | '#' | '>' | '>' | '>=' | '<=' | 'and' | 'or';
 </code> </code>
info/jimpi.1272961753.txt.gz · Last modified: 2010/05/04 10:29 by moritz

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki