Syntax & Semantics
Here we'll see about the Syntax and Semantics of MathX language
Last updated
Here we'll see about the Syntax and Semantics of MathX language
Last updated
In the Section, we executed the following code:
Let us inspect the above code:
Every Statement/Command written in MathX ends with a period"."
Line starting with !:
are not executed by the compiler. They are known as comments. These are used to document your code.
Lines after the main-para:-
header are executed.
Every Program should end with a newline. Else, the compiler will raise a SyntaxError
With these inspections, you may now have a conclusion about how a program looks. Let's dive deep into it!
Comments are used to give documentation to your code. They are useful as they make code readable. Single-Line Comments are only available in MathX. For example:
These can also be used to exclude a part of code to be executed temporarily.
This prevents the compiler from executing the 2nd line. meanwhile, you can debug(i.e., check errors) in your code. Don't forget to remove your comment after debugging.