GlaDOS dev-docs
  • Introduction
  • Getting started
    • Pre-requisite
    • Installation
    • Creating our first function
  • Prism's Features
  • Prism Compiler
  • Prism Bytecode File Structure
  • Exeption Handling
  • Grammar language
  • Test Policy
    • Unit & integration tests
    • Continuous Integration and Deployment (CI/CD)
  • Appendix
Powered by GitBook
On this page

Exeption Handling

The Prism language itself handles various syntax and logic errors in the code.

  • Error Message format Prism errors are simple strings of characters displayed on the screen each time they are detected.

[
    Message Example : "Syntax Error: Function not declared properly"
]
  • Error Code Prism errors are accompanied by a value feedback.

[
     Message Example : "Syntax Error: Function not declared properly",
     Return Value: 84
]
  • Error Details This is a list of all the errors currently handled by Prism:

Function not well declared

  [
      Message Error : "Syntax Error: Function not declared properly",
      Return Value: 84
  ]

Parenthesis or curly bracket bad placed or missed

  [
      Message Error : "Syntax Error: Curly bracket or parenthesis not properly placed in function main",
      Return Value: 84
  ]

No main in the program

  [
      Message Error : "Code Error: No main function in your program",
      Return Value: 84
  ]

Use of undeclared function

  [
      Message Error : "Code Error: In function main usage of an undeclared function: abs",
      Return Value: 84
  ]

None existing variable

  [
      Message Error : "Code Error: In function main variable >> x << not declared",
      Return Value: 84
  ]

Here is a list of all the remaining errors to be integrated into the language:

  1. Check good instruction line

  2. Check for semicolon at the end of instruction line

  3. Check for libraries import

Last updated 1 year ago