CLASS XII
COMPUTER SCIENCE (083)
PREPARED & PRESENTED BY
VIGNESH S
PGT (COMPUTER SCIENCE)
GOOD SAMARITAN PUBLIC SCHOOL, SIRKALI
COMPUTATIONAL THINKING AND PROGRAMMING -2
HOW PROGRAMMING LANGUAGES
ARE MADE
•Creatingaprogramminglanguageinvolvesdefiningitssyntax
(structure),semantics(meaning),andthenbuildingacompiler
orinterpretertotranslatethatcodeintoexecutableinstructions
REVISION OF PYTHON TOPICS
COVERED IN CLASS XI.
•TOPICS TO COVER
•PYTHON TOKENS
•CONCEPT OF L VALUE AND R VALUE
•USE OF COMMENTS
HOW THE COMPILER WORKS
HOW THE LANGUAGE COMPILER WORKS
•Lexicalanalysis(tokenizing)
•Syntaxanalysis(parsing)
•Semanticanalysis
•Optimization,andcodegeneration
•Culminatinginthetranslationofsourcecodeintoexecutablemachine
code
FRONT & BACKEND OF PROGRAM
COMPILATION
COMPILER WORK FLOW MODEL
•LexicalAnalysis:Tokenizationofsourcecodeintomeaningfulunits
(tokens).
•SyntaxAnalysis:Constructionofaparsetreebasedongrammar
rules.
•SemanticAnalysis:Ensurescorrectnessofmeaning(e.g.,type
checking).
•IntermediateCodeGeneration:Producesanintermediate
representation(IR)foroptimizationandportability.
•CodeOptimization:Enhancestheefficiencyoftheintermediatecode.
•CodeGeneration:TranslatesoptimizedIRintotargetmachinecode.
LINKING AND LOADING:
•Linking:Theprocessofcombiningmultipleobjectfilesandresolving
symbolicreferences(suchasfunctioncallsandvariableaccesses)to
generateasingleexecutablefile.
•Loading:Theprocessofplacingtheexecutablefileintomemory,
resolvingruntimeaddresses,andpreparingitforexecutionbythe
CPU.
PROGRAM COMPILER WORK FLOW
WHAT IS SYMBOL TABLE
•Asymboltableisessentiallyastructuredrepresentationormapping
thatlistsallsymbols(variables,operators,functions,etc.)usedina
programmingcontext.ForarithmeticoperationsinPython.