> For the complete documentation index, see [llms.txt](https://harish-kumar.gitbook.io/mathx-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://harish-kumar.gitbook.io/mathx-manual/syntax-and-semantics.md).

# Syntax & Semantics

Here we'll see about the Syntax and Semantics of MathX language

In the [Introduction](/mathx-manual/introduction.md#running-mathx) Section, we executed the following code:

```
!: Hello World Program in MathX Language.

main-para:-
println "Hello, World!".
```

Let us inspect the above code:

* Every Statement/Command written in MathX ends with a period`"."`&#x20;
* 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

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:

```
!: This is not seen by compiler.

main-para:-
println "How are you?".
```

These can also be used to exclude a part of code to be executed temporarily.

{% code lineNumbers="true" %}

```
println "Enter a no: ".
println "Dont execute".
```

{% endcode %}

<pre data-line-numbers><code>println "Enter a no: ".
<strong>!: println "Dont execute".
</strong></code></pre>

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.
