7 \title[cc1516: Semantic analysis
]{SPLC
}
8 \subtitle{\texttt{<splc>~::= <spl> <parser> `,' <lexer> `and' <compiler>
}}
9 \author[P. Jager, M. Lubbers
]{Pim Jager
\inst{1}\and Mart Lubbers
\inst{1}}
10 \institute[Radboud University
]{%
12 Computer Science: Software Science\\
15 \subject{Code generation
}
19 basicstyle=
\ttfamily\footnotesize,
24 \usecolortheme{beaver
}
29 \begin{frame
}[fragile
]
30 \frametitle{\textsc{SPLC
}}
31 \begin{block
}{Features
}
33 \item Implementation language:
34 Clean (
{\tiny\url{http://clean.cs.ru.nl
}})
35 \item Type checking and type inference
36 % \item No multiple recursion\ldots\pause\ yet\ldots\pause%
37 \item Higher order functions
40 \begin{block
}{Changes
}
43 gen.icl |
221 ++++++++++++++
44 grammar/grammar.txt |
19 +-
47 sem.icl |
676 ++++++++++++++++++++++++------------------
54 \frametitle{Progress since previous presentation
}
56 \item Completely redid typechecking and inference
57 \item Extended semantic analysis with
59 \item Complain when unknown functions are used
60 \item Complain when there is no main
61 \item Complain when
\CI{Void
} is used as a non terminal type
62 \item Complain when duplicate functions are used
63 \item Complain when the main is not of the correct form
65 \item Higher order functions
66 \item Code generation for expressions
67 \item A lot needs to be done
\ldots
71 \begin{frame
}[fragile
]
72 \frametitle{Type checking
}
73 \begin{block
}{Two pass
}
75 \item Constraint collecting
76 \item Constraint satisfaction
80 \begin{block
}{\CI{RWST
}}
82 :: Scheme = Forall
[TVar
] Type
83 :: Gamma :== Map String Scheme
84 :: Typing a :== StateT (Gamma,
[TVar
]) (Either SemError) a
85 :: Substitution :== `Map'.Map TVar Type
86 :: Constraints :==
[(Type, Type)
]
92 \begin{frame
}[fragile
]
93 \frametitle{Code generation
}
96 :: SSMProgram :==
[Instr
]
97 :: Instr = Instr String
[Arg
] String
100 :: Arg = L Label | Lit Int | Raw String
101 :: GenError = Error String
102 :: GenMap :== Map String LoadPlace
103 :: LoadPlace = LDA Int | LDC Int | LDH Int | LDL Int
109 \begin{block
}{\CI{RWST
} we meet again
}
111 :: Gen a :== RWST () SSMProgram (GenMap,
[Label
]) (Either GenError) a
116 \begin{frame
}[fragile
]
118 \begin{block
}{Higher order functions
}
119 Read up on how to implement higher order functions
122 \begin{block
}{Hand in hand with code generation
}
123 To get a fully working compiler and
report before the deadline