Contoh :
float x = 10.1;
float y = x*30;
In the above example integer 30 will be typecasted to float 30.0 before multiplication, by semantic
analyzer.
Static And Dynamic Semantics
Static Semantics :
Dinamai demikian karena fakta bahwa ini di periksa atau di cek pada waktu kompilasi. Static
semantic dan meaning of program secara tidak langsung terkait.
Dynamic Semantics :
Ini mendefinisikan arti dari unit program yang berbeda seperti expressions dan statements.
Dynamic semantic di periksa saat runtime tidak seperti static semantic
Referensi
https://www.geeksforgeeks.org/semantic-analysis-in-compiler-design/
https://www.quora.com/What-is-semantic-analysis
https://expertsystem.com/natural-language-process-semantic-analysis-definition/
https://www.tutorialspoint.com/compiler_design/compiler_design_semantic_analysis.htm