Download presentation
Presentation is loading. Please wait.
Published byNickolas Park Modified over 9 years ago
2
القليل اللثغة مترجم ( リトル LISP コンパイラ ) دانيال تو مايو كين ( ダニエル · 火月の親 族 ) يوهان حزقيل (a 洋平ハスケル )
3
LL Compiler Igor Dultsev Danil Tumaykin Winter School 2012 @ NSU-Intel Lab
4
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
5
Architecture & Design Four phases – four classes: Lexic analyzer – Lexer Syntax analyzer - Parser Semantic analyzer Code generator
6
Lexer Performs lexical analysis of LL language source code. Input: String containing LL source. Output: Collection of IToken ’s.
7
Lexer use sample (defun sqr (x) (* x x))
8
Parser Parses a collection of IToken ’s into a collection of IParsedValue ’s. Input: Collection of IToken ’s.. Output: Collection of IParsedValue.
9
Parser Use Sample (defun f (x y) (+ (* x y) 7))
10
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.
11
Semantic analyzer use sample
12
Type System Any IntCharStringList Nothing
13
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.
14
Code generation sample
15
GUI
16
Features we didn’t implemented (yet) Our VM Bytecode Generator λ-functions Standard Library Good IDE :o
17
Why did we do it at all? Projects reasons-to exists Future – Intel-NSU Laboratory compiler project
18
Thank you! Q&A Section begins here
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.