Page cover

💿Compilation Process

The entire Maryl compilation process is explained here

1. Input File

  • The process begins with a file named HelloWorld.mrl.


2. Parsing of the File

  • The file undergoes a parsing step to ensure it adheres to the required syntax and format.


3. Error Handling (Initial Parsing Phase)

  • After parsing:

    • If an error is found: The error is flagged and sent to the error-handling mechanism.

    • If no error is found: The process continues to the conversion step.


4. Conversion to Assembler

  • The parsed file is converted into assembler code, a low-level representation of the program.


5. Virtual Machine Processing

  • The assembler code is retrieved and parsed by the Virtual Machine (VM) for further analysis.


6. Error Handling (Virtual Machine Phase)

  • At this stage:

    • If an error is encountered: The error is processed, and the workflow terminates with an error message.

    • If no error is encountered: The VM proceeds to interpret the operations.


7. Interpretation of Operations

  • The Virtual Machine interprets the assembler instructions step by step.


8. Final Output

  • Upon successful execution, the program outputs the string: "Hello World!"


Error Handling Summary

  • Errors can occur in two key stages:

    1. During file parsing

    2. During Virtual Machine parsing

  • In both cases, the system gracefully terminates and displays an appropriate error message.


This structured workflow ensures that errors are detected early, enabling efficient debugging and reliable execution.

Last updated