Skip to content

Compiler written in OCaml of Edsger-lang that outputs x86-64 assembly for Linux-MacOS

Notifications You must be signed in to change notification settings

ctsan/Edsger-Compiler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Edsger Compiler

How To Compile it

make 

How To Test it

make test  (for standard error printing only) 
make testf (for full print)

files ending with 'w' are invalid, files ending with 'c' are correct

Requirements To Compile

  • opam (package manager)
  • core (opam install core)
  • menhir (opam install menhir)

For Developers

  • OUnit (opam instal ounit)
  • utop (opam install utop)

Error Codes

  • [1] Lexical Error
  • [2] Syntax Error
  • [3] Semantic Error

Instructions for Developers

Semantic analysis

  1. all used IDs are declared
  2. declared only once in each scope
  3. operators used with right operands
  4. functions used with right number and type of args
  5. control-flow checks

Symbol Table

Identifiers are associated with information related to its declaration or appearance in the source (location,type,scope).

Operations

  • add name
  • search name (important part)
  • delete name(s)

Information Contained

  • Name of Program

  • Of Variables

  • Of Functions, their arguments, the number of arguments, the returned type (for semantic analsis), byref or not arguments

  • Scope (import or remove a variable)

  • Visibility

  • Position of Variable in Mem/Register

  • Of labels

About

Compiler written in OCaml of Edsger-lang that outputs x86-64 assembly for Linux-MacOS

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • OCaml 91.8%
  • Standard ML 3.0%
  • Shell 2.3%
  • Makefile 2.1%
  • Other 0.8%