Presentation is loading. Please wait.

Presentation is loading. Please wait.

Group 4 Java Compiler Group Members: Atul Singh(Y6127) Manish Agrawal(Y6241) Mayank Sachan(Y6253) Sudeept Sinha(Y6483)

Similar presentations


Presentation on theme: "Group 4 Java Compiler Group Members: Atul Singh(Y6127) Manish Agrawal(Y6241) Mayank Sachan(Y6253) Sudeept Sinha(Y6483)"— Presentation transcript:

1 Group 4 Java Compiler Group Members: Atul Singh(Y6127) Manish Agrawal(Y6241) Mayank Sachan(Y6253) Sudeept Sinha(Y6483)

2 Java Programming Language Introduction: Java is a programming language originally developed by Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The syntax of Java is largely derived from C++. Unlike C++, Java was built almost exclusively as an object oriented language. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of computer architecture.

3 Functional Specifications To compile a source file, simply pass the file name on the command line. Options: -o filename: places the output in file filename. If this option is not specified, the default approach is to put the output in file a.out -h : Prints a synopsis of standard options -opt : Optimize the final code

4 Functional Specifications Variable Types: Integer, float, double, Boolean, char, string Strings: basic operations like length, concatenation, substring etc. Operators: Arithmetic, logical and relational with defined preference and associativity Arrays: Single and multidimensional arrays Scoping: Support logical blocks with scoping of variables. Conditional Statements: if-then-else, switch-case. Comments: Single and multi line comments.

5 Functional Specifications(cont.) Looping Statements: for-loop, while-loop, do-while loop, break, continue. Methods: Implementation of static methods of Java. Pass-by- value and pass-by-reference methods. Recursion: Implementation of recursive methods supporting various optimizations.

6 Lexical Analyzer The lexical analyzer build using a lexical generator, accepts a string of characters and outputs the token present in it. It also recognizes the type of token i.e. whether it is keyword, identifier, number, operator, string, comment etc. using well defined regular expressions. The program outputs the type of all the tokens in the input sequence of characters. Implemented using LEX tool.

7 Lexical Analyzer In case the token is an identifier, it is inserted into the SYMBOL TABLE. The identifier is inserted only if there is no prior entry in the symbol table for that identifier. To view the contents of the symbol table, just type “lpr”- a separate command to list the contents of symbol table at any given instant.

8 Progress Lexical Analyser: Complete Tools Used: LEX. Parser: In progress Tool Used: YACC.


Download ppt "Group 4 Java Compiler Group Members: Atul Singh(Y6127) Manish Agrawal(Y6241) Mayank Sachan(Y6253) Sudeept Sinha(Y6483)"

Similar presentations


Ads by Google