1 / 17

LL Compiler

LL Compiler. Igor Dultsev Danil Tumaykin Winter School 2012 @ NSU-Intel Lab. Project Specification. How we saw our project at the beginning: Source Language: LL(Lisp Dialect – Little Lisp) Target: C, maybe our VM Code Project Language: C# VCS: git/github.com License: CC

levia
Télécharger la présentation

LL Compiler

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LL Compiler Igor Dultsev DanilTumaykin Winter School 2012 @ NSU-Intel Lab

  2. Project Specification How we saw our project at the beginning: • Source Language: LL(Lisp Dialect – Little Lisp) • Target: C, maybe our VM Code • Project Language: C# • VCS: git/github.com • License: CC • Deadline: 2012/02/04 • Key features: standard types, list, string, λ-functions • Standard library • Interface: • Console, GUI • Unit Tests

  3. Architecture & Design Four phases – four classes: • Lexic analyzer – Lexer • Syntax analyzer - Parser • Semantic analyzer • Code generator

  4. Lexer Performs lexical analysis of LL language source code. Input: String containing LL source. Output: Collection of IToken’s.

  5. Lexer use sample (defunsqr (x) (* x x))

  6. Parser Parses a collection of IToken’s into a collection of IParsedValue’s. Input: Collection of IToken’s.. Output: Collection of IParsedValue.

  7. Parser Use Sample (defun f (x y) (+ (* x y) 7))

  8. Semantic analyzer Adds semantic information to the parse tree and builds the symbol table & computes types information. Input: Collection of IParsedValue. Output: List of Function’s.

  9. Semantic analyzer use sample

  10. Type System Any Int Char String List Nothing

  11. Code generator Generates code from a Function’s. CG also generates code snippets for standart functions. Input: List of Function’s. Output: List of GeneratedCFunction’s, string or file.

  12. Code generation sample

  13. GUI

  14. Features we didn’t implemented (yet) • Our VM Bytecode Generator • λ-functions • Standard Library • Good IDE :o

  15. Why did we do it at all? • Projects reasons-to exists • Future • Intel-NSU Laboratory compiler project

  16. Thank you! Q&A Section begins here

More Related