This project involves the development of a lexical analyzer and an abstract syntax tree (AST) generator for a programming language. The lexical analyzer processes the source code to generate tokens, and the AST generator creates an abstract syntax tree from these tokens.
- Lexical Analysis: The
Lexing.cppfile reads the source code frommyCode.txt, generates a string of tokens, and stores them inLexing.txt. - AST Generation: The
AST_nw.exeexecutable reads the tokens fromLexing.txtand generates an abstract syntax tree (AST).
-
Lexical Analysis:
- Input:
myCode.txt(source code) - Output:
Lexing.txt(tokens) - Process:
Lexing.cppreads the source code, generates tokens, and writes them toLexing.txt.
- Input:
-
AST Generation:
- Input:
Lexing.txt(tokens) - Output: AST (abstract syntax tree)
- Process:
AST_new.cppreads the tokens fromLexing.txtand generates an AST.
- Input:
- C++: For the lexical analyzer and AST generator.