项目作者: AkshayGogeri

项目描述 :
Simulation of front end phase of C Compiler involving if-else construct using lex and yacc tools.
高级语言: Yacc
项目地址: git://github.com/AkshayGogeri/If-Else-Compiler-in-C.git
创建时间: 2017-09-09T06:03:14Z
项目社区:https://github.com/AkshayGogeri/If-Else-Compiler-in-C

开源协议:

下载


If-Else-Compiler-in-C

Simulation of front end phase of C Compiler involving if-else construct using lex and yacc tools.

Running Instructions:
1.run -> sh compile.sh

files:
lexer.l
parser.y
input.c
input3.c
input4.c

Explanation:

Lexical Analysis: Generation of tokens in lexer.l using regular expressions.
Syntax Analysis: Created grammar for entire C code that has IF-ELSE construct. Nested IFs are also taken into account. Parsing generates “Success” or “error” with line number.

Semantic Analysis : Annotate the grammar with actions to create symbol table, create Abstract Syntax Tree nodes, check for type, check for scope and return detailed errors if any of these fail. The symbol table contains the token name, token data type, token type, line number where it is defined.

Intermediate Code Generation: Generated intermediate code on the fly.

Contributors:
1PI14CS006 ABHISHEK SINGH
1PI14CS013 AKSHAY GOGERI
1PI14CS021 ASHWIN KAMAT
1PI14CS027 BITRA BANUCHANDRA