Contributors:
- GuruPreetam
- Nachiappan
- Nayan Jain
- Chandan Yadav
Introduction
Our Language is mainly inspired from imperative languages and Object-Oriented Languages such as C, C++, Java, Python. It is named as DeepC. Easy to code as the keywords are mostly familiar and is highly user friendly. Compiler and the Run time environment are created using Java.
Tools: 1.Windows 2.ANTLR 3.Java 4.Maven
Compilers:
- Developed in Java
- ANTLR (Another Tool for Language Recognition) : Lexer and parsing is taken care by the tool.
- Intermediate code is generated using Java in the ListenerClass.
- Parser generates a parse tree by using all the tokens that are generated after Lexer analysis.
Interpreter:
- The Interpreter is developed using Java by using the intermediate code.
- The input is fed to the intermediate code and output is generated.
Lexical Analysis and Parsing using ANTLR:
- ANTLR tools reads the program and tokenizes them according to the grammar defined in the .g4 file.
- The tokens generated are later fed into the parser.
- The parser generates the parse tree for a given input of tokens.
- Every node in the parse tree has been given semantics using the intermediate code in Java.
- Internally we plan to use Stack and HashMap and if needed any other Data Structures to extend implementation in the future.
Steps to execute the program:
- Download the repository
- Navigate to the src/target folder
- Enter the command java -jar deepcdemo-0.0.1-SNAPSHOT-jar-with-dependencies path/filename.dpc
- Example: C:\SER502-Spring2020-Team17\src\target>java -jar deepcdemo-0.0.1-SNAPSHOT-jar-with-dependencies.jar C:\SER502-Spring2020-Team17\data\factorial_while.dpc
- The intermediate code is generated in the same folder with a .idpc extension.
Note: If jar file not found please add .jar extension to jar file