Your task for this course project is to generate a simple programming language with some weird constructs.
Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
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:
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.
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.
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.
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.
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.
use Racket.
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 on parsing: https://docs.racket-lang.org/parser/index.html
The Racket documentation on lexing: https://docs.racket-lang.org/lex/index.html
The Racket Guide to Building Languages: https://docs.racket-lang.org/guide/building-languages.html
Turn in your highest-quality paper
Get a qualified writer to help you with
“ Prog languages and paradigms ( racket ) project progress report 1 ”
Get high-quality paper
Guarantee! All work is written by expert writers!