Difference Between Syntax and Semantics
Difference Between Syntax and Semantics
JSP
iOS
SQL HTML CSS Javascript Python
HTML
Difference
Android Between Syntax
and Semantics
Python
Differences C++ Server Side Programming
C Programming
C++ Programming
C#
What is Syntax?
In a programming language, Syntax defines
the rules that govern the structure and
arrangement of keywords, symbols, and
other elements. Syntax doesn't have any
relationship with the meaning of the
statement; it is only associated with the
grammar and structure of the programming
language.
What is Semantics?
Semantics refers to the meaning of the
associated line of code and how they are
executed in a programming language. Hence,
semantics helps interpret what function the
line of code/program is performing.
Semantics is
Syntax is one
one that refers
that defines the
to the
rules and
meaning of
regulations that
1. the associated
helps to write
line of code in
any statement in
a
a programming
programming
language.
language.
Syntax errors
are encountered They are
3. after the encountered
program has at runtime.
been executed
Semantics
Syntax errors
errors are
4. are easy to
difficult to
catch.
catch.
Conclusion
To conclude, syntax deals with the grammar
and structure of a code, while semantics tells
the system about the meaning of the code
and how it is supposed to be executed in a
programming language.
Kiran Kumar
Panigrahi
18K+ Views
Related Articles
What is the difference between Parse
Tree and the Syntax Tree?
HTML5 Semantics
Get Started
Advertisements
TOP TUTORIALS
Python Tutorial
Java Tutorial
C++ Tutorial
C Programming Tutorial
C# Tutorial
PHP Tutorial
R Tutorial
HTML Tutorial
CSS Tutorial
JavaScript Tutorial
SQL Tutorial
TRENDING TECHNOLOGIES
Git Tutorial
Docker Tutorial
Kubernetes Tutorial
DSA Tutorial
SDLC Tutorial
Unix Tutorial
CERTIFICATIONS
DevOps Certification
Online Go Compiler
Online C Compiler
Online C# Compiler