txtC to Three-Address Code Translator

Posted on: May 23, 2015 Posted by: esther Comments: 0

txtC to Three-Address Code Translator

The language txtC is a programming language created for educational purposes base on ansi C. Its purpose is to add support for text manipulation to C language. In order for that to happen, a string type was added as a native data type and the functions below were created to manipulate strings and text files.

The software developed for this project is a translator from txtC to a three-address code. It is divided in four parts: lexical, syntax and semantic analyzers followed by an intermediate code generator.

Technologies: C, Three-address Code, LEX, Yacc, Bison and LaTeX.

Function Description
operator= String attribution
operator+= Concatenates two strings or adds a character at the end
operator== Compares two strings
operator[] Gets a character from the string
size Returns the length of the string
clear Clears the string
empty Checks if the string is empty
get_tokens Divides the string in tokens
sfind Finds a character or a string
get_line Gets the next line in the file
get_token Gets the next token in the file
find Checks if the string is a substring in the file
find_token Checks if the string is a token in the file
number_of_tokens Returns the number of tokens in the file

DEVELOPED BY GRIGATI TECH