Skip to content

shalekesan/c2java

 
 

Repository files navigation

This project consist of 3 files described as follows.

======================================================
** In file src:

1. c2java.l is the lexical specification for flex.
2. c2java.y is the syntactic specification for bison.
3. c2java.h declares the data structure of ast_node, type_node, scope_node, sym_node and other functions prototypes which are used through out the building of the compiler.
4. main.c contains the main() function which drives the whole parsing process.
5. ast.c implements functions required for building the AST, type table, symbol table and scopes.
6. print_ast.c implements functions required for printing the AST in HTML format.
7. check_ast.c implements functions required for checking the AST types according to scopes.
8. trans_ast.c implements functions required for translating the abstract syntax tree to java code.

** report.pdf illustrates the design and implementations of the translator.

The Makefile is available to assist operating:
1. make: is to compile the translator c2java.
2. make test: is to call the runtest.sh to translate and run the test cases.

About

A translator of c to java.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 47.7%
  • Shell 24.2%
  • Makefile 12.0%
  • TeX 10.0%
  • C++ 4.0%
  • Perl 0.9%
  • Other 1.2%