Binary Operators: + , - , * , / ,exponentiation operator (denote it as @)
Data types: int , unsigned , signed , bool , float
Bitwise operators : | , & , ~ , ^(XOR)
Logical Operators : || , && , !
Relational Operators : ==, !=, <, <=, >, >=
Assignment Operators : = , += , -= , *= , /=
Unary opeartors : + , -
Postfix / Prefix Operators : ++ , --
Identifiers:Simple identifiers without special characters (starts with alphabet)
Assignment Statement
Expressions:
infix expressions
Iterative
Conditional:
if-else
else-if
switch
Repetitive:
while
Jump :
continue
break
It follows C operators precedence , syntax rule.
There is no scope rule for identifiers .
There is no function call.
Functions shouldn't have argument(s).
It reports following error messages
lval requirement
case label duplication
Variable is not defined
Redeclaration of variable
Input
- C program which follows synatx rule as described above
Output
- 3 address code , Output will be displayed on terminal/cmd and it's also available in file output.txt
$ git clone https://github.com/sonus21/C-programm-to-3-address-translator.git
or
trans
$ unzip C-programm-to-3-address-translator-master.zip
$ cd C-programm-to-3-address-translator
[1] If you are having binary file name trans
$ ./trans filename
e.g. $ ./trans test.c
[2] If you are having source code of the program .
Requirements
[1] GNU make utilities
[2] GNU flex/LEX
[3] GNU YACC/Bison
[4] g++ >=4.8
$ cd C-programm-to-3-address-translator
$ make
Please report problems and bugs to trans issue tracker.
The content of this project is licensed under the Creative Commons Attribution 3.0 license