Skip to content

Common lisp implementation of Val Schorr's Meta-II language

Notifications You must be signed in to change notification settings

stevenbagley/metaii

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meta II

Introduction

This is an implementation of Val Schorre's Meta II language, written in Common Lisp. Meta II is a compiler-writing language for syntax-directed translation, expressed in a syntax similar to BNF rules that are annotated to produce code in the target language. The code here is a virtual machine for the target language. The Meta II compiler can itself be written in Meta II.

Schorre, D.V., 1964. Meta II: a Syntax-oriented Compiler Writing Language. In Proceedings of the 1964 19th ACM national conference (pp. D1.3-1 -- D1.3-11).

Other useful references:

The files

File Contents
metaii.lisp The virtual machine in Common Lisp
aexp.masm James Neighbors algebraic expression syntax, compiled by Meta II
metaii.meta The Meta II interpreter in Meta II
metaii.masm The Meta II interpreter, compiled by Meta II

Examples

  • A simple example (from James Neighbors) of an algebraic expression language:
(run (build-instructions (parse-file "aexp.meta"))
     "fern:=5+6;ace:=fern*5;waldo:=fern+alpha/-beta^gamma;")
  • Compiling the Meta II compiler.
(run (build-instructions (parse-file "metaii.meta"))
     (file-as-string "metaii.meta"))
  • Compiling the Meta II compiler using the compiled Meta II compiler.
(run (build-instructions (parse-file "metaii.masm"))
     (convert-single-to-double (file-as-string "metaii.meta")))

About

Common lisp implementation of Val Schorr's Meta-II language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published