US final report ( programming language and paradigms ) using Racket

Your task for this course project is to generate a simple programming language with some weird constructs. Here’s an example:

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

+~! hello, world? 5 ^_^

This programming language uses non-standard symbols and includes a greeting message and a cute face. When executed, it should output the sum of 5 and 1 (because the ^_^ symbol represents 1).

Now, let’s move on to the steps for designing this language:

  1. Define the language’s grammar: You’ll need to define the syntax and rules for the language, including the lexicon and the syntax for constructing and executing the language’s code. For our language, the grammar might include a greeting message followed by an arithmetic expression, terminated by the cute face symbol.
  2. Design the lexer: The lexer is responsible for scanning the source code and converting it into tokens that the parser can understand. You’ll need to design the lexer to recognize the language’s lexicon, which includes the non-standard symbols and the arithmetic operators.
  3. Design the parser: The parser is responsible for analyzing the tokens produced by the lexer and constructing a parse tree, which represents the structure of the code. You’ll need to design the parser to recognize the syntax defined in the grammar and to construct the appropriate parse tree.
  4. Implement the interpreter: The interpreter is responsible for executing the code represented by the parse tree. You’ll need to implement the interpreter to evaluate the arithmetic expression and output the result.
  5. Test and refine the language: Once you’ve implemented the lexer, parser, and interpreter, you’ll need to test the language to ensure that it works as expected. You may need to refine the language’s grammar and implementation to correct any issues that arise during testing.

To design this project using Racket, you can use Racket’s built-in tools for language design, including the parser and lexer libraries. Here are some resources that may be helpful:

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
  • The Racket documentation: https://docs.racket-lang.org
  • The Racket documentation on lexing and parsing: https://docs.racket-lang.org/parser-tools/index.ht…
  • I ALREADY HAVE A PROGRESS REPORT WHICH HAS THE INITIAL DESIGN , YOU ONLY NEED TO CONTINUE ON IT ( uploaded the progress report )
  • a report is required for the project + a real demo showing your code and a working example.
  • + ppt ( if possible )

Table of Contents
Introduction ………………………………………………………………………………………………….. 2
Grammar ………………………………………………………………………………………………………. 2
Operators ……………………………………………………………………………………………………… 4
Example code ……………………………………………………………………………………………….. 5
The token stream …………………………………………………………………………………………… 5
Derivation …………………………………………………………………………………………………….. 5
Output ………………………………………………………………………………………………………….. 7
Lexeme ………………………………………………………………………………………………………. 10
Introduction
This project will mainly focus on developing a:- grammar , It’s derivation, Language along with
its example, and finally an output, all developed using the racket langue.
This programming language is meant to be different from other programming languages as the
syntax may not appear as the others.it is meant to cut the monopoly in programming languagesas
it will give a challenge in the development of languages and push for more advancement in the
coming programming languages.
In the design part, the grammar for the language is meant to include a greeting message at the start
of each program it is accompanied by arithmetic expressions, and at the end is a cute face symbol.
the greeting message is represented with “+~!” symbol and ends with a question mark.
For example
+~! hello, world?
Represents a greeting message.
Grammar
→ ‘^_^’
→ ‘+~!’ ‘?’

→ { }
→ { }
→ | ‘(‘ ‘)’
→ +
→ ‘+’ | ‘-‘
→ ‘*’ | ‘/’
→ +
→ | |
→ ‘a’ … ‘z’ | ‘A’ … ‘Z’
→ ‘0’ … ‘9’
→ ‘,’ | ‘!’ | ‘?’ | ‘ ‘ | ‘.’ | ‘_’ | ‘:’ | ‘;’ | ‘”‘ | ”’
Operators
The language puts into consideration the mathematic operators such as division, multiplicationand
addition, and subtraction as well as the parenthesis.
Assignment operator → ‘:’
Arithmetic operators → ‘+’ , ‘-‘ , ‘*’ , ‘/’ , ‘^’ , ‘%’
Bitwise operator → ‘&’ , ‘|’ , ‘^|’ , ‘?’ , ‘:)’ , ‘>>>’ , ‘), and less than ( count & count < 10) { count: count * 2 sum: (count / 2) +1 }

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER