A 4 member-team project for the CEID course of Principles of Programming Languages. Created a compiler and a parser using the tools Flex and Bison for lexical and grammar analysis.
- Description of the language in BNF
- The language syntax and grammar were defined using Backus-Naur Form (BNF). This formal notation was essential for specifying the language's structure and rules.
- Use of Flex and Bison tools
- Flex (Fast Lexical Analyzer Generator): Used for generating the lexical analyzer. Flex scans the input text and breaks it down into tokens, which are the basic building blocks of the language.
- Bison (GNU Parser Generator): Used for generating the parser. Bison takes the tokens produced by Flex and organizes them according to the grammar defined in BNF, creating a parse tree that represents the syntactic structure of the input.
- Creation of Pseudo-code for a language that followed same grammar and syntax rules as XML
- Developed pseudo-code for the custom language that followed the same grammar and syntax rules as XML. This pseudo-code helped in visualizing and testing the compiler’s functionality.
Technologies and Frameworks:
- Flex: For generating the lexical analyzer.
- Bison: For generating the parser.
- Sublime Text: As the text editor for writing code and configurations.
- C: The programming language used for implementing the compiler.
- Cygwin Terminal: Used to provide a Unix-like environment and command-line interface on Windows, facilitating the compilation and testing processes.